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.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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