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

Why doesnt this trigger work?

Status
Not open for further replies.
Level 11
Joined
Aug 6, 2009
Messages
697
The problem is that the convoy for some reason does not spawn,i can't figure out why,i have tried a lot of things to get this to work correctly but it doesnt anymore.

  • Events
    • Time - Reinforcements expires
  • Conditions
    • (Viking 1051 <gen> is alive) Equal to True
    • And - All (Conditions) are true
      • Conditions
        • Food Less than or equal to 5
  • Actions
    • Set Food = (Food + 1)
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Wait 0.03 seconds
        • If (RandomUnitSpawn[1] Equal to 1) then do (Unit - Create 1 Celtic Warrior for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
        • If (RandomUnitSpawn[1] Equal to 2) then do (Unit - Create 1 Celtic Calvary for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
        • If (RandomUnitSpawn[1] Equal to 3) then do (Unit - Create 1 Celtic Spear Thrower for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
        • If (RandomUnitSpawn[1] Equal to 5) then do (Unit - Create 1 Maceman for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
        • If (RandomUnitSpawn[1] Equal to 4) then do (Unit - Create 1 Celtic Beserker for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Food Greater than or equal to 5
        • And - All (Conditions) are true
          • Conditions
            • ((Playable map area) contains FoodSupply) Equal to False
      • Then - Actions
        • Game - Display to (All players) for 30.00 seconds the text: A convoy has entere...
        • Game - Display to Player Group - Player 6 (Orange) for 30.00 seconds the text: Our food supply is ...
        • Unit - Create 1 Food Supply for Player 11 (Dark Green) at (Center of Pink Hire Mercs <gen>) facing Default building facing degrees
        • Set FoodSupply = (Last created unit)
        • Unit - Order FoodSupply to Move To (Center of OrangeSpawn <gen>)
        • Trigger - Turn on OS4 <gen>
      • Else - Actions
Trigger2:
  • Events
    • Time - Every 4.00 seconds of game time
  • Actions
    • Cinematic - Ping minimap for (All players) at (Position of FoodSupply) for 2.00 seconds
    • Unit - Order FoodSupply to Move To (Center of OrangeSpawn <gen>)
Trigger 3:
  • Events
    • Unit - A unit enters OrangeSpawn <gen>
  • Conditions
    • (OrangeSpawn <gen> contains FoodSupply) Equal to True
  • Actions
    • Unit - Remove (Triggering unit) from the game
    • Game - Display to (All players) for 30.00 seconds the text: The Food Supply has...
    • Set Food = 0
Trigger 4:
  • Events
    • Time - Every 0.03 seconds of game time
  • Actions
    • Set RandomUnitSpawn[1] = (Random integer number between 1 and 5)
 
Last edited:
Level 12
Joined
Aug 12, 2008
Messages
350
With regards to the below trigger
  • If (RandomUnitSpawn[1] Equal to 1) then do (Unit - Create 1 Celtic Warrior for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
  • If (RandomUnitSpawn[1] Equal to 2) then do (Unit - Create 1 Celtic Calvary for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
  • If (RandomUnitSpawn[1] Equal to 3) then do (Unit - Create 1 Celtic Spear Thrower for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
  • If (RandomUnitSpawn[1] Equal to 5) then do (Unit - Create 1 Maceman for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
  • If (RandomUnitSpawn[1] Equal to 4) then do (Unit - Create 1 Celtic Beserker for Player 6 (Orange) at (Random point in OrangeSpawn <gen>) facing Default building facing degrees) else do (Do nothing)
Have you set the number of RandomUnitSpawn[1]? If you haven't then the RandomUnitSpawn[1] is equals to 0 by default.
If it's equals to 0 then no unit will spawn definitely as you did not trigger it.


1- You leak a point, the random point in OrangeSpawn; you should store it in the variable then remove it.
2- Another leak point at center of Pink Hire Mercs
3- Another leak point at the position of FoodSupply
4- I'm not sure whether Playable Map Area will leak but I think it's better to store it in the variable.
5- And I'm not sure whether the center of OrangeSpawn will leak as you use it in several triggers but I recommend you to store it into variable
 
Level 11
Joined
Aug 6, 2009
Messages
697
Theres no point in fixing the leaks at the moment if I can't even find the reason why it doesnt work,and yes I set the randomunis[1] value,I will update the triggers now.
@mckill2009 I rather not spread unprotected versions of my map around at the moment,but if I can't find anyone to solve the problem without the map, I will probably have to.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Make sure the Food variable has an initial variable. Failing to initialize variables (this effects elements of an array as well as single variables) will result in a thread crash every time you reference its value.

If RandomUnitSpawn[1] is not initialized to a value, it could easilly cause the described behaviour.

Remember arrays start at 0 and run upwards.
Also you could cut all the control coupling (and resulting procedural coupling) by simply using a variable type to spawn instead of testing an integer for a value to select the type. This would avoid multiple selection at this stage atleast.
 
Status
Not open for further replies.
Top