• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Spawning units...

Status
Not open for further replies.
Level 11
Joined
Dec 15, 2007
Messages
739
On my rpg I am making a spell that makes a rally point type of thing, and I want units to spawn in random spots between the rally point and the hero as it is casted.
sry dunno how to use triggers tags
I'd make it like
Event-Unit - A unit begins casting an ability
Condition - (Ability being cast) equal to Rally
Actions - Wait .6 seconds
[part I need help with]

would use like Create X footmen at {something} facing {random angle} degrees.
two things in "{}" is what I need help with. I see two placements; "Event Response -Target point of issued order" and "Unit - Position of Unit" but by themselves they are useless to me. If only I could have it "create X footmen {random point between "even response-target point of issued order" and "unit - position of triggering unit"} but unfortunately I don't see anything like that.:nw:
 
Level 22
Joined
Feb 26, 2008
Messages
892
Ok. Here's a trigger. The Footman I have there would be your rally flag. However you want to get its position.

  • Rally
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Divine Shield
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempPoint2 = (Position of Footman 0003 <gen>)
      • Set TempPoint3 = (TempPoint offset by (Random real number between 0.00 and (Distance between TempPoint and TempPoint2)) towards (Angle from TempPoint to TempPoint2) degrees)
      • Unit - Create 1 Footman for Player 1 (Red) at TempPoint3 facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint3)
Let me know if you need more help.

By the way, here are trigger tags:

[TRIGGER][/TRIGGER]

Just put them around your code that you paste in here.
 
Level 11
Joined
Dec 15, 2007
Messages
739
Thx alot man, should I also use the call remove thing after a variable is done in use?

If I would have noticed the math random interger between two points it would have been a big help XD
 
Status
Not open for further replies.
Top