Respawn Trigger Troubles

Matemeo

New Member
Reaction score
20
Ok heres the trigger I made up for a respawn trigger

Code:
QuillBoreRespawn
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Quillboar_Countem Less than 10
            Then - Actions
                For each (Integer A) from 1 to 13, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in (Units in QuillBoareRect[(Integer A)]((Unit-type of (Matching unit)) Equal to Quillboar))) Equal to 0
                            Then - Actions
                                Unit - Create 1 Quillboar for Neutral Hostile at (Random point in QuillBoareRect[(Integer A)]) facing Default building facing (270.0) degrees
                                Set Quillboar_Countem = (Quillboar_Countem + 1)
                                If (Quillboar_Countem Greater than 9) then do (Skip remaining actions) else do (Do nothing)
                            Else - Actions
            Else - Actions

What it does is simple enough, if the number of units gets too low, then it goes through my region array which there is 13. Then it checks to see if theres a unit there already, but...it seems to disregard that step. It always spawns them at the first region in the array.

:confused: I'm lost about how to fix this. Any help would be truly appreciated, I've been trying to fix it up for awhile now. Thanks in advance.
 

elmstfreddie

The Finglonger
Reaction score
203
If i'm reading correctly, I see an If/Then/Else in an If!!!

Edit > NVM, misread horribly. Give me a sec to read through this again.

Edit > Seems ok, but I'm assuming Quilboar_Countem is a unit group, you sure that group isn't screwed up in some way?

Edit > I don't think this is necessary but put in Do Nothing for Else.

Edit > It has no trigger to reset "Quilboar_Countem" back to 0, so as soon as that gets to 10, every 5 seconds it will spawn a Quilboar in a random point in all 13 regions!!!

Edit > Oops, missed something. Apparently you... Tried? To reset Quilboar Countem... To me it looks like it just cranks up the number 1!
"Set Quillboar_Countem = (Quillboar_Countem + 1)" will just set it to the current thing plus 1...

Edit > Humm... How about, pick every unit in unit QuilboarRext[IntegerA] and then say If it is a quilboar, add it to a temp group, and if it isn't, don't do anything. Then say count every unit in the temp group, and if it is less than 1 create a quilboar??
 

Matemeo

New Member
Reaction score
20
Let me clarify a lil, I probably should have at my first post. QuillBoar_Countem Is an integer variable that takes the number of alive quillboars, at startup its 13, each time a quillboar dies, it takes 1 away, when it goes through the loops, I have it to where it adds one, so that if it goes back up to the point where its no longer needed, it'll stop looping, otherwise I get 13 spawns, and it looks chaotic and stupid :)

Regardless however, I believe the condition to be the culprit, though I can't say for sure, I tried changing it around, but the one I have, was the best looking one.

I'll try the temp group thing, didn't think about that.
 

NullCurrent

( ゚ε ゚)
Reaction score
110
I dont know if this will help... but, AceHart made a post in free tiggers, unit triggers. Its (i think) the 3rd one down. I dont really know if this will help.... But its worth a try if he posted it =)
 

Matemeo

New Member
Reaction score
20
I've seen em, and looked at them, I like em, but I wanted to make my own :D
Wanna learn to do it
 

Nigerianrulz

suga suga how'd you get so fly?
Reaction score
198
Code:
QuillBoreRespawn
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [COLOR="red"]Quillboar_Countem Less than 10[/COLOR]
            Then - Actions
                [COLOR="Red"]For each (Integer A) from 1 to 13, do (Actions)[/COLOR]
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ([COLOR="red"]Number of units in (Units in QuillBoareRect[(Integer A)]((Unit-type of (Matching unit)) Equal to Quillboar))) Equal to 0[/COLOR]
                            Then - Actions
                                Unit - Create 1 Quillboar for Neutral Hostile at (Random point in QuillBoareRect[(Integer A)]) facing Default building facing (270.0) degrees
                                Set Quillboar_Countem = (Quillboar_Countem + 1)
                                [COLOR="red"]If (Quillboar_Countem Greater than 9) then do (Skip remaining actions) else do (Do nothing)[/COLOR]
                            Else - Actions
            Else - Actions

all the ones in red is either missing some or wrong
1- the Quillboar_Countem doesnt know when it is less than 10 because you never said anything about setting the Quillboar_Countem to +1 for every Quillboar there is.

2- For each (Integer A) from 1 to 13, do (Actions)
there is no need for that you didnt even did it right using this action so just delet it

3- If - Condition (Number of units in (Units in QuillBoareRect[(Integer A)]((Unit-type of (Matching unit)) Equal to Quillboar))) Equal to 0
change it to (Number of units in (QuillboareRect <gen>) Equal to 0
(Unit-type of (Matching unit)) Equal to Quillboar) Equal to True

4- If (Quillboar_Countem Greater than 9) then do (Skip remaining actions) else do (Do nothing) there is no need for Skip remaining actions since here is no action after

after some this errors fixed this should look a bit better :D
 

Matemeo

New Member
Reaction score
20
To the above poster, 3 of those are perfect the way they are supposed to be:D I set the number of quillboars at start up, For IntegerA 1 to 13 is just the loop for the 13 regions in the array, QuillboareRect, and there has to be skip remaining actions, because, otherwise it simple reloops, but the number 3 helped me SO, thanks alot :D

EDIT: I simplified it, instead of checking for the unit types currently in the regions, I just made it check to see if there was anything period in it, dont want enemies to spawn whilst a hero is there, or if theres already a unit there :D
 
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