Trigger Help...

FuzzzyLing

Member!
Joined
Aug 31, 2003
Messages
106
Reaction score
0
Location
Stalker... Stop asking me...
Website
Visit site
Ok..

i'm trying to get a trigger so i can get random units at a location

such as - player # brings unit to location : and i dont know what to fill in for the action to get random units to appear in a location.
I think i saw something done with a dropship patroling or something in the yugioh duels game, but i dont know how to do the trigger for that.
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
How many differant units are your randomizing between? Like when you go to the location you get Unit A or Unit B or one of Units (A B C D E F G H).

I need to first know this to help you.
 

FuzzzyLing

Member!
Joined
Aug 31, 2003
Messages
106
Reaction score
0
Location
Stalker... Stop asking me...
Website
Visit site
ok i'm thinking 13 units
 

Bolt Head

Member!
Joined
May 20, 2003
Messages
1,194
Reaction score
0
Website
www.shadowfortress.net
Ok check out this thread. Also about random http://www.battleforums.com/showthread.php?s=&threadid=68799

Anyways to randomize between 13 units you have to do something special. Because it isn't a power of 2.

If you randomize 3 switches you have 8 possibities but if you randomize 4 you have 16. So you will need to randomize 4 switches if you want more than 8 units.

The possibities for 4 switches are

0000, 0001, 0010, 0100, 1000, 0011, 0110, 1100,
1001, 1010, 0101, 0111, 1110, 1101, 1011, 1111,

1 represents a set switch and 0 represents a cleared one. You will have to make a trigger for each one of these combinations.

Your first trigger is thi

Conditions:
-Player X, Brings at least 1, unit, to location
-Switch 'randomize on' is clear
Actions:
-Set switch 'randomize on'
-Randomize 'random A'
-Randomize 'random B'
-Randomize 'random C'
-Randomize 'random D'
-Preserve Trigger

Now first were going to do the 3 extra combinations. It is best to have them before the ones with actions inorder to speed things up.

Conditions:
-Switch 'Randomize on' is set
-Switch 'random a' is clear
-Switch 'random b' is clear
-Switch 'random c' is clear
-Switch 'random d' is clear
Actions:
-Comment ( Re-Randomize 0000)
-Randomize 'random A'
-Randomize 'random B'
-Randomize 'random C'
-Randomize 'random D'
-Preserve Trigger (this needs to be preserved even if you don't plan to randomize more than once)

Then you would put two more of these using differant combinations. Lastly you would have your 13 other triggers that would look like this.

Conditions:
-Switch 'Randomize on' is set
-Switch 'random a' is clear
-Switch 'random b' is set
-Switch 'random c' is clear
-Switch 'random d' is clear
Actions:
-create 'random unit 1' at location for player
-clear 'randomize on'
-Preserve Trigger

Note: Extra Info, If your one number over a perfect sqaure it can be slow finding the random. For an example of you need 9 random units then that makes 7 possibities that do not create a unit (9+7=16). Because the chance of picking one that doesn't create a unit is extra high. Therefore if you do this will have to wait for the "re-randomizer" to fire again. (part of the problem is solved by putting the re-randomizers before the second half).
 

FuzzzyLing

Member!
Joined
Aug 31, 2003
Messages
106
Reaction score
0
Location
Stalker... Stop asking me...
Website
Visit site
still sorta confused i'll try working it out
 

Tuxedo Templar

Member!
Joined
Aug 15, 2003
Messages
237
Reaction score
0
Location
Here!
Website
Visit site
In more abstract terms, basically what you are doing is checking for the remaining 3 possible combinations of switch states out of the total of 16 (so it evens out to 13) and if found, having them re-randomize the switches until they are not one of those unwanted 3 combinations. You would want to put the re-randomize triggers before the ones that actually do the unit placing so it doesn't have to wait a full trigger activation loop (about 1 second without hyper triggers) to recheck the randomized combo with the preserved triggers. Preferably duplicates of those triggers, just in case it re-randomizes another (or the same) combo within the 3 you don't want.
 

Hydralisk591

Member!
Joined
Jun 15, 2004
Messages
160
Reaction score
0
Location
In my bedroom
Website
Visit site
Talking about trigger help, how do you make healing triggers to work more the once? And how do you make it so that each time you kill a unit, you get resources?
 

Kao

Drives an Evo IX ;)
Joined
Dec 9, 2002
Messages
5,109
Reaction score
0
Location
England
Ever play a Golem Map? There you go. (U) Is explaining the Hero system.
 

New threads

Top