Staredit Network

Staredit Network -> UMS Assistance -> Random Trigger Help
Report, edit, etc...Posted by DISTURBED on 2004-11-06 at 02:15:37
Can anyone tell me, exactly how to make a trigger do something completly random?

(I.E. I want a trigger like, when you step on a location, it 'causes a trigger to randomly kill something on the map.)
I'm making a spell on my Golems map, and I want it to set as..

Player Brings 3 civillians to a location, trigger is set off, and kill what ever it wants on the map.
Report, edit, etc...Posted by Screwed on 2004-11-06 at 02:56:35
The Trigger 'Set Swtich' is what you are looking for.

There is a tutorial Bolt wrote, but I'll explain it myself.


Trigger
Description:
To Randomise
Players:
¤ Player X
Conditions:
¤ Player X brings 3 Terran Civillians to Location Y
Actions:
¤ Randomise 'Switch 1'


The possible outcomes of randomising the Switch is 'Clear' or 'Set'. But also take note that ALL switches start off ass 'Clear' so you need something to also be a condition to determine when spmeone has brought the 3 civillians to Location Y.

Then when 'Switch 1' is Clear...
Then you kill 'Amount' of 'Unit A' for 'Enemies'

Then when 'Switch 1' is Set...
Then you kill 'Amount' of 'Unit B' for 'Enemies'

etc.

When you want more possible random outcomes... then you randomise more switches...

For example,
-Randomise 'Switch 1'
-Randomise 'Switch 2'

There will be four possibilities,
1 = Clear, 2 = Clear
1 = Clear, 2 = Set
1 = Set, 2 = Clear
1 = Set, 2 = Set

Therefore you set those as the conditions for different 'Kill Unit' Triggers.

Note: The amount of outcomes is 2 to the power of the amount of Switches randomised. e.g. ... randomising 4 Switches would make 2^4 amount of outcomes.. which is 16.

However if you want 15 amoung of outcomes, then you choose the amount of switches that would have the smount of outcomes just above that, for this instance .. it is 4 switches because 2^4 is 16 and you want 15 outcomes.

For the last remaining Switch outcome.. you do something called a rerandomiser, which is just doing..
-Randomise Switch 1
-Randomise Switch 2
-Randomise Switch 3
-Randomise Switch 4
-Preserve Trigger

The preserve trigger is essential because there is always possibiliy that the rerandomised outcome will be the same as the rerandomiser trigger's condition.

If you found all that too difficult.. then just do

Condition
-Player X brings 3 Civillian to Location Y

Action
-Kill 1 Men at 'Location Battle Area' for 'Enemies'

... Then it'll just kill 1 random unit in the map for your enemy... biggrin.gif
However, I think the problem with that is that 'Starcraft' will kill the unit on the 'Most Left' First.. ohmy.gif

I didn't proofread this.. some things mite not make sense.. hope this helps happy.gif
Report, edit, etc...Posted by DISTURBED on 2004-11-06 at 02:58:07
QUOTE(Screwed @ Nov 6 2004, 03:56 AM)
The Trigger 'Set Swtich' is what you are looking for.

There is a tutorial Bolt wrote, but I'll explain it myself.








Trigger
Description:
To Randomise
Players:
¤ Player X
Conditions:
¤ Player X brings 3 Terran Civillians to Location Y
Actions:
¤ Randomise 'Switch 1'


The possible outcomes of randomising the Switch is 'Clear' or 'Set'. But also take note that ALL switches start off ass 'Clear' so you need something to also be a condition to determine when spmeone has brought the 3 civillians to Location Y.

Then when 'Switch 1' is Clear...
Then you kill 'Amount' of 'Unit A' for 'Enemies'

Then when 'Switch 1' is Set...
Then you kill 'Amount' of 'Unit B' for 'Enemies'

etc.

When you want more possible random outcomes... then you randomise more switches...

For example,
-Randomise 'Switch 1'
-Randomise 'Switch 2'

There will be four possibilities,
1 = Clear, 2 = Clear
1 = Clear, 2 = Set
1 = Set, 2 = Clear
1 = Set, 2 = Set

Therefore you set those as the conditions for different 'Kill Unit' Triggers.

Note: The amount of outcomes is 2 to the power of the amount of Switches randomised. e.g. ... randomising 4 Switches would make 2^4 amount of outcomes.. which is 16.

However if you want 15 amoung of outcomes, then you choose the amount of switches that would have the smount of outcomes just above that, for this instance .. it is 4 switches because 2^4 is 16 and you want 15 outcomes.

For the last remaining Switch outcome.. you do something called a rerandomiser, which is just doing..
-Randomise Switch 1
-Randomise Switch 2
-Randomise Switch 3
-Randomise Switch 4
-Preserve Trigger

The preserve trigger is essential because there is always possibiliy that the rerandomised outcome will be the same as the rerandomiser trigger's condition.

If you found all that too difficult.. then just do

Condition
-Player X brings 3 Civillian to Location Y

Action
-Kill 1 Men at 'Location Battle Area' for 'Enemies'

... Then it'll just kill 1 random unit in the map for your enemy... biggrin.gif
However, I think the problem with that is that 'Starcraft' will kill the unit on the 'Most Left' First..  ohmy.gif

I didn't proofread this.. some things mite not make sense.. hope this helps happy.gif
[right][snapback]95230[/snapback][/right]

Holy censored.gif !! LoL, You wouldn't mind setting me up this trigger? LoL. Seems like a complicated scenario here... plus I'm bad with switches..
Report, edit, etc...Posted by Screwed on 2004-11-06 at 04:17:09
Made the triggers privately for him, Issue Solved. biggrin.gif
Report, edit, etc...Posted by DT_Battlekruser on 2004-11-06 at 12:57:42
QUOTE(Mini Moose 2707 @ Aug 23 2004, 08:13 AM)
7. How do I create random events?
See Bolt_Head's Tutorial: http://www.staredit.net/index.php?showtopic=2851
[right][snapback]57326[/snapback][/right]



God.... This is from the FAQ. Read it first.
Report, edit, etc...Posted by (U)Bolt_Head on 2004-11-07 at 22:15:43
DT_BC: That Faq is a waist of space. Why don't you refer people to the tutorial database at least it answers peoples questions.

Screwed: So whats wrong with my tutorial? lol

QUOTE(Screwed @ Nov 6 2004, 04:17 AM)
Made the triggers privately for him, Issue Solved. biggrin.gif
[right][snapback]95235[/snapback][/right]


I try to help people not maps. I would much rather spend a hour teaching someone how to make there triggers than spend the 10 minutes it takes to do it for them. (i have done so many times)
Next Page (1)