Reproduction trigger wont work

Idontknowyou

New Member
Reaction score
33
I use these two triggers and an autocast ability to make my villagers reproduce

Knock up
Events
Unit - A unit Begins casting an ability
Conditions
And - All (Conditions) are true
Conditions
(Ability being cast) Equal to Knock up
((Target unit of ability being cast) has buff pregnant ) Equal to False
Actions
Unit Group - Add (Target unit of ability being cast) to pregnantwomen

Have baby
Events
Time - Every 10.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in pregnantwomen and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff pregnant ) Equal to False
Then - Actions
Unit - Create 1 Child for Player 9 (Gray) at (Position of (Picked unit)) facing Default building facing degrees
Unit Group - Remove (Picked unit) from pregnantwomen
Else - Actions

This should make the woman have a child once the buff wears off, but it doesn't; can anyone spot an error in my triggering?

The ability is being cast, but the women don't reproduce once the buff is gone....
 

freakincage

New Member
Reaction score
1
I use these two triggers and an autocast ability to make my villagers reproduce

Knock up
Events
Unit - A unit Begins casting an ability
Conditions
And - All (Conditions) are true
Conditions
(Ability being cast) Equal to Knock up
((Target unit of ability being cast) has buff pregnant ) Equal to False
Actions
Unit Group - Add (Target unit of ability being cast) to pregnantwomen

Have baby
Events
Time - Every 10.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in pregnantwomen and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff pregnant ) Equal to False
Then - Actions
Unit - Create 1 Child for Player 9 (Gray) at (Position of (Picked unit)) facing Default building facing degrees
Unit Group - Remove (Picked unit) from pregnantwomen
Else - Actions

This should make the woman have a child once the buff wears off, but it doesn't; can anyone spot an error in my triggering?

The ability is being cast, but the women don't reproduce once the buff is gone....

The section I highlighted red, is that suppose to be True? I don't know, I am just giving it my best shot here...
 

Septimus

New Member
Reaction score
58
Code:
Have baby
Events
Time - Every 10.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in pregnantwomen and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff pregnant ) Equal to [COLOR="Red"]False[/COLOR]
Then - Actions
Unit - Create 1 Child for Player 9 (Gray) at (Position of (Picked unit)) facing Default building facing degrees
Unit Group - Remove (Picked unit) from pregnantwomen
Else - Actions

Set to true and it probably work.
 

Idontknowyou

New Member
Reaction score
33
Well if they don't have the buff, they are supposed to have the child and be removed from the pregnant women group, it's meant to be false.
 

Septimus

New Member
Reaction score
58
Currently you are setting that if the unit does not have the buff, it would create a child.
 

Idontknowyou

New Member
Reaction score
33
you are only looking at the one trigger, there is another that adds them to the pregnant women group when the ability is cast on them.

if they are in the group, but they no longer have the buff, it means they are due.

EDIT:got it working,

Have baby
Events
Time - Every 10.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units owned by Player 9 (Gray) matching ((((Matching unit) is in pregnantwomen) Equal to True) and (((Matching unit) has buff pregnant ) Equal to False))) and do (Actions)
Loop - Actions
Unit - Create 1 Child for Player 9 (Gray) at (Position of (Picked unit)) facing Default building facing degrees
Unit Group - Remove (Picked unit) from pregnantwomen

I guess it messes up when you use an "if then else function" within a "pick every unit in group" function
 

Charapanga

New Member
Reaction score
46
You got set false, and it's in a unit group, so it's picking every unit who doesnt have preagnant buff, just set that to true and do "Remove preagnant from Picked unit"
 
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