I would like to know: can anyone try to make a script that uses Switch Palaces, and the respective color blocks turning solid all throughout the episode when you clear the Switch Palace level? This would make some pretty interesting features.
| ||
Set the Global varriable "SwichOn" , a layer called "Blocks" and set a script "Detect" in the "Level - Start" Event in every level .
Script "Detect" : If gval(SwichOn) = 1 Then Call Lset(Blocks,1,1) Else Call Lset(Blocks,2,1) End if The script means if the global varriable is 1 , the blocks will show . Else will not . You can only test and active it when you are playing the episode . Hope it can help you :P ![]() | ||
Every time I try to click "Add" in Global Variables mode, nothing happens, so I'm stuck. Also, how do I set a script for an event?
EDIT: I now know that you can set a script to trigger an event in the "Others" section.
Last edited by TryLouBliss on 18 Sep 2016, 2:01, edited 1 time in total.
| ||
I don't get variables in World Editor. It's not available in the "View" drop menu; it's only seen in Level Editor. Or am I missing something?
EDIT: I now know that you can set Global Variables in the World Settings. EDIT 2: Now I need to know how to make the script happen in the levels by clearing a certain level, which is the Switch Palace itself. How do I do this? | ||
Make a event that calls the Script Call gval(Name of the Global variable you created here) +1.This event heappen when you step on the switch.Don't forget to make a layer on the levels that has Blocks of that color and make this sprite on "AutoStart"
If gval(name of global variable) = 1 Then Call Lset(name of blocks layer,1,1) Else Call Lset(name of blocks layer,2,1) Not really up to it.
| ||
I would do gval(Switch) = 1 rather that gval(Switch) = gval(Switch) + 1 | ||
Switch palaces are destroyed after clear so i don't see why change thatNot really up to it.
| ||
'End if' is needed after using 'If ...then ... else' BTW, 'If variable then ...' is recommended rather 'If variable = 1 then ... ',like If gval(Switch) then ... ... | ||
Put the script in the level with the switch palace and when the npc (the switch) dies go to the events of the npc and add the script in ,,Death'' gval(switch) = 1 then in every level that has the switch block make it like this: Add a layer that will be the switch block that are activated and another layer for the switch blocks that aren't activated and then set the the block in one exact place but on different layers , then hide the activated switch blocks and make a event that will hide the switch blocks that aren't activated and will show the switch blocks that are activated. Then make a script: If gval(switch) = 1 then call TCreate("Event", 0) End if Then create a global variable on the world map with the name ,,switch'' with number 0. If you have problems with this just send me a message. | ||
|
Thanks very much. I finally got it. It can done that after push switch cann't enter in the switch palace?
Added after 14 minutes 24 seconds: Better. I want that when I exit the switch palace change the icon level in the world. How I can do it? | ||
You can make the level one layer and the other level that has the other icon another and make a script on the world map that will be : If gval(switch) = 1 then call TCreate("name of the event", 0) End if Then place the two layers(levels with the switch) on one place and hide the one that you want to appear after the switch in the level is pressed. Then make a event that will be in the script and make it when its activated to show the layer with the already activated switch and to hide the other layer with the switch that isn't activated. | ||
Who is online (over the past 5 minutes)Users browsing this forum: 1 guest | ||