Random?

Cell

Member!
Joined
Feb 1, 2004
Messages
551
Reaction score
0
Location
California
Website
Visit site
I want to know how to do this.

-Brings unit to region
-units dies
-creates a random unit at a region

And the random unit that it create is the custom unit you make.
Ok heres another exmaple...

I bring a peasant that i made ( his on custom ) to a circle of power. And than he dies or w/e... and he makes a random characther from my custom list... like it can spawn a blademaster.. or a beastmaster... dreadlord... ect.. but it has to be custom.. help? thanx... if you can sorry if i confuse you.. i pretty much confuse myself also.. Am hoping you can write it out so i can search easily... thanx
 

SlayMaximus

Member!
Joined
Dec 29, 2003
Messages
64
Reaction score
0
Location
Virginia
Website
www.riplo.com
I've never done exactly this, but may be able to point you in the right direction. I think you can create a unit array variable containing each of your custom units. Use a trigger event on the peasant (or w/e) entering the region (circle of power) then include actions to remove triggering unit, generate random number from 1-x (x= number of custom units you have), and create unit of unit type from refernce to the array variable using the random number as the index. If you need help with the random number, look at a map that has "tips" displayed - they genrate random numbers for the tips and you can copy that code. Most leaderboards also use an array to hold the number of kills and you can look at that for help on arrays.
 

Cell

Member!
Joined
Feb 1, 2004
Messages
551
Reaction score
0
Location
California
Website
Visit site
Can you explain it again.. i dont even know what unit array is...
 

Jimstick

Member!
Joined
Oct 27, 2003
Messages
38
Reaction score
0
Website
Visit site
well... another way you could do it is to creat a variable called rndunit and set up a trigger up like this.
-
----Event
--------unit enter region *region*
-
----Condition
--------triggering unit is equal to peasant equal to True
-
----Actions
--------remove triggering unit from the game
--------set rndunit = random integer between 1 and *number of --------------random units in your unit list*
--------if rndunit = 1 then creat *1st random unit from your list*
-------------else do nothing
--------if rndunit = 2 then creat *2nd random unit from your list*
-------------else do nothing
-
etc. etc. etc.
-
Allthe stuff in stars are stuff you have to determin like what the region name is and how ever many units you want to make avaliable.
-
Well i hope i helped you and i didnt confuse you, and good luck with the trigger. (I tried it and it worked but the *f rndunit= * part get tedious if you dont copy and paste)
 

Jimstick

Member!
Joined
Oct 27, 2003
Messages
38
Reaction score
0
Website
Visit site
well... another way you could do it is to create a variable called "rndunit" or something to that effect and set up a trigger up like this.
-
----Event
--------unit enter region *region*
-
----Condition
-------- boolean cond. - (triggering unit is equal to Peasant) equal to True
-
----Actions
--------units - remove triggering unit from the game
-------- set variable - set rndunit = random integer between 1 and *number of --------------random units in your unit list*
--------if rndunit = 1 then create *1st random unit from your list*
-------------else do nothing
--------if rndunit = 2 then create *2nd random unit from your list*
-------------else do nothing
-
etc. etc. etc.
-
All the stuff in stars are stuff you have to determine for yourself like what the region name is and how ever many units you want to make avaliable.
-
Well i hope i helped you and i didnt confuse you, and good luck with the trigger. (I tried it and it worked but the (if rndunit= 1,2 etc) part gets tedious if you dont copy and paste)
 

Cell

Member!
Joined
Feb 1, 2004
Messages
551
Reaction score
0
Location
California
Website
Visit site
lol triple spam.. lol jimstick... but thanx dude... this is very helpful... i been waiting for 3 days 4 this answer thanx i try it out... ty
 

New threads

Top