"Lightpoint"in Darkness-Effect???

Started by Digital Mosaic Games, Mon 15/02/2010 17:43:33

Previous topic - Next topic

Digital Mosaic Games

Hello AGSers,

Maybe somebody remember this "Lightpoint in Darkness-Effect" in
Indiana Jones(3) and the last Crusade where Indy is in a kind of labyrinth which is in a
top-view and everywhere it is black but Indy is in a kind of "light-circle" so that the player can only see what in Indy´s near is.

Here´s a Screenshot of what I mean:
http://bilder.tentakelvilla.de/indy3/screens/indy3-030.gif

Well, I wanted to use this in my game too but couldn´t figure out how to do it. :-[
Can somebody tell me how to create such an effect in my game please or does somebody knows a template or module(I haven´t found any)?

GarageGothic

The flashlight module should do the trick, I think. Just make it follow the character instead of the cursor.

Digital Mosaic Games

Thank you GarageGothic!
That´s excactly what I needed. :D

I´ve imported the script/module and imported the circle-sprite with "leave as it is" but now I don´t know how to go on. :-\
I want that the flashlight follows my character but I don´t know how to begin.
I´m good at all the standart-scripting-stuff and maybe a little bit more but I don´t understand everything in the script.
I also read the textfile for the module but that don´t gives me the answer where what should have his place. Should there be a Flashlight-GUI? I don´t know.

Can somebody help me please ???

Khris

All you need to do is have the GUI/Overlay/? follow the player instead of the mouse.
Open the module's script, go to the rep_ex and change the lines.

GarageGothic

#4
You shouldn't need to change the module itself. There's a function in the module called Flashlight.SetFollowCharacter.

Code: ags
Flashlight.SetFollowCharacter(player, true);


But yes, if you want the nice transparency effect you do need to create a GUI to be used by the module and let the module know it exists by using the DEFINE:

Code: ags
#define FLASHLIGHT_GUI gFlashlight


(change gFlashlight to whatever the name of your flashlight GUI is)

Digital Mosaic Games

#5
Thank you for your help but I just don´t have the standart-flashlight wich follows the mouse. I haven´t ever managed that this effect worked in any of my rooms.
How should I just begin? How do I run this Flashlight-Effect? How can I let AGS know that I want the effect at beginning of a room? Which arrangements have I to do.

Digital Mosaic Games

Has someone used this module in his game? It would be helpful if someone could sent me a "demo" of the using of the Flashlight-module or just give me instructions how to bring this effect to run. :'(

GarageGothic

#7
I'd recommend you post your questions in the module's own thread where the module author is more likely to see them (since monkey hasn't responded, I assume he doesn't follow this thread).

Edit: You have read the whole module thread, right? I think monkey wrote a pretty good introduction to the module here.

Khris

There also the documentation which is linked to in the very first post.

monkey0506

I hadn't noticed this thread..thanks for linking the module as it does seem a good fit to the needs required.

In short the code you need is something like this:

Code: ags
// player enters room before fade-in
Flashlight.SetGUIMode(gFlashlight, DynamicSprite.CreateFromExistingSprite(42));
Flashlight.Radius = 5.0;
Flashlight.Enabled = true;


Where gFlashlight is the script o-name of your GUI, 42 is the sprite slot number for the "beam" sprite, and 5.0 is the initial beam radius (in pixels).

If you want the flashlight effect in more than one room I suggest putting the first line in the GlobalScript.asc's game_start function instead. The module thread and documentation has further information (note that the wiki was last updated with BETA 3, and things have been changed for the FINAL, so you may want to check the included Flashlight_Manual.txt as well).

SMF spam blocked by CleanTalk