Problems with Players

  • Thread starter Thread starter maerlyn
  • Start date Start date
M

maerlyn

Guest
In my map, there are units set out for each player. I wanted to delete the units of players not present, so I made a trigger:

Code:
"Remove Excess Units"
Events: Map Initialization
Conditions:
Actions: If ((Player 2 (Red) controller) Equal to Computer) then do (Unit - Remove Rifleman 0011 <gen> from the game) else do (Do nothing)

I thought there was a small chance it would work, so I tried it. And it removed the units for Player 2, and no one else. Later I found out that when I Tested it, it would automatically add a Player 2. When I tried to make a multiplayer game, the Undead force with one computer in it would be empty. What's going on? How do I make the enemies count as a player? And can anyone help me with a trigger that deletes excess units?
 
Code:
Player Not Presant
    Events
        Map initialization
    Conditions
    Actions
        For each (Integer A) from 1 to (nr of player), do (If (((Player((Integer A))) controller) Equal to Computer) then do (Unit Group - Pick every unit in (Units in (Playable map area) owned by (Player((Integer A)))) and do (Unit - Remove (Picked unit) from the game)) else do (Do nothing))
        For each (Integer A) from 1 to (nr. of player), do (If (((Player((Integer A))) slot status) Equal to Is unused) then do (Unit Group - Pick every unit in (Units in (Playable map area) owned by (Player((Integer A)))) and do (Unit - Remove (Picked unit) from the game)) else do (Do nothing))

Step by Step

1.-Add event map initialization to a new trigger

2.-Create a new action called (For each integre A, Do Action)

3.-Set the integre to go from 1-number of human players

4.-Set the If condition equal to if player(Integre A) controller equal to Computer.
NOTE: To set it to pick player integre a select the buttom drop down menu at the player selection find the Convert Player index to player and set the number to (integre a)

5.-Add the Then action (Unit group pick every unit in playable map area owned by player(Integre a) and do unit - Remove picked unit form the game)
NOTE: This is found under the Unit Group - Actions section

6.Else action Set to do nothing

7.Repeat this trigger but this time use the player slot status condition instead of player controller.

Then you are done

What does it do?

It removes all units owned by your human players if they arent in the game or if they are computer controlled.

When done the trigger should look like the one in the blue field above in this reply
 
Better use "((Player 2 (Red) controller) Not Equal to User)" so the unit gets removed even when there isn't a computer on that place. Adding a player 2 and such in multiplayer is usually caused by the settings under Scenario => Player Properties... so I would suggest you check the settings there.
 
I think this might work

Code:
Untitled Trigger 008
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        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
                        Or - Any (Conditions) are true
                            Conditions
                                ((Picked player) controller) Equal to Computer
                                ((Picked player) controller) Equal to None
                                ((Picked player) slot status) Equal to Is unused
                                ((Picked player) slot status) Equal to Has left the game
                    Then - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                            Loop - Actions
                                Unit - Remove (Picked unit) from the game
                    Else - Actions
                        Do nothing


~:D

Edit: changed to work constantly
 
kc102 said:
I think this might work


Untitled Trigger 008
Events
Time - Every 5.00 seconds (Edited)
Conditions
Actions
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
Or - Any (Conditions) are true
Conditions
((Picked player) controller) Equal to Computer
((Picked player) controller) Equal to None
((Picked player) slot status) Equal to Is unused
((Picked player) slot status) Equal to Has left the game
Then - Actions
Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Else - Actions
Do nothing
~:D

Damn, a more simple way then mine :D + removes if leaves i suggest you use this instead of mine LOL :D
 
Thanks! It works :) That new one looks more complicated. So I'll stick with the first one. 'Sides, I want the units to stay if the player leaves.

The only remaining problem is this: I have the undead enemy set to Computer. But it doesn't show up when I go to make a mulitplayer game.
 
Code:
Untitled Trigger 001
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (If (((Picked player) slot status) Not equal to Is playing) then do (Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Unit - Remove (Picked unit) from the game)) else do (Do nothing))
 
Thanks everybody! I got my triggers down now. And I fixed my other problem -- I hadn't locked the Player properties :o. Map is done! I'll go and host it now.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/
  • The Helper The Helper:
    Also on the bottom right side bar we now have a Trending Content Box!
    +1
  • The Helper The Helper:
    Not on the Headline News page just on the Forums page can we get that Featured and Trending on the home page?
  • Ghan Ghan:
    Since the home page is technically a forum, it now shows on all forum views. Still in the sidebar.
    +1
  • The Helper The Helper:
    Happy Friday! Hope everyone has a fantastic day and an even better weekend!
  • The Helper The Helper:
    Happy Sunday!
  • The Helper The Helper:
    I lovc that I can post webp and X links now! :)
  • The Helper The Helper:
    Happy Thursday!
  • 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

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top