• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Help with a trigger

Status
Not open for further replies.
Level 6
Joined
Apr 5, 2013
Messages
154
  • StartIron
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Iron for Player 12 (Brown) at (Random point in (Playable map area)) facing Default building facing degrees
      • Unit - Create 1 Iron (Circle) for Player 12 (Brown) at ((Position of (Last created unit)) offset by 150.00 towards (Real(Degrees[(Random integer number between 0 and 4)])) degrees) facing Default building facing degrees
This trigger is used to generate random ores on the map which is completely flat. But for some reason, the circle of power that spawns next to is not always 150 units away, sometimes it's almost fully inside the ore, and sometimes farther away from the ore than usual. What gives?
 
Level 11
Joined
Jan 2, 2016
Messages
472
According to your trigger it shoud work as you intended. Besides that change your trigger a bit adding these:

  • StartIron
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Reg1 = Random point in (Playable map area)
      • Unit - Create 1 Iron for Player 12 (Brown) at Reg1 facing Default building facing degrees
      • Unit - Create 1 Iron (Circle) for Player 12 (Brown) at (Reg1 offset by 150.00 towards (Real(Degrees[(Random integer number between 0 and 4)])) degrees) facing Default building facing degrees
      • Custom scripts - call RemoveLocation(udg_Reg1)
Your map will start lagging if you don't remove the leaks.The modification i've made removes the leaks.
 
Level 11
Joined
Jun 2, 2004
Messages
849
There's still an additional leak (point offset by angle creates another point).

As for why they move, it might be collision. Make sure the iron and the circle aren't buildings, have no collision, have pathing type set to none, and are given the Ghost - Visible ability.
 
Status
Not open for further replies.
Top