Life System

Jscooby

New Member
Reaction score
1
Trigger:
  • Losing Lives
    • Events
      • Unit - A unit enters Region 009 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
    • Actions


I want to create a life system, to where a unit walks into this region and takes away 1 life.

That's all I have so far... I know this is probably going to be something to do with variables, just don't know how to go about it.
 

ajzdfd

New Member
Reaction score
5
you will need to make an integer variable. call its "lives" to stay simple
Then use this:
Trigger:
  • Set lives = (lives - 1)
 

Jscooby

New Member
Reaction score
1
Alright... Have that set, but how do I set what the total amount of lives is?
Trigger:
  • Losing Lives
    • Events
      • Unit - A unit enters Region 009 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
    • Actions
      • Set Lives = (Lives - 1)


EDIT: I set the integer to 20 lives when you edit the string. Is that how you do it? (Or the value I think it is called.)

How would I display in a chat message to the players how many lives they have left if one is lost. I only have this, I know I need some type of thing to make it recognize the integer.
Trigger:
  • Game - Display to (All players) for 3.00 seconds the text: You have lost a lif...
 

HailCommi

New Member
Reaction score
15
for setting the # of lives, try:

Trigger:
  • Set Lives
    • Events
      • Map Initialization
    • Conditions
    • Action
      • Set - Set Lives = 20



As for displaying the # of lives left, use string String Concatenations and Conversion - Integer to String:
Trigger:
  • Game - Display to (All players) the text: (You have + ((String(Lives)) + lives left.))
 

Jscooby

New Member
Reaction score
1
I do not understand how to get his part of the last line: (You have + ((String(Lives)) + lives left.))

And for the other part I have...

Trigger:
  • Set Lives
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Lives = 20


And
Trigger:
  • Losing Lives
    • Events
      • Unit - A unit enters Region 009 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
    • Actions
      • Set Lives = (Lives - 1)
      • Game - Display to (All players) for 3.00 seconds the text: You have lost a lif...


(Still need to do the Game - Display line.)
 

HailCommi

New Member
Reaction score
15
- Go make an action,
- Click "Game - Text Message (Auto-Timed)"
- Click the red "Text" button
- Under Function, select "Concatenate Strings"
- Click the red "String 1" button
- For the Value, type "You have" <or whatever you want>
- Click OK <it should take you back a dialog box>
- Click the red "String 2"
- Under Function, select "Concatenate Strings"
- Click the red "String 1" button
- Under Function, select "Conversion - Convert Integer To String"
- Click the blue part that says "(Player number of (Triggering player))"
- Under Variable, select "Lives" <or w/e the name of your variable is>
- Click OK
- Click OK
- Click the red "String 2" button
- For the Value, type " lives left" <or whatever you want>
- Go nuts on clicking OK

:D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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