Could someone tell me how I could enable and disable respawn points under specific conditions?
I have a map that’s multilayered and each layer is a simple round arena. Every 60 seconds the floor disappears, so you Fall down one layer every minute.
I basically need to make it so that only the respawn points on the current active layer are enabled.
Create a Scripting Pointer and put it in the center of the first level. Go to Object Properties and add a Boundary (choose the desired shape).
Back off with your camera so you can see all of the first level, and the increase the Boundary so it covers all the spawns on the floor.
Script Suggestions:
In your script, setup an “Area Monitor” (Variables Basic) for the Scripting Pointer that you just setup.
Create a trigger for “On Object Enters Area” (Events) that is tied to your Area Monitor.
Tie the trigger to Node “Set Spawn Point Enabled” (Objects).
Tie the Object pin from “On Object Enters Area” to the “Spawn Point” pin on “Set Spawn Point Enabled”.
Set the Enabled pin on “Set Spawn Point Enabled” to False.
Create a separate tree same as the above, except for “On Object Exited Area” and with the “Set Spawn Point Enabled” with Enabled set to True.
Create a separate tree for “On Game Start” (Events) trigger that is tied to a Delete Object node for the Scripting Pointer.
Once you have done the above, all you need to do is add a “Spawn Object” node for the Scripting Pointer in your script that is deleting the floor. You delete the floor, you spawn in the Pointer, it gathers all the objects in the area of the object, and it deactivates them as spawn points.
Addt’l Notes:
There are lots of ways to approach this issue. I have not actually tested the method above, so don’t get mad at me if it doesn’t work. Forge has been a trial & error learning exercise for all of us lol.
If the above doesn’t work, there are additional nodes that gather all objects within an area monitor and adds them to lists/indices. It could be that you have to add them to lists and then do a “for all objects” node that would apply the spawn “set spawn enabled” flag individual objects on the list. And if THAT doesn’t work, you’re probably stuck with the time-consuming and labor-intensive method of copying/pasting individual script for each spawn point on the map (not recommended).
Edit: tried it, didn’t work lol. Guess I need to keep trying to figure this out.
You’d think that disabling and enabling spawn locations would be real simple. This is unnecessarily complicated.
Edit2: I finally came up with a working script! One that relies on timers. I had been looking at this problem from several wrong angles.
The solution was simple but also complicated.
I can share it here if you want, but I’d rather do that with screenshots instead of text. So let me know if you want me to share it here.
I appreciate you trying to help, even though the final script was something completely different though lol.