Last 2 things to finish my work...

wc345

Member
Reaction score
1
Hi
So it is left only 2 things to finish my map,i hope anyone will help me out and with that like all other stuffs around my map :)
So :
1.How can i do when for example 30 waves over the games over (If PlayerRedLives is more than PlayerBlueLives,Player Red Wins) ?
And
2.How can i do a command in the game like (-2pl) for 2 players and (-4pl) for 4 players because i put the 4 starts from where comes units and if playing only 2 players to go only from 2 starts ? Is it possible ? And if is it,how ?

It's about a TD map and i'm sorry if i'm a very cheeky...
 

Inflicted

Currently inactive
Reaction score
63
It's about a TD map and i'm sorry if i'm a very cheeky...
Not at all, your welcome to ask here.

1.How can i do when for example 30 waves over the games over (If PlayerRedLives is more than PlayerBlueLives,Player Red Wins) ?
Have a count of your levels, and when it should go to "level 31" do a trigger checking which player has more lives left. Then display Defeat message saying "Winner" or "Loser". Well end actions are up to you, lol.

2.How can i do a command in the game like (-2pl) for 2 players and (-4pl) for 4 players because i put the 4 starts from where comes units and if playing only 2 players to go only from 2 starts ? Is it possible ? And if is it,how ?
There is an event that detects text being entered:
Player - Player 1 (Red) types a chat message containing -2pl as An exact match
for example.
Then have a boolean variable set that is checked when the levels spawn, if the boolean value is set to True/False (however you wanted it) then decide where the waves are meant to spawn and not meant to spawn.

Erm, I need to sleep now. But if you can't figure it out and nobody has solved this by the time I'm back; I will do another demo map showing this for you.
 

wc345

Member
Reaction score
1
I still can't figure it out :( I don't know how to make that event which detects entered text and also can't do a trigger which cheking who got more lives :( I really sorry about that...
 

Smitty

Member
Reaction score
20
Entered text is under the 'player' event section, I believe it's at the top of the list. To detect who has more lives you need a trigger using a sorting algorithm, there have been a fair few in different threads, try a search for it. You could instead just detect how many players are playing, rather than relying on your players to type in a command, but that's up to you :)
 

wc345

Member
Reaction score
1
Well in the Event section and then Player,there's Chat Message with text,that's what i find there and i've search but i can't find anything...
 

Inflicted

Currently inactive
Reaction score
63
Here you go:
Trigger:
  • Player sets amount of players
    • Events
      • Player - Player 1 (Red) types a chat message containing -2pl as An exact match
      • Player - Player 1 (Red) types a chat message containing -4pl as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -2pl
        • Then - Actions
          • Set DualPlayerMode = True
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -4pl
        • Then - Actions
          • Set DualPlayerMode = False
        • Else - Actions

Trigger:
  • Your spawning trigger
    • Events
      • Time - Every 2.50 seconds of game time
    • Conditions
    • Actions
      • -------- Add some conditions to your spawning triggers --------
      • -------- spawn 1 --------
      • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn 1 <gen>) facing Default building facing degrees
      • -------- spawn 2 --------
      • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn 2 <gen>) facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DualPlayerMode Equal to False
        • Then - Actions
          • -------- spawn 3 --------
          • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn 3 <gen>) facing Default building facing degrees
          • -------- spawn 4 --------
          • Unit - Create 1 Footman for Player 12 (Brown) at (Center of Spawn 4 <gen>) facing Default building facing degrees
        • Else - Actions

DualPlayerMode is a Boolean that is set to True if it is in 2Player Mode, but defaultly set to False for 4 player mode.

Here is the promised demo map:
 

Attachments

  • Simple Spawn Setup.w3x
    9.4 KB · Views: 157

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
You forgot to attach the map, Inflicted. (xD)

Back on-topic, you need an integer variable that keeps track of waves. When that variable's value goes over 30, then you run a separate trigger that deals with the victory/defeat actions.
 

Inflicted

Currently inactive
Reaction score
63
lolz yeah my bad.
He should already have the Wave Level Count somewhere in his level system. But yeah it should be obvious what he needs to do, if there is anything that is unclear, feel no hesitation in asking.
 

wc345

Member
Reaction score
1
But did i need to delete my other spawn triggers ? or just add and this spawn triggers ?
 

Inflicted

Currently inactive
Reaction score
63
Add the conditions that where used from my example to your original spawn trigger.
No need to delete anything, rather adjust it.
 

wc345

Member
Reaction score
1
But the problem is that i've made a spawns another units from starting regions and when i do this they will spawn and my and units from this trigger ?
 

Inflicted

Currently inactive
Reaction score
63
Just put my conditions for "Your spawning trigger" into your original trigger.
Eg, your spawn looks like this:

Time is ##
Spawn at Point1
Spawn at Point2
Spawn at Point3
Spawn at Point4

Change it to:

Time is ##
Spawn at Point1
Spawn at Point2
if DualPlayerMode (or whatever the variable was) = False
THEN [
Spawn at Point3
Spawn at Point4
]

Because you only want to spawn at the 2 points in 2 player mode, while in 4 player mode it spawns at all 4 points.
 

wc345

Member
Reaction score
1
Yes,thanks a lot man,now it works just fine :) Thanks for good definition,but now how can i do a end of game (like when all 30 waves over,it says "Defeat" to player which have less lives from other(s) ) ?
 

Inflicted

Currently inactive
Reaction score
63
Do you have a Variable that keeps the level? Like a Wave Count kindof thing?
Add a Condition to your spawn trigger that says:
If/Else Statement
IF Level = 31
THEN
If (Player 1 Lives Greater than Player 2 Lives)
Show Victory for Player 1
Show Defeat for Player 2
Else
Show Defeat for Player 1
Show Victory for Player 2

But you might want to also add in something to check if they are equal for a draw. That's up to you.

Edit: Explanation: Oh, the reason I said 31, is because you said there was 30 levels. As the count reaches more than that (in this case 31) it plays the end game actions. There are many ways to do this, but this is imo probably the simplest.
 
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