Ok, so I'm looking for a way to make it so the Guards in my screenshot will shine a light to outline their line of sight, thus making it similar to work out if you are safe from being seen for the player.
The only problem is that I'm not entirely sure how to make it work. Would events be enough? but how to I get the events to move so that if the guard is facing UP, the light will point Up as well, and when the guard looks DOWN, the light similary moves with him?
Any thoughts on how I can implment this?
And how would I get the image of the torchbeam to work in the editor as a character? I've tried !$ but it only highlights part of what I need which is annoying.
Making a changing light source
● ARCHIVED · READ-ONLY
-
-
You can make the torchbeam as a character, using $! as you mentioned. Make sure the total image size is correct. If your horiztonal beam is 4x3 tiles, then the total image needs to be 12x12, regardless of whether you fill in the rest of the image. Since horiztonal and vertical beams probably won't be the same dimensions, you may need a !$beam_vertical.png and a !$beam_horizontal.png ... also worth nothing, I find when using this sort of technique, making the horizontal tile length an odd number helps me with placement when it comes to actually putting character events on the map. (5x3 versus 4x3 tiles, for instance.)
As far as making it all work, have you considered a helper event? Something that is designed to Set Move Route one of your NPCs, and also turning the transparency of your torchbeams on and off in the four principal directions.
As far as actually making everything functional, you could do it with events, but with the number of effected tiles you've got in that image, it would probably get laggy. Your best bet might be to find a script that would allow you to create regions that act as your danger zones. That, I'm afraid, is a little over my head though. :) -
I am using regions as my danger zones to save on events, so if the player steps on a region the guard is looking at they get caught, I just wanted a slightly more visual cue for the players, so a torchbeam seemed the best way to illustrate it...
Maybe I should just make a whole big picture, fix it to the map and have one even change the picture depending on when the guards move? I'd need to find me a fix picture script.... I'll see how it works.
Thanks for letting me know about how the !$ works. I had despaired!
If anyone else knows an easier way, let me know! -
you know you CAN have one of the events be a Danger zone and a graphic at the same time no problem, right?
in the same time that the DangerZone page is activated that page would have the Visual graphic on it. -
Not to beat a dead horse :) But I really do think the character method would be easier to implement than using locked pictures. You'd only need two PNG files - one with the horizontal beam (left & right in one file) and one vertical beam (up and down in one file). You've got 23 total beam instances in the above image (nice map, by the way!) so that's 23 events + a helper event for each NPC (9 more) for a total of 32 events. Still not breaking the bank, really.
For Instance, "NPC Helper Event 1" would look something like this:
Set Move Route (NPC 1) --> Turn Up
Set Move Route --> Set Transparency (That NPC's Up facing torch event) --> OFF
Set Move Route --> Set Transparency (The other three torch direction events) -- > ON
(insert your region danger scripts/events here to activate the dangerous regions)
Wait --> Period of time before the NPC moves again, say 2 seconds, or 5 seconds, or whatever.
(Repeat this process, changing the NPC direction and switching the beam transparencies around.)
Loop the whole thing in a parallel process. The Wait commands would probably break things up enough to avoid considerable lag.
Hope any or all of that makes sense.
EDIT: I took your image and put bounding boxes around the light beam instances as an example. The red box is a 5x3 (horizontal) or 3x5 (vertical) instance. The blue tile-sized boxes are where the actual events would go - always along the bottom edge, in the middle. Since they go in the middle, this is why I like my character length to be an odd-number of tiles, so you've got an equal amount of space on both sides of where you place the event. Proper placement of not-standard sized characters can be tricky if you've never done it before! Also make sure you turn off walking & stepping animations, and turn on direction fix. Good luck!

-
Thank you very much. I'm working on it now, but your little blue box placments make it very handy to follow!
Hopefully this will turn out how I want it to in the end.
