Triga help

Nightprowler

Member!
Joined
Oct 18, 2003
Messages
45
Reaction score
0
Website
Visit site
How do you make it so that a unit will respawn at a raidom location?
Example 8 diffent locations one ghost, how do u make it raidomly pick a spawn point?
 

Oni-Sei

Member!
Joined
Apr 4, 2004
Messages
56
Reaction score
0
Location
Hell
Website
www.Battlforums.com
do u mean like any random location or Anywhere on the map?
if anywhere on the map than put
:player 1: :Creat 1 ghost: at :anywhere:
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
Conditions:
-Current player Commands exactly 0 ‘unit’
-Switch ‘Random On’ is cleared
Actions:
-Set Switch ‘Random On’
-Randomize Switch ‘Random A’
-Randomize Switch ‘Random B’
-Randomize Switch ‘Random C’
-Preserve Trigger

Now what we need to do is determine how many possibilities there are. To do this you take the amount of randomized switches (X) and raise it to 2. X^2 so 3 switches gives you 8 results.

For simplicity I’ll abbreviate the different possibilities. 1 is set and 0 is clear.
001, 010, 100, 011, 110, 101, 111, 000

You will need to make a trigger for each one of these. One of the triggers would look like this

Conditions:
-Switch ‘Random On’ is set (set for all situations)
-Switch ‘Random A’ is clear
-Switch ‘Random B’ is clear
-Switch ‘Random C’ is set
Actions:
-Clear switch ‘Random On’
-Create Unit at ‘Random Location 1’
-Preserve Trigger

Then of course you would have 7 more of these.
 

Zeroth

Member!
Joined
Jan 28, 2004
Messages
728
Reaction score
0
Location
right here
star edit has everything but the ability to place any unit for any player.... so... uh... ya.... switches are a very hard and long thing to learn about.....
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
Randomizeing things properly is a complicated subject. Although if your good at math it shouldn't be hard to figure out on your own. I mean heck I did.
 
J

Jonnay

randomizing isnt that complicated

eg: make 3 switches, call them A, B and C
make 3 locations, call these X, Y and Z

the objective is, when A is set, then a ghost is created at X
when B is set, a ghost is created at y
and when z is set, a ghost at Z

First of all, you must let the computer pick where it should be. This is where you make your switches random.

Condition:
(pick always for now)
Action:
Randomize Switch A
Randomize Switch B
Randomize Switch C

with these switches now random, Only 1 will fire off and the others will not be. Now the computer will randomly pick 1 switch, lets say Switch A

now you have 1 of 3 triggers that may happen
Condition:
when Switch A is set
when Switch B is cleared
when Switch B is cleared
Action:
Create a Ghost a X

Condition:
when Switch B is set
when Switch A is cleared
when Switch C is cleared
Action:
Create a Ghost a Y

Condition:
when Switch C is set
when Switch A is cleared
when Switch B is cleared
Action:
Create a Ghost a Z

This is how you make a Create a ghost at a Random place Only Once.

You may preserve the randomization trigger and the create trigger if you want to create more ghosts, but you must clear the switches... and now it gets more complicated, but i could run it through more if you need more help.

Hope that was good enough explaination:rollie :rollie
 

New threads

Top