Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Flashlight

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Greenwado
Well, it's just me, what did you expect?




Joined: 09 Aug 2010
Posts: 70
Location: Okacha (OK-A-CHA)

PostPosted: Sat Aug 14, 2010 7:39 am    Post subject: Flashlight Reply with quote

How could I make a Flashlight for my walkabout player character using plot scripting? In your answer could you write an example script or a couple of lines to help me figure this out. I want to make a action Thriller game sort of like Alan Wake.
_________________
Happy RPG Makin
Back to top
View user's profile Send private message
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Sun Aug 15, 2010 1:41 pm    Post subject: Reply with quote

First, making a game similar to Alan Wake will require extensive scripting knowledge. You might want to start small.
Second, I've made a game with a flashlight in the past.
Here's the link:
http://www.castleparadox.com/gamelist-display.php?game=938
Third, if you like the flashlight script in House Escape (the above game) I'd be willing to share a little of the code. If you're looking for something different I may still be willing to put you on the right track.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
J_Taylor
The Self-Proclaimed King of Ketchup




Joined: 02 Dec 2009
Posts: 188
Location: Western NY

PostPosted: Tue Aug 17, 2010 3:41 am    Post subject: Reply with quote

How about a script for just illuminating certain areas; e.g. You're in a dark cave (black) and the only light comes from flickering torches which you can grab and move?
_________________
Elemental: .75%
Heart of Darkness: 0% (crash)
The Mansion: .05%
Shattered Alliance: .05%

See a pattern forming? I do, dammit.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
J_Taylor
The Self-Proclaimed King of Ketchup




Joined: 02 Dec 2009
Posts: 188
Location: Western NY

PostPosted: Tue Aug 17, 2010 3:48 am    Post subject: Reply with quote

How about a script for just illuminating certain areas; e.g. You're in a dark cave (black) and the only light comes from flickering torches which you can grab and move?
_________________
Elemental: .75%
Heart of Darkness: 0% (crash)
The Mansion: .05%
Shattered Alliance: .05%

See a pattern forming? I do, dammit.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Pepsi Ranger
Reality TV Host




Joined: 05 Feb 2003
Posts: 493
Location: South Florida

PostPosted: Tue Aug 17, 2010 6:50 am    Post subject: Reply with quote

Quote:
How about a script for just illuminating certain areas; e.g. You're in a dark cave (black) and the only light comes from flickering torches which you can grab and move?


Besides all the helpful answers that come from reading Hamster Republic's OHRRPGCE FAQ's page and clicking on various community resources, there really is a wealth of helpful information in the issues of HamsterSpeak. All you have to do is look:

http://superwalrusland.com/ohr/issue24/lighting/lighting.html

If you give it a chance, you'll find that learning the tricks of the engine through research is almost as fun as making games with it. Remember, kids, reading is FUNdamental.
_________________
Progress Report:

The Adventures of Powerstick Man: Extended Edition

Currently Updating: General sweep of the game world and dialogue boxes. Adding extended maps.

Tightfloss Maiden

Currently Updating: Chapter 2
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue Aug 17, 2010 5:10 pm    Post subject: Reply with quote

There have been quite a few games which have implemented a flashlight by painting black tiles over the map, even before map layers were added (Project `C'). But now you can use slices instead to black out the screen except for a circle of light around the hero, which is both much easier and looks better because it's not jerky as you move around. House Escape is the only game I know of to have used slices to do that so far, so I'll give a script (also put up at 'Scripts:Flashlight circle of light').

On the other hand, you can't do that "local lighting" effect shown in that article. You could limit the circles to walls, but that's much more work.

So if you want to use slices:
* paint a 320x200 overlay
* split it into 80x80 pieces (the size of large enemy graphics)
* save them each as 16 colour BMPs
* import them as large enemy graphics (if any are duplicates, you need just one copy of each)
* adapt this script:

(EDIT: I forgot about slice collections! If you're using a 'nightly build', you can see the wiki article instead of using this script)

Code:
global variable (1, flashlight circle)

plotscript, setup flashlight, begin
  #we don't care how large this container slice is
  flashlight circle := create container
  #change this to whatever your topmost map layer on those map(s) is
  set parent (flashlight circle, lookup slice (sl:map layer 2))

  variable (sl)
  #change these numbers
  sl := load large enemy sprite (10)
  set parent (sl, flashlight circle)
  put slice (sl, 0, 0)
  sl := load large enemy sprite (11)
  set parent (sl, flashlight circle)
  put slice (sl, 80, 0)
  #...
  sl := load large enemy sprite (19)
  set parent (sl, flashlight circle)
  put slice (sl, 240, 80)
  sl := load large enemy sprite (19)
  set parent (sl, flashlight circle)
  put slice (sl, 240, 160)
)


And you can get rid of the effect later with "free slice (flashlight circle)"
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group