• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] RM Command.

Status
Not open for further replies.
Level 6
Joined
Aug 1, 2009
Messages
159
Hi, I have a problem on a trigger. It is the -rm command or Random Mirror.

I am creating a TD right now, and I just wanted to ask you guys if you know how to make a -rm command. Basically, it's an game mode.

Player 1 types -rm,

It randoms for Player 1, 2, and 3. While Player 4, 5, and 6 don't.
When Player 1, 2, and 3. Have their heroes.

This event happens :

Player 4 should receive the Hero of Player 1,
Player 5 should receive the Hero of Player 2,
Player 6 should receive the Hero of Player 3.

If you know how, please reply. I'll give you a +rep if you tried to help me :D Thank you..
 
Level 13
Joined
Sep 14, 2008
Messages
1,408
Well you create a unit-array with all your heros in it.
The you make a random int and create a unit of type UnitArray[random int] for player 1 / 2 / 3 and save them in a variable. Let' say Hero[player number of player]

Then you just go through the array and recreate the units for player 4 / 5 / 6
 
Level 6
Joined
Aug 1, 2009
Messages
159
Can you show me? I already have a tavern, now I'm doing game modes, I followed the Tavern tutorial from world-editor tutorials.
 
Level 6
Joined
Oct 10, 2009
Messages
1,426
like this, set a variable HeroType to a unit type array. then create a point variable labeled TempPoint
now do
  • Events
    • //your events
  • Conditions
    • //your conditions
  • Actions
    • Set HeroType[1] = (set the value to the hero of player 1)
    • Set HeroType[2] = (set the value to the hero of player 2)
    • Set HeroType[3] = (set the value to the hero of player 3)
    • Set TempPoint = (wherever YOU want it for purple)
    • Unit - create 1 HeroType[1] for player 4 (purple) at TempPoint facing Default building facing degrees
    • Custom script - call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (wherever YOU want it for yellow)
    • Unit - create 1 HeroType[2] for player 5 (yellow) at TempPoint facing Default building facing degrees
    • Custom script - call RemoveLocation(udg_TempPoint)
    • Set TempPoint = (wherever YOU want it for yellow)
    • Unit - create 1 HeroType[3] for player 6 (orange) at TempPoint facing Default building facing degrees
    • Custom script - call RemoveLocation(udg_TempPoint)
this will create the three types of heroes that players 1-3 have for players 4-6 in that order, and remove the leaks from the unit being created.
for more info on those custom scripts go to Things That Leak
 
Status
Not open for further replies.
Top