HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

need help randomizing

10-23-2003, 08:25 PM#1
matzzzz
i need help with a trigger, used to randomize

this is a simple example where i can use it.

event: unit enters region1
condition:unit equal to hero = true
unit owned by ally to player 1(red) equal =true
action: create unit group (nr.1) for player neutral hostile at center of region2
/
create unit group (nr.2) for player neutral hostile at center of region2
/
create unit group (nr.3) for player neutral hostile at center of region2
/
create unit group (nr.4) for player neutral hostile at center of region2

what i need is randomizing so that one of the groups appear in random order
:bgrun:
10-23-2003, 08:48 PM#2
Cacodemon
I have same script but it realizes random unit creation with user-defined probability. If you need it, I can send that script to you...
10-23-2003, 08:52 PM#3
Supra God CrK
make a variable that can be a random number. action would look like this

action-
--set (your variable) = random number between 1-4

than just make an if, than, else action

if-
--(your variable) is equal to 1
than-
--create nr1(or whatever you said)
else-
--if-
----(your variable) is equal to 2
--than-
----create nr2(or whatever you said)
--else

and just keep doing this process for all your groups and all random numbers between 1-4. here is something i did for someone else. check here if you don't understand it.
http://www.wc3campaigns.com/forums/s...ht=foot+switch
10-23-2003, 09:09 PM#4
matzzzz
supragod--->thx for the reply i think i got it

theres just a minor thing
when i select the value for my integer variable, i set it to function>math random number>number between 1 and 4, but wenn im pressing ok theres just standing "0 default" in my calue box

i tried this several times, and i even made value first to 3, and then to random 1 to 4, but at that point my variable changed back to default
10-23-2003, 09:37 PM#5
chemo
matzzzz i told u how to do that... but u never listen....

nvm i tell u tomorrow @ school
10-23-2003, 10:22 PM#6
Cacodemon
May I suggest JASS script or you don't need JASS? Your task can be easily resolved using JASS scripts!