TD Unit Spawn and Movement Trigger Shortening

  • Thread starter Thread starter Tom_Green
  • Start date Start date
T

Tom_Green

Guest
Is there a way to shorten my TD triggers?

Hello again. I started a TD a while ago, but never really started it because at the time, I was clueless on triggers. Now I reopened it and blew the dust off and gave it another shot. Wow lol. Its a maze type solo TD, and i made the trigger to spawn and move for only 1 of the 4 paths. It took 9 triggers for the one path O.O I almost cried when I realized that it was going to take 36 triggers...for 1 level. I didnt want to post the triggers because I didnt want to take up an entire page, and I wasnt sure if people would want to read through the whole thing lol, also its hard to help me when you dont know the path. So heres the map, and if you could, PLZ PLZ could somebody open it up and tell me if there is a way to shorten up the triggers! :banghead:
 

Attachments

First thing I have to mention is that you already wrote triggers that function for each level, except for the spawn triggers. The second is that in TD's array variables are your friends. E.g. you could have a unit variable called level, and make it an array with size equal to the number of levels your TD is going to have. Set the unit for each index during initialization, then just reference the index for what level it is in the spawn trigger. for example:
A: create 1(level[current level]) at center of region...
 
Ahh ic. ANd i know that I already have triggers for each level, I was just wondering if there was a way to shorten them. It could end up to be like 500 triggers by the end o.O
 
the Lumpy, his triggers were better before. Those movement triggers would guide EVERY SINGLE LEVEL. You'd only have to set up a total of 32 triggers, and that way you wouldn't need the actions wait until unit enters region... those would lag the map horribly, especially if the unit died. Then the wait actions would be running the whole game, because the unit would never enter the regions. Major Memory Leaks! Your triggers would only run when a unit enters the region, while his would run every second until it gets there. Take a look at my td - Dynamite TD. It should give you an idea of how few triggers you would need.
BTW, it has little over 100 triggers, 7 players (and spawns), and it has 3 game styles.

Dynamite TD
 
So... your trying to get at having one trigger? Try this out, it willb e just as long but it will be a lot less triggers:
Code:
Movement from spawn
    Events
        Unit - A unit enters Spawn 1 top <gen>
        Unit - A unit enters Spawn 1 middle <gen>
        Unit - A unit enters Spawn 1 bottom <gen>
        Unit - A unit enters Spawn 2 top <gen>
        Unit - A unit enters Spawn 2 middle <gen>
        Unit - A unit enters Spawn 2 bottom <gen>
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Owner of (Entering unit)) Equal to Player 6 (Orange)
                (Owner of (Entering unit)) Equal to Player 12 (Brown)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Entering unit)) Equal to Player 6 (Orange)
                (Spawn 1 top <gen> contains (Entering unit)) Equal to True
            Then - Actions
                Unit - Order (Entering unit) to Attack-Move To (Center of Move top <gen>)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Entering unit)) Equal to Player 6 (Orange)
                (Spawn 1 middle <gen> contains (Entering unit)) Equal to True
            Then - Actions
                Unit - Order (Entering unit) to Attack-Move To (Center of Spawn 2 middle <gen>)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Entering unit)) Equal to Player 6 (Orange)
                (Spawn 1 bottom <gen> contains (Entering unit)) Equal to True
            Then - Actions
                Unit - Order (Entering unit) to Attack-Move To (Center of Move bottom <gen>)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Entering unit)) Equal to Player 12 (Brown)
                (Spawn 2 top <gen> contains (Entering unit)) Equal to True
            Then - Actions
                Unit - Order (Entering unit) to Attack-Move To (Center of Move top <gen>)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Entering unit)) Equal to Player 12 (Brown)
                (Spawn 2 middle <gen> contains (Entering unit)) Equal to True
            Then - Actions
                Unit - Order (Entering unit) to Attack-Move To (Center of Spawn 1 middle <gen>)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Owner of (Entering unit)) Equal to Player 12 (Brown)
                (Spawn 2 bottom <gen> contains (Entering unit)) Equal to True
            Then - Actions
                Unit - Order (Entering unit) to Attack-Move To (Center of Move bottom <gen>)
            Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top