• 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.

Wrong Spawn {preventing units from spawning on cliffs}

Status
Not open for further replies.

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
is there a way to prevent units spawning at cliffs?

patchingblockers.jpg
wrongplacement.jpg
editor.jpg
 
Last edited:

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
will it spawn at water and marble blocks too?

EDIT: just by using ground-patchable true, it won't let me place it at cliffs on World Edit. but in game it can spawn there :s
 

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
Thanks so much this worked like this.

  • Crates
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
      • (Number of units in (Units of type Crate)) Less than 250
    • Actions
      • Set CratePoint = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at CratePoint) Equal to 2
        • Then - Actions
          • Unit - Create 1 Crate for Neutral Passive at CratePoint facing Default building facing degrees
        • Else - Actions
      • Custom script: call RemoveLocation (udg_CratePoint)
Solved~
 
Level 5
Joined
Feb 5, 2008
Messages
109
Thanks so much this worked like this.

  • Crates
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
      • (Number of units in (Units of type Crate)) Less than 250
    • Actions
      • Set CratePoint = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at CratePoint) Equal to 2
        • Then - Actions
          • Unit - Create 1 Crate for Neutral Passive at CratePoint facing Default building facing degrees
        • Else - Actions
      • Custom script: call RemoveLocation (udg_CratePoint)
Solved~
Ouch, this might end up in creating no crate. You should run this trigger again so the trigger will try to spawn one until it finds a random point where it is possible.

Like that:
  • Crates
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
      • (Number of units in (Units of type Crate)) Less than 250
    • Actions
      • Set CratePoint = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at CratePoint) Equal to 2
        • Then - Actions
          • Unit - Create 1 Crate for Neutral Passive at CratePoint facing Default building facing degrees
        • Else - Actions
          • Trigger - Run Crates <gen> (checking conditions)
      • Custom script: call RemoveLocation (udg_CratePoint)
 
  • Like
Reactions: Ham

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
Right! now it's really solved~ i found out that when the random point was set to cliff it could make no unit at all, but now with your "run again" trigger will make this spawn somewhere else if it was set to cliff.

SOLVED!
 
Level 5
Joined
Feb 5, 2008
Messages
109
Hm, there might be two other things you got to fix:

If a second instance of the trigger is run, it might run before the first one is finished. That would mean that the RemoveLocation of the first instance would remove a location which the second already removed, so the location created in the first trigger will still leak.
(I guess it's like that, though I don't know exactly how the trigger queue works.)

  • Crates
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
      • (Number of units in (Units of type Crate)) Less than 250
    • Actions
      • Custom script: local location udg_CratePoint
      • Set CratePoint = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at CratePoint) Equal to 2
        • Then - Actions
          • Unit - Create 1 Crate for Neutral Passive at CratePoint facing Default building facing degrees
        • Else - Actions
          • Trigger - Run Crates <gen> (checking conditions)
      • Custom script: call RemoveLocation (udg_CratePoint)
  • Crates
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
      • (Number of units in (Units of type Crate)) Less than 250
    • Actions
      • Set CratePoint = (Random point in (Playable map area))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at CratePoint) Equal to 2
        • Then - Actions
          • Unit - Create 1 Crate for Neutral Passive at CratePoint facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_CratePoint)
        • Else - Actions
          • Custom script: call RemoveLocation (udg_CratePoint)
          • Trigger - Run Crates <gen> (checking conditions)
Furthermore, I think the condition in your trigger leaks because it creates a unit group which is not removed later on. You could make that check inside the trigger actions, so you can remove the group.

By the way, I guess you are not using Jass NewGen Pack because you use custom script to call RemoveLocation. If so, get it at Jass NewGen Pack v5b - Wc3campaigns, it's a MUST!


Have fun with that. =)
Triax
 
Status
Not open for further replies.
Top