Defeat

wc345

Member
Reaction score
1
How can i make a defeat like in TD when you got no more chances ? like if it is 0 or less to be a defeat ?
 

Inflicted

Currently inactive
Reaction score
63
Something like this (note, freehand)

Life Reduction Trigger:
Events
Unit enters region
Conditions
Owner of entering unit is Player 12
Actions
Remove Unit
Set Lives = Lives - 1
If/Else Statement
IF Lives = 0
THEN:
Pick all Players = User and Playing
Game - Show defeat message for picked player saying "you are out of lives eg"

Erm, if you can't get that. Please mention what you are struggling with.
 

wc345

Member
Reaction score
1
I can't figure out with this IF/THEN/ELSE,i will post what i have :

DIE

Die
Events
Unit - A unit enters Region 004 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit - Explode (Triggering unit)

TURN ON

Turn On
Events
Time - Elapsed game time is 50.00 seconds
Conditions
Actions
Trigger - Turn off (This trigger)
Trigger - Turn on Spawn 2 <gen>

SPAWN 1

Spawn
Events
Time - Every 10.00 seconds of game time
Conditions
Actions
Unit - Create 30 Frost Wyrm for Player 12 (Brown) at (Center of Region 000 <gen>) facing Default building facing degrees
Wait 10.00 seconds
Unit - Create 4 Abomination for Player 12 (Brown) at (Center of Region 000 <gen>) facing Default building facing degrees

SPAWN 2

Spawn 2
Events
Time - Every 60.00 seconds of game time
Conditions
Actions
Unit - Create 4 Crypt Fiend for Player 12 (Brown) at (Center of Region 000 <gen>) facing Default building facing degrees


MOVE 1

Move 1
Events
Unit - A unit enters Region 000 <gen>
Unit - A unit enters Region 004 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of Region 001 <gen>)

MOVE 2

Move 2
Events
Unit - A unit enters Region 003 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of Region 004 <gen>)




LEADERBOARD LIVES

Leaderboard Lives
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Leaderboard - Create a leaderboard for (All players) titled <Empty String>
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
(Player 1 (Red) controller) Equal to User
(Player 1 (Red) slot status) Equal to Is playing
Then - Actions
Set PlayerRedLives = 30
Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Lives and value PlayerRedLives
Else - Actions
Do nothing
Leaderboard - Show (Last created leaderboard)


LEADERBOARD UPDATE

Leaderboard Update
Events
Unit - A unit enters Region 004 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Set PlayerRedLives = (PlayerRedLives - 1)
Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to PlayerRedLives


That's it...
 

Inflicted

Currently inactive
Reaction score
63
yw, if there is anything you struggle with. Please ask, or leave me a PM for a private response or demo map with an example.

edit:
combine your trigger "Die" and "Leaderboard Update".

Do this:

Leaderboard Update
Events
Unit - A unit enters Region 004 <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Set PlayerRedLives = (PlayerRedLives - 1)
Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to PlayerRedLives
Unit - Explode (Triggering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
PlayerRedLives = 0
Then - Actions
Defeat Trigger
Else - Actions

Sorry it is rough hand, just using your triggers and abit of pseudo.

Try to avoid the function 'Do Nothing' - otherwise your triggers are fine.
 

wc345

Member
Reaction score
1
But how can i put this :

If - Conditions
PlayerRedLives = 0


I can't find a something with variable in the Conditions ?
 

Smitty

Member
Reaction score
20
Make it a real variable, then have game event- a real variable (playerlives) becomes equal to 0.
 

Inflicted

Currently inactive
Reaction score
63
Thats the IF part of the IF/ELSE statement.
And this:
" PlayerRedLives = 0 "
Is an integer comparison.

Go to Conditions, Integer, Very top of the Box is a section for variables.
 

Smitty

Member
Reaction score
20
But he wants an event, not a condition, surely, for a defeat trigger? But yeh, that'd work.
 

Inflicted

Currently inactive
Reaction score
63
The event would be the unit entering the region, its quicker just to check lives in that same trigger.
But usage of another trigger to constantly check what the real is doing is possible.
Also note that this is an integer.

Preventing a double post, lol, edit:

And now the leaderboard is only dialog without numbers :/

Apon the loss of a life, adjust the leaderboard.

Quick question, are lives shared by the team or are they for individuals?
 

wc345

Member
Reaction score
1
Can i do it without in the leaderboard trigger ? because it's seems not working to me...It says defeat but don't count,there no numbers in the box :(
 

Inflicted

Currently inactive
Reaction score
63
I have my editor infront of me now, I can make you a demo quick.
What system do you want, team lives or individual lives?
 

wc345

Member
Reaction score
1
Well i make a TD map for 2 players which is not in team,they must survive and if one of them lose his lives to says Defeat...
 

Inflicted

Currently inactive
Reaction score
63
[del]okay, give me 5 minutes.[/del]

ok done, hope this helps. Sorry I did not test it.
 

Attachments

  • life system demo.w3x
    14 KB · Views: 127

Inflicted

Currently inactive
Reaction score
63
Here are the triggers:
Trigger:
  • Create Stuff
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Lives
      • Set Player1Lives = 30
      • Set Player2Lives = 30
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label (Name of Player 1 (Red)) and value Player1Lives
      • Leaderboard - Add Player 2 (Blue) to (Last created leaderboard) with label (Name of Player 2 (Blue)) and value Player2Lives

Trigger:
  • Lose a life
    • Events
      • Unit - A unit enters Team 1 Loses Here &lt;gen&gt;
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set Player1Lives = (Player1Lives - 1)
      • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Player1Lives
      • Unit - Explode (Entering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player1Lives Equal to 0
        • Then - Actions
          • Game - Defeat Player 1 (Red) with the message: Defeat! You have no...
          • Game - Victory Player 2 (Blue) (Show dialogs, Show scores)
        • Else - Actions

Trigger:
  • Lose a life 2
    • Events
      • Unit - A unit enters Team 2 Loses here &lt;gen&gt;
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 12 (Brown)
    • Actions
      • Set Player2Lives = (Player2Lives - 1)
      • Leaderboard - Change the value for Player 2 (Blue) in (Last created leaderboard) to Player1Lives
      • Unit - Explode (Entering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Player2Lives Equal to 0
        • Then - Actions
          • Game - Defeat Player 2 (Blue) with the message: Defeat! You have no...
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
        • Else - Actions

Variables:
Player1Lives - Integer
Player2Lives - Integer

It isn't much, I tried to keep it as basic and easy to implement as possible.
To change the starting lives, merely change:

Set Player1Lives = 30
Set Player2Lives = 30

From my trigger Create Stuff [lol]
 
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