Trigger help. GUI

Stealphish2

Active Member
Reaction score
0
Ok this is the trigger im working on:
Trigger.jpg


This tigger is meant to be a system that makes pigs mate and reproduce and age nd stuff.

The problem is changing the young pigs into pigs and changing the pigs into aged pigs.
I cant use "last created unit" instead of using the variables iv put in (pig and youngpig) because the trigger gets mixed up because its happening over and over all over the place.
And those variables there obviously dont work because by the time the waiting period is over after setting the variable the trigger has executed a few more times meaning the the index wud be different. (hope that makes sense :nuts:)

I have no idea how to do any of that fansy jass stuff so maybe one of u experts can help me out?

Cheers
 

Whisky

New Member
Reaction score
45
By the way, does your condition really work?

I mean, how can one pig be both male and female? o_O

You may want to add this to the conditions:
Trigger:
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
 

tork

New Member
Reaction score
2
this might be what your looking for i think

Trigger:
  • PigsCreated
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Point = (Random point in (Playable map area))
      • Unit - Create 1 Young Pig for Neutral Passive at Temp_Point facing Default building facing degrees
      • Unit Group - Add (Last created unit) to YoungPigs
      • Custom script: call RemoveLocation (udg_Temp_Point)

Trigger:
  • PigsAge
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in YoungPigs and do (Actions)
        • Loop - Actions
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than or equal to 5
            • Then - Actions
              • Unit Group - Remove (Picked unit) from YoungPigs
              • Set Temp_Point = (Position of (Picked unit))
              • Unit - Remove (Picked unit) from the game
              • Unit - Create 1 Pig for Neutral Passive at Temp_Point facing Default building facing degrees
              • Unit Group - Add (Picked unit) to Pigs
              • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions

Trigger:
  • PigsAgeSomeMore
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Pigs and do (Actions)
        • Loop - Actions
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than or equal to 5
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Pigs
              • Set Temp_Point = (Position of (Picked unit))
              • Unit - Remove (Picked unit) from the game
              • Unit - Create 1 Old Pig for Neutral Passive at Temp_Point facing Default building facing degrees
              • Unit Group - Add (Picked unit) to AgedPigs
              • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions

Trigger:
  • PigsAgedandDie
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Pigs and do (Actions)
        • Loop - Actions
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than or equal to 5
            • Then - Actions
              • Unit Group - Remove (Picked unit) from AgedPigs
              • Unit Group - Remove (Picked unit) from AgedPigs
              • Unit - Kill (Picked unit)
            • Else - Actions


Hopes this help any quest just ask:)

i know its doesnt really mate but you could figur it out sorry im busy and only had like a couple of second
 

Stealphish2

Active Member
Reaction score
0
By the way, does your condition really work?

I mean, how can one pig be both male and female? o_O

You may want to add this to the conditions:
Trigger:
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions

Its not the same pig its too differnt units. The conditions say "attacked unit" and "attacking unit".

Tork! Thats awsum dude. I like the idea of using the custom value as like the age of the pig. Thats great! lol Cheers man ill give it a go tonight.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top