Hi there,
I would like a script that allow you to set a variable automatically each time you enter a map, for example with notetags or script calls :
OK, let's say you have a map A. The player start on this map.
On the notetag box of this map, in the editor, you write something like <map var(1, 10)> With "1" being the ID of the variable to change and "10" the value the variable must have each time you enter the map.
Then you start the game :
-You start on map A and the variable 1 is automatically equal to 10, .
-Then you transfer to another map, map B and there you interact with an event and set the value of the variable 1 to 5. (Not using the script, just the basic editor)
-Finally, you go back to map A, and the variable 1 is automatically equal to 10 again, because the script change the variable each time you enter the map, But only when you enter the map, just like an autorun event.
Of course, you can do this without any script, with a very simple event. I know that. But the problem is that I would like to be able to do that for a lot of maps in my game, (I currently have almost one hundred of them...) and creating a new event for each map is a pain so such a script would make my life easier. Moreover, If I want to change the Id of the variable or the value, it's faster to edit a notetag than a real event.
( Having a script call that you can call with an event (In game and not in the editor, this time) would be great too, by the way... For example : <map var(2, 1, 10)> with "2" being the ID of the map where you want the variable to be automatically set each time you enter it, "1" being the ID of that variable and "10" the value.
This example would set the variable 1 to the value 10 each time you enter map 2. )
Hope this is clear enough, and thanks for reading
I would like a script that allow you to set a variable automatically each time you enter a map, for example with notetags or script calls :
OK, let's say you have a map A. The player start on this map.
On the notetag box of this map, in the editor, you write something like <map var(1, 10)> With "1" being the ID of the variable to change and "10" the value the variable must have each time you enter the map.
Then you start the game :
-You start on map A and the variable 1 is automatically equal to 10, .
-Then you transfer to another map, map B and there you interact with an event and set the value of the variable 1 to 5. (Not using the script, just the basic editor)
-Finally, you go back to map A, and the variable 1 is automatically equal to 10 again, because the script change the variable each time you enter the map, But only when you enter the map, just like an autorun event.
Of course, you can do this without any script, with a very simple event. I know that. But the problem is that I would like to be able to do that for a lot of maps in my game, (I currently have almost one hundred of them...) and creating a new event for each map is a pain so such a script would make my life easier. Moreover, If I want to change the Id of the variable or the value, it's faster to edit a notetag than a real event.
( Having a script call that you can call with an event (In game and not in the editor, this time) would be great too, by the way... For example : <map var(2, 1, 10)> with "2" being the ID of the map where you want the variable to be automatically set each time you enter it, "1" being the ID of that variable and "10" the value.
This example would set the variable 1 to the value 10 each time you enter map 2. )
Hope this is clear enough, and thanks for reading
