• 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] Any1 Knows a trigger for this?

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2008
Messages
147
Hi,
I am building a map and that map starts by chosing 2 hero's.
then a want to drop them at a random point at the map.
but everytime they are droped in the water. (see screenshot)
already tryed to make it everywhere deep water but it is at the point where they are droped.:cry:
already tryed a lot things but nothing works :bored:
any1 know something i can do?

Troynl
 

Attachments

  • Naamloos.jpg
    Naamloos.jpg
    166.5 KB · Views: 94
Level 4
Joined
Nov 11, 2004
Messages
50
Hello. what you could you do is you can make the random points on your map by using regions and variables. Like so

When making the variable (make sure the variable type is region) make sure to give it an array of how many random spots you want. like so

Create RandomSpot making it its variable type region and giving it the array size of 2

HelpPerson.jpg


Set RandomSpot[1] = Top Left Spot on map <--- (Typical Names of Regions)
Set RandomSpot[2] = Mid Left Spot on map <-- (Typical Names of Regions)


Next im not sure how you made your heroes selectable so im assuming a building to purchase them from and a region to put them in random places when they get purchased? next you make another trigger like so

Event

Unit Enters Hero Spawn (This is the region from where the heroes are purchased part so i dont know what you called it)

Condition

None

Action

Unit - Move Unit (Instantly) <---- (The one to pick if you don't already know)

Move (Entering Unit) Instantly to RandomSpots[Random Number between 1 and 2] <----- The reason why its 1 and 2 because 2 is how big the variable is

Like this the heroes will be moved to different spots on the map that you created with regions so they'll never end up in water again.


Keep in mind that making the array bigger will have more of a selection of randomness for heroes to spawn at.

If you have any questions please let me know
 
Last edited:
Level 5
Joined
Sep 27, 2008
Messages
147
Hello. what you could you do is you can make the random points on your map by using regions and variables. Like so

When making the variable (make sure the variable type is region) make sure to give it an array of how many random spots you want. like so

Create RandomSpot making it its variable type region and giving it the array size of 2

HelpPerson.jpg


Set RandomSpot[1] = Top Left Spot on map <--- (Typical Names of Regions)
Set RandomSpot[2] = Mid Left Spot on map <-- (Typical Names of Regions)


Next im not sure how you made your heroes selectable so im assuming a building to purchase them from and a region to put them in random places when they get purchased? next you make another trigger like so

Event

Unit Enters Hero Spawn (This is the region from where the heroes are purchased part so i dont know what you called it)

Condition

None

Action

Unit - Move Unit (Instantly) <---- (The one to pick if you don't already know)

Move (Entering Unit) Instantly to RandomSpots[Random Number between 1 and 2] <----- The reason why its 1 and 2 because 2 is how big the variable is

Like this the heroes will be moved to different spots on the map that you created with regions so they'll never end up in water again.


Keep in mind that making the array bigger will have more of a selection of randomness for heroes to spawn at.

If you have any questions please let me know

hmm with your trigger i don't know if i do sometihng wrong or if your trigger doesn't work. because if i do: Action - Unit - Move Unit (instandly) i can chose variables or something
but here are screenshots of how my hero system works:

and here is a start of the trigger i use to chose 1e and second unit:
  • Take Farseer
    • Events
      • Unit - A unit enters Take Farseer <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Wisp
        • Then - Actions
          • Unit - Create 1 Far Seer for (Owner of (Triggering unit)) at (Center of Mixed Second Unit <gen>) facing Default building facing (270.0) degrees
          • Unit - Make (Last created unit) Invulnerable
          • Hero - Set (Last created unit) Hero-level to 2, Hide level-up graphics
          • Unit - Kill (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Far Seer
            • Then - Actions
            • Else - Actions
              • Unit - Move (Triggering unit) instantly to (Random point in (Playable map area))
              • Unit - Make (Triggering unit) Vulnerable
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.10 seconds
              • Unit - Create 1 Far Seer for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
              • Unit - Create 5 Grunt for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
 

Attachments

  • 2.jpg
    2.jpg
    188.5 KB · Views: 83
  • Naamloos1.jpg
    Naamloos1.jpg
    167 KB · Views: 69
Last edited:
Level 4
Joined
Nov 11, 2004
Messages
50
Hey sorry I accidentally set the variables wrong and everything and I will show you what to do.

Like I said before create a variable, and make it a "Point" type variable.

Next click the check box that says "Array" and make the size however you want and make sure it corresponds with the regions you made for the random spawns.

Keep in mind that you must place regions on your map for the random part to work.


Now im going to show you what your trigger that you gave me should look like

Things I've changed are in white


Take Farseer
Events
Unit - A unit enters Take Farseer <gen>
Conditions
Actions
Set RandomsSpots[1] = Region0001
Set RandomsSpots[2] = Region0002
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Wisp
Then - Actions
Unit - Create 1 Far Seer for (Owner of (Triggering unit)) at (Center of Mixed Second Unit <gen>) facing Default building facing (270.0) degrees
Unit - Make (Last created unit) Invulnerable
Hero - Set (Last created unit) Hero-level to 2, Hide level-up graphics
Unit - Kill (Triggering unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Far Seer
Then - Actions
Else - Actions
Unit - Move (Triggering unit) instantly to (RandomSpots[Random Number between 1 and 2)
Unit - Make (Triggering unit) Vulnerable
Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.10 seconds
Unit - Create 1 Far Seer for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
Unit - Create 5 Grunt for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees


That should make it work, and to get "Random Number between 1 and 2" go under Math - Random Number.

If you got anymore questions please let me know.
 
Level 5
Joined
Sep 27, 2008
Messages
147
the only thing i could were:
  • Set RandomSpot[2] = (Random point in spam 2 <gen>)
  • Set RandomSpot[1] = (Random point in spam 1 <gen>)
and
  • Take Farseer
    • Events
      • Unit - A unit enters Take Farseer <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Wisp
        • Then - Actions
          • Unit - Create 1 Far Seer for (Owner of (Triggering unit)) at (Center of Mixed Second Unit <gen>) facing Default building facing (270.0) degrees
          • Unit - Make (Last created unit) Invulnerable
          • Hero - Set (Last created unit) Hero-level to 2, Hide level-up graphics
          • Unit - Kill (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Far Seer
            • Then - Actions
            • Else - Actions
              • Unit - Move (Triggering unit) instantly to RandomSpot[(Random integer number between 1 and 2)]
              • Unit - Make (Triggering unit) Vulnerable
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.10 seconds
              • Unit - Create 1 Far Seer for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
              • Unit - Create 5 Grunt for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
it works fine thanks :D
 
Last edited:
Status
Not open for further replies.
Top