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?
 
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.
 
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.
Back
Top