Staredit Network

Staredit Network -> UMS Assistance -> How do you Random Respawn Loaction
Report, edit, etc...Posted by Staredit.Net Essence on 2004-11-08 at 19:17:25
I've seen alot of maps do this.

How can you respawn and you randomly respawn in a diffrerent loaction i'm having trouble doing it can someone tell me how to do it.....
Report, edit, etc...Posted by Urmom(U) on 2004-11-08 at 19:23:44
i think what you do is randomize some switches for each player i think then do all the combinations then when he respawns at a random spot from all the combinations randomize the triggers again for that player.
Report, edit, etc...Posted by BeeR_KeG on 2004-11-08 at 20:19:52
Use Randomization switches which can be found here:
http://www.staredit.net/index.php?act=tuto...e=Randomization
Report, edit, etc...Posted by eXile5 on 2004-11-08 at 20:23:52
From what I can think of right now :

Current player suffers atleast 1 death of unit
~
Randomize switch 1
Randomize switch 2
etc..
Modify deaths set to 0
preserve

Current player commands exactly 0 unit
switch 1 is set
~
Create 1 unit at location 1

Current player commands exactly 0 unit
switch 2 is set
~
Create 1 unit at location 2
Report, edit, etc...Posted by Thels on 2004-11-09 at 12:25:54
How about not making it for each player?

First, set the initial location random at the start of the game:

Trigger
Players:
¤ All players
Conditions:
¤ Always
Actions:
¤ Randomize Switch RandLoc1
¤ Randomize Switch RandLoc2
¤ Randomize Switch RandLoc3
¤ Randomize Switch RandLoc4


Second, if it points to a location that's been taken, have it randomly set again for each location:

Trigger
Players:
¤ All players
Conditions:
¤ Current player brings at least 1 men to Location1
¤ Switch RandLoc1 is cleared
¤ Switch RandLoc2 is cleared
¤ Switch RandLoc3 is cleared
¤ Switch RandLoc4 is cleared
Actions:
¤ Randomize Switch RandLoc1
¤ Randomize Switch RandLoc2
¤ Randomize Switch RandLoc3
¤ Randomize Switch RandLoc4
¤ Preserve Trigger


Trigger
Players:
¤ All players
Conditions:
¤ Current player brings at least 1 men to Location2
¤ Switch RandLoc1 is set
¤ Switch RandLoc2 is cleared
¤ Switch RandLoc3 is cleared
¤ Switch RandLoc4 is cleared
Actions:
¤ Randomize Switch RandLoc1
¤ Randomize Switch RandLoc2
¤ Randomize Switch RandLoc3
¤ Randomize Switch RandLoc4
¤ Preserve Trigger


And so forth for the other locations, using a different combination of switches for each location.

Finally, have a trigger to create the actual unit:

Trigger
Players:
¤ All players
Conditions:
¤ All Players brings at most 0 men to Location1
¤ Switch RandLoc1 is cleared
¤ Switch RandLoc2 is cleared
¤ Switch RandLoc3 is cleared
¤ Switch RandLoc4 is cleared
¤ Elapsed Time is at least 2 seconds
¤ All conditions for spawning a new unit
Actions:
¤ Create 1 unit for Current Player at Location1
¤ Preserve Trigger


Trigger
Players:
¤ All players
Conditions:
¤ All Players brings at most 0 men to Location2
¤ Switch RandLoc1 is set
¤ Switch RandLoc2 is cleared
¤ Switch RandLoc3 is cleared
¤ Switch RandLoc4 is cleared
¤ Elapsed Time is at least 2 seconds
¤ All conditions for spawning a new unit
Actions:
¤ Create 1 unit for Current Player at Location2
¤ Preserve Trigger


and again for all possible combinations. As soon as a unit is created, there will be a unit at the location, so the next location will be random again.

Now there's a change you're not using exactly 2^n locations. If that is the case, just pick a new combination whenever a certain combination of switched ends up that's not attached to a location:

Trigger
Players:
¤ All players
Conditions:
¤ Switch RandLoc1 is set
¤ Switch RandLoc2 is set
¤ Switch RandLoc3 is set
¤ Switch RandLoc4 is cleared
Actions:
¤ Randomize Switch RandLoc1
¤ Randomize Switch RandLoc2
¤ Randomize Switch RandLoc3
¤ Randomize Switch RandLoc4
¤ Preserve Trigger
Report, edit, etc...Posted by Tuxedo Templar on 2004-11-09 at 12:50:32
Make respawn locations in multiples of 2 (2, 4, 8, 16, etc.). Then, for the number of multiples you have (2=1, 4=2, 8=3, 16=4, etc.), make an equal number of switches to be randomized and locations to randomly spawn at.

Trigger
Players:
¤ All Players
Conditions:
¤ Always[/i]
Actions:
¤ Randomize 'Switch 1'.
¤ Randomize 'Switch 2'.
¤ Ect...


Then the respawn trigs:

Trigger
Players:
¤ Force 1 (human force)
Conditions:
¤ Current player commands exactly 0 men. (or whatever your "player has died" condition is)
¤ 'Switch 1' is cleared.
¤ 'Switch 2' is cleared.
Actions:
¤ Randomize 'Switch 1'.
¤ Randomize 'Switch 2'.
¤ Create unit at 'respawn 01' for Current Player.
¤ Preserve trigger.


Trigger
Players:
¤ Force 1 (human force)
Conditions:
¤ Current player commands exactly 0 men. (or whatever your "player has died" condition is)
¤ 'Switch 1' is set.
¤ 'Switch 2' is cleared.
Actions:
¤ Randomize 'Switch 1'.
¤ Randomize 'Switch 2'.
¤ Create unit at location 'respawn 02' for Current Player.
¤ Preserve trigger.


Simply create duplicate triggers for ever possible state the switches are in (in my example I used only two of the 4 possible states of just 2 switches... you could use more if you need/want).
Report, edit, etc...Posted by iamandragon on 2004-11-11 at 08:55:34
Use-switches-randomnize-THEM!!!!
Report, edit, etc...Posted by SaLaCiouS(U) on 2004-11-11 at 12:00:46
All of this stuff is in the Tutorials Database. Under triggers, "Randomization". It's at the top of the screen in the menu links.
Next Page (1)