Td trigger help(not sure how to word it)

  • Thread starter Thread starter Okiest
  • Start date Start date
O

Okiest

Guest
Does anyone know how i should go about making a trigger in my td when units make it to ending spot they are removed and players lose a life for every guy that gets through i know sumthing like unit enters area for event then unit is owned by computer that controls the creeps but im not sure what to do for the action other than remove unit at location can sum1 plz help im not exactly sure how to use a leaderboard either

By the way thank you pyromancer for helping me with my loading screen it works now.
 
Use a variable (either an array, one for each player, or a variable for each player) to keep track of lives, and when a unit enters the region, set it to itself - 1. Then just have a seperate trigger the organizes the leaderboard, and set the values for the players to their lives. (Try searching the tutorials and threads to find out how to make a leaderboard). Then do something that says something like: Warning - (Lives_Left) Lives Remaining!
 
This is mine i used, you might have to edit for your use...

Code:
Go to Jail Purple
    Events
        Unit - A unit enters Player 4 Exit <gen>
    Conditions
        (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    Actions
        Set Lifes[(Player number of Player 4 (Purple))] = (Lifes[(Player number of Player 4 (Purple))] - 1)
        Game - Display to Player Group - Player 4 (Purple) the text: (|cffFF0000Careful!  You have |r + ((String(Lifes[(Player number of Player 4 (Purple))])) + |cffFF0000 Lifes Left!|r))

then if it goes to 0:

Code:
Purple Loses
    Events
        Time - Every 0.30 seconds of game time
    Conditions
        Lifes[(Player number of Player 4 (Purple))] Less than or equal to 0
    Actions
        Unit Group - Pick every unit in (Units owned by Player 4 (Purple)) and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
        Wait 2.00 seconds
        Game - Display to (All players) the text: ((Name of Player 4 (Purple)) +  has been Defeated!)
        Game - Defeat Player 4 (Purple) with the message: You lost all your l...

and the leaderbard:

Code:
Create
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for (All players) titled |cffFF0000Ocean Sur...
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                    Then - Actions
                        Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 10
                    Else - Actions
                        Do nothing
        Leaderboard - Show (Last created leaderboard)

and adding to the leaderoboard:

Code:
Set Vallue
    Events
        Time - Every 0.30 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Leaderboard - Change the value for (Picked player) in (Last created leaderboard) to Lifes[(Player number of (Picked player))]
                Leaderboard - Sort (Last created leaderboard) by Value in Descending order
 
Darthfett said:
DDRtists, that would cause major lag from the periodic events. Try making his Trigger A run Triggers B and D. That way it would only run when a unit entered the end.


i just fixed that right after i posted it, ya it makes it lag a little, but not much... :)
 
DDRtists, that would cause major lag from the periodic events
No it wouldn't.
Only reason it might lag is from the group leaks.

Use

Call DestroyGroup(GetLastCreatedGroup())
After your pick every unit action.
 
Im_On_56k said:
Call DestroyGroup(GetLastCreatedGroup())
After your pick every unit action.

What does this do, i see this alot but never figured out what it does :D
 
Each time you use pick every unit action, it creates a group but never removes it. So after awhile you will have a ton of unused groups, causing lag to the map.

call DestroyGroup(GetLastCreatedGroup()) will remove the group that was created.
 
ooo Ok, thanks alot :)


uh it gives me a error :D says:

line 195: expected a code statement :o


sorry me = jass noob :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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.
  • A Andyoyo:
    Thank you for the hard work over the years. It did not go unnoticed.

The Helper Discord

Staff online

  • Ghan
    Administrator - Servers are fun

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top