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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top