HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Random Hero help please

07-07-2004, 03:48 AM#1
Sawse
I am trying to create a trigger than will give a player a random hero when they buy the random hero from a shop (and put it in only one trigger, not a dif trigger for each player) So far i have been able to make the player get a unit, and go to the right spot, but the chosen unit is not random (the same order is used every time) and the unit does not change owner. Can anybody help me please?

This is the current trigger
Event
Unit - A unit enters (Entire map)
Conditions
(Unit-type of (Triggering unit) Equal to Random Hero
Actions
Unit - Remove (Triggering unit) from the game
IF (All Conditons are True) then do (Then Actions) else do (Else Actions)
If
Then
Unit - move (Random unit from (Units in Region002<Gen>(where the units are in the map) instantly to ((Owner of Triggering unit))start location)
Unit - Change ownership of (Picked unit) to (Triggering player) and Change color
07-07-2004, 04:21 AM#2
High Incarnate
have you tried multiplayer?
If it is just in single make sure fixed random seed is OFF
to check go: File > Prefences > Test Map, and their should be a tickbox that says "use Fixed Random Seed", make sure it is unticked and it should work
07-07-2004, 04:24 AM#3
Sawse
Yeah fixed random seed was on. Thanks for helping with that.
Do you know how i can make the unit come into the game as player owned and not neutral?
07-07-2004, 04:29 AM#4
High Incarnate
From what i see in your trigger it should work, whats the problem>
07-07-2004, 04:32 AM#5
Sawse
I have units set up in a section of the map thats blocked to view with a region under it. When you purchase the random hero it kills the unit you buy and gives you a random unit and sends it to your base (that works).
What isnt working is that the hero you recieve is still neutral and won't change owner.
07-07-2004, 04:37 AM#6
High Incarnate
Code:
Unit - Change ownership of (Triggered Unit) to (Triggering player) and Change color

In your thing you say picked unit put you have no "pick every unit" function
07-07-2004, 04:53 AM#7
Sawse
Do you know any way to do it so that the unit will change owner not every unit will get moved?
07-07-2004, 04:55 AM#8
High Incarnate
Lets see your trigger
07-07-2004, 04:59 AM#9
Sawse
Events
Unit - A unit enters (Entire Map)
Conditions
(Unit-type of (triggering unit) equal to Random Hero
Actions
Unit - Remove (Triggering unit) from the game
If (All conditions are true) then do (These actions)
Actions
Unit - Move (Random unit from (Units in <HeroLocationArea>) instantly to (Owner of Triggering unit start location)
Change ownership of picked unit to Owner of Triggering unit and Change Color
07-07-2004, 05:11 AM#10
High Incarnate
Edit: use this

Hero
Events
Unit - A unit Sells a unit
Conditions
(Unit-type of (Sold unit)) Equal to Random Hero
Actions
Unit - Remove (Sold unit) from the game
Set randomhero = (Random unit from (Units in heros <gen>))
Unit - Move randomhero instantly to (Position of (Buying unit))
Unit - Change ownership of randomhero to (Owner of (Buying unit)) and Change color