• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] fake leaving the game

Status
Not open for further replies.
Level 25
Joined
Mar 29, 2020
Messages
1,466
does "pause units" accurately mimic the effect of a player leaving the game, or am I better off giving the units to neutral passive to achieve this effect? (do units auto acquire hostile units who's owner has left the game?)

thanks!
 
Level 25
Joined
Mar 29, 2020
Messages
1,466
paused makes them not be able to move, and not respond to anything, changing ownership just gives a temporary "stop" order . my question was bc both paused and neutral passive units just stand there and get attacked. the difference is that NP units don't get auto attacked, whereas paused units belonging to an enemy will still get auto attacked. this is a question anyone who plays multiplayer online should know the answer to easily...but I don't...

sorry if my initial wording was unclear...
 
Level 25
Joined
Mar 29, 2020
Messages
1,466
I'm really not sure how this answers anything I asked. but thanks.... I will clarify - I have a (scummy) ability that fakes a player leaving the game while he is actually still in the game. I want the illusion to be complete, and so I want his units to act exactly the way they would if he actually left the game, but without him really leaving. to achieve this, I have paused all of the player's units.

my only question was - in a real multiplayer game, when a player leaves - do the enemy units still auto attack him? i think the answer is yes, and if that is the case, pause is the right way to go. If not, then I will consider other options such as giving his units to neutral passive temporarily without changing the color (until he gives command X) to make his enemy units not auto attack. and if this is not a good solution than I would be happy to hear why not and what is.

thanks!
 
Level 13
Joined
May 10, 2009
Messages
868
my only question was - in a real multiplayer game, when a player leaves - do the enemy units still auto attack him?
Yes, they still do attack.

Just pausing all units is not quite there yet, you need to make every enemy player treat that player as Neutral. Otherwise, they will still auto-attack such player.
  • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Neutral
Let's say that both players 1 and 2 are enemies on map init. If you proceed with that action above at a later point in game, player 2 won't attack player 1, but player 1 will still treat 2 as enemy.
 
Level 25
Joined
Mar 29, 2020
Messages
1,466
Yes, they still do attack.

Just pausing all units is not quite there yet, you need to make every enemy player treat that player as Neutral. Otherwise, they will still auto-attack such player.
  • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Neutral
Let's say that both players 1 and 2 are enemies on map init. If you proceed with that action above at a later point in game, player 2 won't attack player 1, but player 1 will still treat 2 as enemy.

so how is that different from pausing? right now I have it paused and the computer player keeps attacking my units after I pause them. they are aused, so they just stand there and do nothing. according to what you say that is how they (leaver's units) are supposed to behave. no?
 
Level 13
Joined
May 10, 2009
Messages
868
Because pausing will just prevent your units from doing anything. Enemy players (computer) will be able to attack them as if they were a Scout Tower (can't attack, nor move). In fact, you need to both pause units and make enemy players treat the spell-cast player as neutral (this is the missing part for your spell).

To sum it up, here's how it goes:

Player X cast spell -> pause units, store all enemy players in a variable/player group, make all enemies treat the caster as neutral.

Deactivating the spell: Unpause all units, make those stored players treat player X as enemy again.
 
Level 25
Joined
Mar 29, 2020
Messages
1,466
here's what I don't get. I asked if enemy units auto attack units of a player that let the game, and you wrote:
Yes, they still do attack.

but then when explaining what to do you wrote -
Otherwise, they will still auto-attack such player.

which implies the opposite - that when trying to replicate the effect of a player leaving the game, I don't want enemies to auto attack.

so which one is it - do enemy units auto attack units of players who have left or not?

sorry for being so thick...
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,011
Ok, really simple explanation what happens in a melee map:
Player 1 and Player 2 exists, both are enemy to each other.
Player 2 leaves, units just stand idle, treats any other player as neutral. Other players treat it as an enemy, so they can get auto-attacked.
Player 1 happens to attack a Player 2's unit, while the attacked unit is still standing idle.
Mind blown solution:
  • Easiest Guide
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set VariableSet PlayerUnits[(Player number of (Triggering player))] = (Units owned by (Triggering player).)
      • -------- remove specific units from group --------
      • Unit Group - Remove (Triggering unit) from PlayerUnits[(Player number of (Triggering player))].
      • -------- change ownership --------
      • Unit Group - Pick every unit in PlayerUnits[(Player number of (Triggering player))] and do (Actions)
        • Loop - Actions
          • Unit - Change ownership of (Picked unit) to Neutral Passive and Retain color
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Picked player) treat (Triggering player) as an Neutral
Note that you can use PlayerUnits group variable later to change ownership back.


Also, paused units don't attack other units nor are able to move, HOWEVER, they CAN get attacked. I don't know what you actually meant or what the idea was or why you assumed paused units can't get attacked. Overall this was very confusing to me. xddd
 
Last edited:
Level 25
Joined
Mar 29, 2020
Messages
1,466
Other players treat it as an enemy, so they can get auto-attacked.
this is really all I needed. thanks!!!

I know don't what you actually meant or what the idea was or why you assumed paused units can't get attacked.
the two of us have some serious communication barrier lol (probably my fault for starting this question from the middle). I don't know why you think I assume that. what I said (and did) is that if I pause the units of the player using the ability (the fake leaver) - it makes it look like he left, bc pausing his units makes them stand idle, whilst still getting attacked by their enemies (aka = the same situation as if that player would have left).

sorry for driving you guys nuts and thanks for the help!:thumbs_up:
 
Status
Not open for further replies.
Top