Okay so I edited this with tutorials to help out those in need that are as confused as I once was!
TUTORIALS BELOWHERE ARE STEPS TO GET IT WORKING PARTIALLY
To light yourself a torch/flashlight:1. Go ahead and locate your picture that you want to use for your flashlight. If using the demo as a ..well ... demo then go ahead and make a note of the location in your folder called Graphics/Pictures/lumieres (lumieres means "lights" btw since I've been reading French for the past f-cking hour). If using the demo, you'll see a whole bunch of names.
2. Go ahead and choose one. I chose "lampe2" for my little flashlight/torch thing. It will work just fine for you too. It kinda looks like a torch or something.
3. Make a parallel process triggered event on a new map and paste in the following script:
ecran_nuit(240)
lum("lampe2",0,255)So what the hell does that mean? ecran_nuit translates to "wallpaper_night", whatever the hell that means. Actually what they mean by that is they are taking an image and overlaying it to a closer z index on the screen. The picture is overlapping what is on the map.
the (240) is the opacity. You can change this if you'd like the 'darkness' aka. wallpaper_night to be more or less opaque.
so what about the lum("lampe2",0,255) part? Well it's pretty simple.
the "lum" stands for light. So I just think of the word 'light' or like lumination.
Inside the parenthesis it goes as follows:
lum("name_of_image",event_id,opacity)
the image I used was lampe2. The event_id of 0 is the main character sprite. Opacity is at max(255)
So that's how you get yourself a nice little torch. But what about all the other cool shit with the lamps lighting at the same time?
Here's where it really confused me. So, apparently, if you try to use more than one parallel process to illuminate lamps, the game will shit all over itself for no apparent reason. No matter how much French you learn in one day, it will still be more confusing and less telling than a creepy mime on the corner of the wine bistro.
HOW WE SET UP LIGHTS AND TORCH AT THE SAME TIME:(This is good for a flickering torch-like effect)Here's the meat and potatoes:
1. If you followed my last rant, then you should already have the torch on your player. You will want to use A SINGLE parallel process for all of this, so I will go ahead and post in the script for both the player torch AND the lamp torches. Add this to a SINGLE event on a blank map. I suggest using a map texture set that has something that resembles a light or torch for visual satisfaction purposes only. In this map, make an event for your parallel process, and make three more for your lamps. I did mine like so:
[spoiler]
![](http://s17.postimg.org/jzsmfezu3/examplepic.jpg)
here's the script:
ecran_nuit(240)
lum("lampe2",0,255)
lum("lampe2",1,255-rand(50))
lum("lampe2",2,255-rand(50))
lum("lampe2",3,255-rand(50))You will notice a few things. Firstly, you will see the code for the original stuff. The first two lines make it dark and give your player a lamp(player = event #0) But if you look above, you'll know this. The next three lines are similar. The numbers after the "lampe2" part are the event id numbers. The other thing you will notice is that in the opacity section, it's set to 255-rand(50). This will create a flickering effect, essentially subtracting a random value of 0-49 of opacity.
Anyway, when you're all said and done, run it and it'll look like this:
[/spoiler]
HOW TO ILLUMINATE A TILE TYPE AND REPEAT WITHOUT ADDITIONAL SCRIPTING(like in example 2 in demo)
Please use the provided demo here to make this easy for the both of us. This one really confused me for a bit but I figured it out and man I'm so freaking excited!
![:D :D](https://forum.chaos-project.com/Smileys/default/laugh.gif)
Step 1. Make a plain old map like this one. Use the Castle town map for this(it's called Ville Forte Ext in the french demo)
[spoiler]
![](http://s9.postimg.org/vearetq4b/plainmap.jpg)
Step 2. Add in a couple of lamps(take note of the coordinates of one of the tops of your lamps is located)VERY IMPORTANT
The tip of my lamp in in the picture is at (003,006) x=3 and y=6 *remember this part
Step 3. Set up a parallel process event like so:
Here is the code to put in there:
ecran_nuit(220)
lum_tile("lampadaire",3,6,1,255,-60,-16)Firstly, there is the ecran_nuit(220). This is just to set up the darkness at 220 opacity.
Secondly there is the lum_tile() part and I will break down each section.
The overview is: lum_tile("name_of_light_picture",x_coordinate_of_tile, y_coordinate_of_tile, not_sure, opacity, image_x, image_y)
Phew, so let's look at these:
- lum_tile() is the function that will help us do this awesome trick.
- the "name_of_light_picture" is the image you're using. Located in Graphics/Pictures/lumieres.
- I don't know what this one does, but don't change it from 1. It's called the "i_tile" but I don't know what that means.
- the x_coordinate_of_tile part is the x location of a tile on your map. For instance, if it has a picture of a torch or the top of a
light post, this is what you want
- y_coordinate_of_tile part is the same as the x above, but applies to the y. Notice my x,y coordinates were 3,6 just like in the code. Make your coordinates work properly to suit your map
- opacity is pretty basic and is a value from 0-255 as you probably know already.
- image_x is just the x coordinate of the image you're using. move as needed
- image_y is same as image_x above but y coordinate
Phew.
Step 4. Now that you've figured out where one lamp tip or torch flame should be at, use a proper picture. I used the "lampadaire" image for the lamp post because that's what it's made for.
If all goes well, you'll be able to post lamps over and over with no additional scripting and they will automatically be lit up. This effect will be more like a solid light. For a flickering effect, use this in opacity
255 - rand(50) You don't have to use 50 in the rand, use whatever you want. you could even wait a few frames in the event to change the effect as well.
Hopefully you ended up with this:
This took a while so you are welcome!
![Cool 8)](https://forum.chaos-project.com/Smileys/default/B).gif)
Enjoy.
[/spoiler]