Zandronum Chat on our Discord Server Get the latest version: 3.1
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002594Zandronum[All Projects] Suggestionpublic2016-01-25 00:012018-10-23 16:20
ReporterHypnotoad 
Assigned ToTorr Samaho 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.0-beta 
Target Version3.0Fixed in Version3.0 
Summary0002594: ACS spectator/join control
DescriptionWhen I make game modes, I'd like to be able to dynamically remove and re-add players to the game during the session, however this is difficult to do. One option I try is to make a custom spectator class, however I cannot stop these 'spectators' from triggering line actions with use, even if I put +NOTRIGGER on their class.

If I were able to turn players into spectators and back from acs, this would be very useful. Dusk mentioned that this might be possible by extending the 'dead spectator' stuff, exposing it to ACS.
Attached Files? file icon voodoo.wad [^] (6,589 bytes) 2017-04-18 19:56
? file icon DeadSpectatorTest.wad [^] (4,312 bytes) 2017-04-24 14:34
? file icon testdeadspecbots.pk3 [^] (672 bytes) 2017-04-29 15:21
? file icon respawnbugtest.wad [^] (1,578 bytes) 2017-04-29 17:06
? file icon DeadSpectTest.wad [^] (2,512 bytes) 2017-06-22 15:51
? file icon inventoryTest.wad [^] (2,731 bytes) 2017-06-25 13:47
? file icon TIDTest.wad [^] (2,821 bytes) 2017-06-25 19:02

- Relationships
parent of 0003339resolvedEdward-san Same-spot respawn doesn't work when respawning dead spectators. 

-  Notes
User avatar (0014195)
Dusk (developer)
2016-01-25 00:04

What I had in mind was to expose our "dead spectator" handling to ACS. By "extending" I rather mean that we should rename it. The "dead" term is simply because of the only current use case of this engine feature. It's currently under wraps and mods could certainly use it IMO.

(Yes this would also mean that mods could resurrect players in LMS. I see no problem in this.)
User avatar (0014831)
Torr Samaho (administrator)
2016-05-07 09:00

I agree that we should expose the "dead spectator" handling to ACS. One possibility would be to add an additional argument to ForceToSpectate that allows to specify whether the player should be turned into a true spectator or a dead spectator. Furthermore, we'd need an additional function SpawnSpectator that turns a spectator (doesn't matter if "true" or "dead") into a player and spawns a new body.

Opinions?
User avatar (0014832)
Edward-san (developer)
2016-05-07 10:16

For the name of the function which spawns a player from a spectator I'd say 'SpawnPlayerFromSpectator' or 'ForceSpectatorJoin'..
User avatar (0014837)
Hypnotoad (reporter)
2016-05-08 20:47

ForceToJoin, or just ForceJoin, would be best in my opinion since it's a clear corollary to 'ForceToSpectate'.
User avatar (0015533)
Torr Samaho (administrator)
2016-08-28 19:56

We discussed this in our dev meeting and decided that we'll add a function that allows to set the "dead spectator" status of a player, i.e. it can turn a player into a dead spectator and a dead spectator back into a player. Mods shouldn't be messing with true spectators, so we won't add functionality that forces a true spectator to join.

We'll just need a good name for that function, possibly getting rid of the intuitive notion of "dead spectators". Opinions?
User avatar (0015536)
Ivan (reporter)
2016-08-29 09:30

How about "RaisePlayer" for dead spec to player and "KillPlayer" for player to dead spec?
User avatar (0015539)
Hypnotoad (reporter)
2016-08-29 13:54

But this would make it difficult to, for instance, have spectators in survival join midway through. I suppose the mod could just be run in coop mode and have players automatically become "dead spectators" on joining unless certain conditions are met, though that would be fairly messy. Would it be possible to perhaps add a GAMEMODE lump flag which makes all players join as "dead spectators", so the mod can decide what to do from there?

As for the name, maybe you can consider joined/dead spectators a new class of spectator, and call them 'observers' - then the function could be called 'SetObserver(bool)'.
User avatar (0015540)
Dusk (developer)
2016-08-29 15:06

Quote
How about "RaisePlayer" for dead spec to player and "KillPlayer" for player to dead spec?

That's going to just get mixed up with in-game death and revival.

Quote
But this would make it difficult to, for instance, have spectators in survival join midway through. I suppose the mod could just be run in coop mode and have players automatically become "dead spectators" on joining unless certain conditions are met, though that would be fairly messy. Would it be possible to perhaps add a GAMEMODE lump flag which makes all players join as "dead spectators", so the mod can decide what to do from there?

I think that if the player is in the join queue, he's eligible for joining, and ACS should be able to make him join the game.

Quote
As for the name, maybe you can consider joined/dead spectators a new class of spectator, and call them 'observers' - then the function could be called 'SetObserver(bool)'.

Observer is only a synonym for spectator, so the name doesn't work either.
User avatar (0015541)
Torr Samaho (administrator)
2016-08-29 17:57

Quote from Dusk
I think that if the player is in the join queue, he's eligible for joining, and ACS should be able to make him join the game.

For this to work reasonably, we also have to make information about the join queue available via ACS. That's no problem, we'll just need at least one additional ACS function.
User avatar (0015542)
Hypnotoad (reporter)
2016-08-29 20:08

Quote
Observer is only a synonym for spectator, so the name doesn't work either.


What about these: AwaitingPlayer, ProspectivePlayer, QueuedPlayer
User avatar (0015543)
Torr Samaho (administrator)
2016-08-30 06:01

Another thought: Instead of allowing mods to mess with players in the join queue, we could instead (allow the mod to) allow true spectators to join as dead spectator in case joining as player is currently forbidden by the gamemode.
User avatar (0015545)
Hypnotoad (reporter)
2016-08-30 17:12

That also sounds reasonable to me.
User avatar (0017142)
Torr Samaho (administrator)
2017-04-15 17:49

Ok, I added the ACS command SetDeadSpectator (int playernumber, int deadspectator). This command can turn alive players into dead spectators (deadspectator == 1) and revive dead spectators (deadspectator == 0). To use it, add
-130:SetDeadSpectator(2),

to zspecial.acs.
User avatar (0017143)
Hypnotoad (reporter)
2017-04-16 03:11

Awesome, but how come deadspectator is an int rather than a bool?
User avatar (0017144)
Torr Samaho (administrator)
2017-04-16 06:58

Declaring it as at int now leaves the possibility open to allow values other than 0 and 1 later on, if we should see the need for it, without breaking backwards compatibility.
User avatar (0017195)
Hypnotoad (reporter)
2017-04-18 17:18

By the way it would be helpful if the function was added to zspecial.acs.
User avatar (0017197)
Hypnotoad (reporter)
2017-04-18 18:43
edited on: 2017-04-18 19:16

I was testing this in teamlms and was occasionally getting voodoo dolls when setting spectator, can't reproduce any more but I think it has something to do with the short amount of time you have invulnerability (by default dmflags) when you spawn.

edit: seems to happen consistently now, setdeadspectator on a player during a teamgame on Enter causes a flashing voodoo doll to spawn

User avatar (0017200)
Hypnotoad (reporter)
2017-04-18 19:18

Quote
Instead of allowing mods to mess with players in the join queue, we could instead (allow the mod to) allow true spectators to join as dead spectator in case joining as player is currently forbidden by the gamemode.


Will this be implemented by the way?
User avatar (0017201)
Torr Samaho (administrator)
2017-04-18 19:22

Quote from Hypnotoad
seems to happen consistently now, setdeadspectator on a player during a teamgame on Enter causes a flashing voodoo doll to spawn

Can you create a minimal example wad that allows to reproduce this easily?

Quote from Hypnotoad

Will this be implemented by the way?

I'm not sure yet whether I'll have enough time to finish this before we release 3.0. Fixing the 3.0 regressions definitely has priority.
User avatar (0017202)
Hypnotoad (reporter)
2017-04-18 19:28
edited on: 2017-04-18 21:39

Quote
Can you create a minimal example wad that allows to reproduce this easily?


I'll see what I can do

Quote
I'm not sure yet whether I'll have enough time to finish this before we release 3.0. Fixing the 3.0 regressions definitely has priority.


Alternatively, a simple GAMEMODE flag that disables the round from ending if everyone is a dead spectator, and a function that allows you to manually end the round (and pick the winning team)?

Also, I noticed GAMEMODE has a DEADSPECTATORS flag, can I ask what setting this flag does?

edit: I just tried adding the deadspectators flag to cooperative and it causes a fatal error when you do this and then do SetDeadSpectator (PlayerNumber(), 1) in an enter script.

edit 2: adding USEMAXLIVES to GAMEMODE for cooperative fixes the crash, but it now produces voodoo dolls in multiplayer, and in singleplayer turns you into a bizarre static doomguy whose sprite still shows, with gravity still applying, but cant shoot, interact or jump

User avatar (0017204)
Hypnotoad (reporter)
2017-04-18 19:58

I've uploaded voodoo.wad to this ticket. To test, simply load the wad, change game mode to teamlms, add a few bots and let it last for several. You should see a few instances of voodoo dolls.

The script just sets a player to dead spectator on enter, with 50/50 chance (to prevent everyone from being dead spectator and therefore ending the round immediately).
User avatar (0017268)
Torr Samaho (administrator)
2017-04-23 10:47

Quote from Hypnotoad

Alternatively, a simple GAMEMODE flag that disables the round from ending if everyone is a dead spectator, and a function that allows you to manually end the round (and pick the winning team)?

That's not so easy to implement, since it would require changes to all the game modes.

Quote from Hypnotoad

Also, I noticed GAMEMODE has a DEADSPECTATORS flag, can I ask what setting this flag does?

It's an internal flag that declares that dead spectators exist in the game mode. It wasn't meant to be used without the MAPRESETS flag in a game mode that has map resets, e.g. survival or lms.

Quote from Hypnotoad
I've uploaded voodoo.wad to this ticket. To test, simply load the wad, change game mode to teamlms, add a few bots and let it last for several. You should see a few instances of voodoo dolls.

Does this only happen offline? So far, I couldn't reproduce it online.
User avatar (0017269)
Torr Samaho (administrator)
2017-04-23 11:17

Can you check if this fixes the problem?
User avatar (0017277)
Hypnotoad (reporter)
2017-04-23 14:25

Quote
That's not so easy to implement, since it would require changes to all the game modes.


Well the problem is that as it is now the feature isn't very usable, at least on competitive game modes. If I'm making any kind of new mod where I want control over who is in and isn't in the game, it's highly likely that there will at least be one or two temporary moments where everyone will be set to dead spectator, for instance in the beginning of the game where I need to choose who will be in and who won't be, or if I need to swap one player (the only live one) in a team for another. If the game suddenly ends every time everyone is temporarily set to spect, you start to run into huge problems.

I suppose this might be bypassed by hacking a team game mode into cooperative with acs, but the function still appears to be broken with cooperative currently.

Quote
It's an internal flag that declares that dead spectators exist in the game mode. It wasn't meant to be used without the MAPRESETS flag in a game mode that has map resets, e.g. survival or lms.


To clarify, is it possible at all, with the right combination of GAMEMODE flags, to have deadspectators work in coop? Because right now I'm either getting a fatal error or the strange bugs as described earlier depending on what flags are used.

Quote
Can you check if this fixes the problem?


This appears to fix the problem with voodoo dolls in teamlms. However, it doens't fix the issues with cooperative.
User avatar (0017280)
Torr Samaho (administrator)
2017-04-23 15:05

Quote from Hypnotoad
To clarify, is it possible at all, with the right combination of GAMEMODE flags, to have deadspectators work in coop? Because right now I'm either getting a fatal error or the strange bugs as described earlier depending on what flags are used.

The code was never intended to be used in such a way, to it may not be possible without further changes under the hood. Did you try adding DEADSPECTATORS and MAPRESETS to coop?
User avatar (0017282)
Torr Samaho (administrator)
2017-04-23 16:38
edited on: 2017-04-23 16:42

Quote from Hypnotoad
I just tried adding the deadspectators flag to cooperative and it causes a fatal error when you do this and then do SetDeadSpectator (PlayerNumber(), 1) in an enter script.

This should hopefully be fixed now.

EDIT: Here is a test build with the fix.

User avatar (0017294)
Hypnotoad (reporter)
2017-04-23 20:04

Quote
EDIT: Here is a test build with the fix.


This seems to have largely fixed the issues, however I still get the strange behaviour in single player I described before if the USEMAXLIVES flag is added to coop, and it seems to produce a single voodoo doll when you switch to multiplayer emulation from single player and spectate, under those circumstances, but then no more after.
User avatar (0017308)
Fused (reporter)
2017-04-24 14:37
edited on: 2017-04-24 15:07

I noticed when playing around a bit that turning a player into a dead spectator calls a RESPAWN type script. Is that intended? I added an example wad.

Also, it would be nice to have an option to keep scripts from stopping when turning someone into a dead spectator. I know there's a compat flag for it, but having an option with the function itself would prove better than having to change all my code to support the compat flag.

EDIT: I request this because I want to create a "login" screen when someone enters. The only problem I have with this is that basically.
I did notice something weird. When I set the dead spectator as activator, it's not the activator. However when that RESPAWN script is called, it appears it does turn the player as the activator. I tested this through a print message that prints the activator.

User avatar (0017326)
Torr Samaho (administrator)
2017-04-25 19:59

Quote from Hypnotoad

This seems to have largely fixed the issues, however I still get the strange behaviour in single player I described before if the USEMAXLIVES flag is added to coop, and it seems to produce a single voodoo doll when you switch to multiplayer emulation from single player and spectate, under those circumstances, but then no more after.

Please test if this fixes the issue.

Quote from Fused

I noticed when playing around a bit that turning a player into a dead spectator calls a RESPAWN type script. Is that intended? I added an example wad.

Isn't this also the case when a dead player is turned into a dead spectator by the internal game modes when the player has no lives left? So far the new function just mimics what the existing game modes do. We can still discuss though whether this needs to be adjusted.

Quote from Fused

Also, it would be nice to have an option to keep scripts from stopping when turning someone into a dead spectator. I know there's a compat flag for it, but having an option with the function itself would prove better than having to change all my code to support the compat flag.

Spectators (true and dead) are supposed to be not part of the game. Thus, they have all scripts stopped. The reason why we have the compat flag is to stay compatible with existing mods that relied on the legacy behavior. I see your point though. Perhaps we need to keep scripts of dead specators, but not of true ones.
User avatar (0017348)
Hypnotoad (reporter)
2017-04-26 18:28

Quote
Please test if this fixes the issue.


That appears to have fixed it, nice.

Still hoping there can be some way to disable automatic round ends if all your players happen to be dead spect, but I suppose I can find some hacky/ugly solutions to this using acs for now if absolutely necessary (I hope).
User avatar (0017362)
Cutman (reporter)
2017-04-27 13:43

I'm having the voodoo issue too but it looks like it's going to be fixed.

Another (minor) issue: Bots do not like being resurrected by SetDeadSpectator. They will stand there and do nothing, even if attacked.
User avatar (0017368)
Fused (reporter)
2017-04-27 18:24
edited on: 2017-04-27 18:24

Quote

Isn't this also the case when a dead player is turned into a dead spectator by the internal game modes when the player has no lives left? So far the new function just mimics what the existing game modes do. We can still discuss though whether this needs to be adjusted.


After using'http://www.mediafire.com/file/3rkhlka7rqx5n27/ZandroDev3.0-OfflineSpecJoinFixTest.7z [^]' it appears the RESPAWN script triggers in survival aswell, when turning into a dead spectator by the engine when out of lives.

This actually does not happen in the latest release, which is'http://zandronum.com/forum/viewtopic.php?f=55&t=8266&sid=acb76a0bbad1ea9c821b7d24a3683df0 [^]'

So this is actually something that must've come with this update.

Quote

Spectators (true and dead) are supposed to be not part of the game. Thus, they have all scripts stopped. The reason why we have the compat flag is to stay compatible with existing mods that relied on the legacy behavior. I see your point though. Perhaps we need to keep scripts of dead specators, but not of true ones.

Yeah I know the system has this behaviour intended. It would be great if you could make that an option. It would save a lot of script jumping, if that even allows everything still.

User avatar (0017373)
Torr Samaho (administrator)
2017-04-27 19:42

Quote from Hypnotoad

Still hoping there can be some way to disable automatic round ends if all your players happen to be dead spect, but I suppose I can find some hacky/ugly solutions to this using acs for now if absolutely necessary (I hope).

Right now, I don't see a reasonable way of adding a feature that allows a mod to stop a round reset of one of the built-in gamemodes, but won't get in the way later on if we ever get around to externalize the game modes. Did you already check if it's possible to handle the necessary reviving in death scripts so that the round end condition is not fulfilled unless you want it to be? If not, can't you take full control by just using coop, dm, teamplay or teamgame as base, instead of lms, survival etc.?

Quote from Cutman

Another (minor) issue: Bots do not like being resurrected by SetDeadSpectator. They will stand there and do nothing, even if attacked.

Does this happen offline and/or online? Does it also happen in the build I posted above in #17326? If so, can you post a minimal example wad?

Quote from Fused

After using'http://www.mediafire.com/file/3rkhlka7rqx5n27/ZandroDev3.0-OfflineSpecJoinFixTest.7z [^]' it appears the RESPAWN script triggers in survival aswell, when turning into a dead spectator by the engine when out of lives.

This actually does not happen in the latest release, which is'http://zandronum.com/forum/viewtopic.php?f=55&t=8266&sid=acb76a0bbad1ea9c821b7d24a3683df0
[^]'
FYI, online and offline behavior were inconsistent (online was correct),'http://www.mediafire.com/file/3rkhlka7rqx5n27/ZandroDev3.0-OfflineSpecJoinFixTest.7z [^]' fixes that. Were RESPAWN script triggerd in survival online before? If not, can you make a 2.1.2 compatible minimal example wad? The online behavior should not differ from 2.1.2.
User avatar (0017387)
Hypnotoad (reporter)
2017-04-28 18:36

I tried to post this last night but couldn't because I kept getting the following message: "Invalid form security token. This could be caused by a session timeout, or accidentally submitting the form twice.":

Quote
Did you already check if it's possible to handle the necessary reviving in death scripts so that the round end condition is not fulfilled unless you want it to be?


Can you elaborate on this? Not sure what you mean.

Quote

 If not, can't you take full control by just using coop, dm, teamplay or teamgame as base, instead of lms, survival etc.?


Probably, I just need to account for people joining mid way through. Does teamgame/teamplay actually not end the current session if an entire team's players (or both teams') are dead spectators? That's probably helpful if so.
User avatar (0017394)
Torr Samaho (administrator)
2017-04-29 10:29

Quote from Hypnotoad
Can you elaborate on this? Not sure what you mean.

AFAIR DEATH scripts are started before the engine checks whether the round end conditions are fulfilled. Thus, to prevent the round from ending, you could try to have the DEATH script revive a dead spectator of your choice when the last player dies. By the time the engine checks whether the round should end, you possibly already have a living player again, which would prevent the round from ending. I didn't test this though, so I can't say for sure that it works.

Quote from Hypnotoad
Does teamgame/teamplay actually not end the current session if an entire team's players (or both teams') are dead spectators? That's probably helpful if so.

Teamgame, teamplay, dm and coop never end the current round on their own. None of these game modes even have the concept of a round built in. You'd need to create the round handling with ACS. The only thing these game modes have, is a concept of being "in progress". Coops is considered in progress if there is at least one non-spectator player. Teamgame, teamplay and dm are considered to be in progress if there are at least two non-spectator players. Being "in progress" has no real effect for the game modes unless you add USEMAXLIVES to the mode with the GAMEMODE lump. In that case, players can't join while the game is in progress.
User avatar (0017401)
Cutman (reporter)
2017-04-29 15:02
edited on: 2017-04-29 15:03

About the bots freezing up, happens both offline and online. You can use pukename testno x x in offline skirmish to test:

script "testno" (int player, int which)// NET
{
    SetDeadSpectator(player, which);
}

'http://cutstuff.net/public/testdeadspecbots.pk3 [^]'

(Be sure to set it to a game mode that has dead spectators i.e Survival)

User avatar (0017402)
Torr Samaho (administrator)
2017-04-29 15:21

Thanks for the example wad! Reviving bots with SetDeadSpectator should work now.
User avatar (0017420)
Fused (reporter)
2017-04-29 17:08
edited on: 2017-04-29 17:11

I uploaded respawnbugtest.wad. I cannot reproduce this in 2.1.2 either. This appeared between Zandronum 3.0-alpha-170416-0710 and'http://www.mediafire.com/file/3rkhlka7rqx5n27/ZandroDev3.0-OfflineSpecJoinFixTest.7z. [^]' I tested both cases online.

I can't find a build which has the very first records of setdeadspectator, so I can't check more than this myself sadly.

User avatar (0017422)
Torr Samaho (administrator)
2017-04-29 17:24

Thanks for the example wad! Please post the exact steps necessary to see the difference between 2.1.2 and 3.0. I saw the message in 2.1.2 and 3.0, so I need to know which situation you are referring to.
User avatar (0017424)
Fused (reporter)
2017-04-29 17:32

I made a local server to try this. I just joined myself twice into a survival server, waited for the countdown, and the killed myself in console. This made it only appear in the build linked above. I tried all of that on windows.
User avatar (0017425)
Torr Samaho (administrator)
2017-04-29 17:35
edited on: 2017-04-29 17:45

Ah, I see. I can reproduce the problem now.

EDIT:'https://bitbucket.org/Torr_Samaho/zandronum/commits/20799d542904620f36815ae8e3aba5e1dea438e1 [^]' changed the behavior.

User avatar (0017428)
Torr Samaho (administrator)
2017-04-29 18:19

Turning players into dead spectators should not trigger RESPAWN anymore.
User avatar (0017566)
Torr Samaho (administrator)
2017-05-07 10:15

I this working sufficiently well now?
User avatar (0017571)
Fused (reporter)
2017-05-07 12:09
edited on: 2017-05-07 12:10

Oh, oops. I tried with'https://jenkins.csnxs.uk/job/zandronum/20/label=windows/ [^]' and it works now.

Now if there's a way to keep scripts running for dead spectators, then I'm completely happy with SetDeadSpectator().

User avatar (0017574)
Torr Samaho (administrator)
2017-05-07 12:51
edited on: 2017-05-07 12:51

Quote from Fused
Now if there's a way to keep scripts running for dead spectators, then I'm completely happy with SetDeadSpectator().

Doesn't "compat_dont_stop_player_scripts_on_disconnect 1" do that?

User avatar (0017579)
Fused (reporter)
2017-05-07 13:48

Quote
Doesn't "compat_dont_stop_player_scripts_on_disconnect 1" do that?

It does, but in my opinion this function should probably not stop scripts whatsoever. Alot of functionality misses from this function when it's disabled, and honestly I see no point in stopping scripts at all when you use this function. The only thing stopping scripts here achieves is having to choose another activator for the script that calls it and make sure we remember the dead spectator, which is just messy.
User avatar (0017872)
Hypnotoad (reporter)
2017-06-22 14:46

I'm having issues with SetDeadSpectator(id, 0) (i.e. spawning someone back in) not returning their weapons or ammo (or any weapons/ammo) to the player in coop. An example wad shouldn't be necessary, just write a super simple script where you set yourself to be dead spectator, then after a few seconds unset yourself as deadspectator and you'll spawn without any weapons.
User avatar (0017873)
Hypnotoad (reporter)
2017-06-22 15:42
edited on: 2017-06-22 16:01

I forgot to mention that you need a GameMode lump with addflag DEADSPECTATORS for it to work in Coop of course. But more seriously, I've just realised that SetDeadSpectator() doesn't work at all online in cooperative, even with the GAMEMODE flag, it only works offline. Here's a minimal test wad to prove it:'http://s000.tinyupload.com/index.php?file_id=48149107025524565054 [^]'

edit: adding MAPRESETS doesn't help either

edit2: attached DeadSpectTest.wad to the ticket at Dusk's behest (careful not to confuse it with similarly named DeadSpectatorTest.wad)

User avatar (0017904)
Torr Samaho (administrator)
2017-06-25 12:21

FYI, the version of DeadSpectTest.wad attached to the ticket differs from the one you linked on tinyupload. The former has "MAPRESETS", the latter does not.

In any case, both seem to work fine for me online on a local server started with:
zandronum -file DeadSpectTest.wad -host

What's going wrong when you test this?

Quote from Hypnotoad

I'm having issues with SetDeadSpectator(id, 0) (i.e. spawning someone back in) not returning their weapons or ammo (or any weapons/ammo) to the player in coop.

As default behavior, dead spectators lose their inventory (it has been like this for ages and many people complained when one of Zalewa's recent patches changed this). So, resurrecting a player should give him the default inventory, not his previous inventory. But if I understand you correctly, the player gets no inventory at all? That shouldn't happen. Please provide a minimal example wad to reproduce the issue.
User avatar (0017908)
Hypnotoad (reporter)
2017-06-25 13:47

Apologies, it appears I was using the wrong 3.0 binary when testing online (compared to offline) as I was using doomseeker to host and it was still pointing to an older 3.0 binary. It works (except for losing all inventory still) in the latest released beta.

Quote
But if I understand you correctly, the player gets no inventory at all? That shouldn't happen. Please provide a minimal example wad to reproduce the issue.


Correct. I've attached inventoryTest.wad to the ticket, note that this ONLY happens online or when multiplayer emulation is enabled, it does not happen in strict single player mode.
User avatar (0017910)
Torr Samaho (administrator)
2017-06-25 14:01

Thanks for clarifying. Please test if this fixes the issue.

BTW: Although I didn't test this at all yet, SetDeadSpectator should respect sv_deadplayerscankeepinventory. So if you want dead players to keep their inventory, it should be possible to achieve this with that cvar.
User avatar (0017911)
Hypnotoad (reporter)
2017-06-25 14:11

The new binary works, thanks for the very prompt fix. sv_deadplayerscankeepinventory works as well.
User avatar (0017912)
Torr Samaho (administrator)
2017-06-25 14:20

You're welcome and thanks for testing!
User avatar (0017914)
Hypnotoad (reporter)
2017-06-25 14:37

One last question (sorry), is it intended for players to have their TIDs reset to 0 on being set to dead spectator? This could be confusing for modders, but if that's intended then I can always just set their TIDs again in a respawn script.
User avatar (0017915)
Torr Samaho (administrator)
2017-06-25 14:44

True spectators intentionally have their TID reset to 0, but IIRC dead spectators do not. How is 2.1.2 handling this in survival? I'd say we should stay consistent with this.
User avatar (0017916)
Hypnotoad (reporter)
2017-06-25 15:07

I'm finding it hard to test what their TID is (since 2.1.2 has no SetActivatorToPlayer), although it seems even dying in survival sets your TID back to 0, so perhaps having your TID reset isn't so unusual after all.
User avatar (0017917)
Torr Samaho (administrator)
2017-06-25 16:30

Could you use a simple ENTER script that keeps printing the TID of the activator regularly?
User avatar (0017923)
Hypnotoad (reporter)
2017-06-25 18:54

The playerTID seems to stay in 2.1.2 when checking with that script + compat_dont_stop_player_scripts_on_disconnect, unlike in 3.0 where it is reset to 0.
User avatar (0017924)
Torr Samaho (administrator)
2017-06-25 18:58

Can you attach the wad you used to test this to the ticket? I'd like to have a closer look at what's going on in the engine.
User avatar (0017925)
Hypnotoad (reporter)
2017-06-25 19:03

Sure, I've uploaded TIDTest.wad, just run it with survival + compat_dont_stop_player_scripts_on_disconnect, add a bot and then kill yourself.

It's not actually a big deal if the tid resets to 0, since the setdeadspectator stuff uses player numbers rather than TIDs and I can't think why you'd need the TID of a dead spectator, so perhaps it's actually more sensible this way.
User avatar (0017940)
Hypnotoad (reporter)
2017-06-26 23:46

Minor bug, when you're revived from dead spectator, you inherit the chasecam state you had as a spectator. So while chase might be disabled, it's still enabled when you're spectating someone, so when you're revived you get chasecam (and can't change back to first person).
User avatar (0017945)
Torr Samaho (administrator)
2017-06-27 05:57

Does the chasecam problem only happen in the latest beta build or also in previous betas?
User avatar (0017966)
Hypnotoad (reporter)
2017-07-02 20:12

Happens in 170416-0710, the beta where the function was first introduced.
User avatar (0017974)
Fused (reporter)
2017-07-03 09:26
edited on: 2017-07-04 09:30

Would it be possible to give this function a damagetype parameter, or some way to not leave corpses on the floor when calling this function? I implemented this into Zombie Horde, and it's used for joining people, but if people keep entering, it just piles up corpses, and I can't really fix that properly if there's no damagetype, or an optional argument to not leave corpses.

EDIT: I also noticed that when someone dies and you set them as a dead spectator manually, the death frames will not finish. Is that intended? And is there a way around it? I can wait out a full second before setting them as a dead spectator, but then they can respawn in that time, which looks messy.

User avatar (0017993)
Torr Samaho (administrator)
2017-07-09 19:54

Quote from Hypnotoad
Happens in 170416-0710, the beta where the function was first introduced.

Thanks for the info! Should be fixed now.
Quote from Fused

Would it be possible to give this function a damagetype parameter, or some way to not leave corpses on the floor when calling this function?

What if you give the player a tid before turning him into a dead spectator? The corpse should keep that tid when you turn the player into a dead spec since it is the former body of the player. Then you should be able to remove the corpse by removing the actor with that tid.
Quote from Fused

I also noticed that when someone dies and you set them as a dead spectator manually, the death frames will not finish. Is that intended? And is there a way around it? I can wait out a full second before setting them as a dead spectator, but then they can respawn in that time, which looks messy.

I had problems with the death animation since the player is disassociated from the corpse immediately when you call SetDeadSpectator. If you need the death animation you could remove the corpse as above and spawn a dummy actor in its places that just uses the same animation. Would that be sufficient for you?
User avatar (0018000)
Kaminsky (developer)
2017-07-10 02:37

Tested in 170709-2004, when a dead spectator is revived using SetDeadSpectator(player, 0), the chasecam cheat is properly removed and the player starts in the first-person view again.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: Hypnotoad Korshun djskaarj WaTaKiD AlienOverlord Meesor Marcaek unknownna Kaminsky
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2016-01-25 00:01 Hypnotoad New Issue
2016-01-25 00:04 Dusk Note Added: 0014195
2016-05-07 09:00 Torr Samaho Note Added: 0014831
2016-05-07 09:00 Torr Samaho Assigned To => Torr Samaho
2016-05-07 09:00 Torr Samaho Status new => feedback
2016-05-07 10:16 Edward-san Note Added: 0014832
2016-05-08 20:47 Hypnotoad Note Added: 0014837
2016-05-08 20:47 Hypnotoad Status feedback => assigned
2016-08-28 19:56 Torr Samaho Note Added: 0015533
2016-08-29 09:30 Ivan Note Added: 0015536
2016-08-29 13:54 Hypnotoad Note Added: 0015539
2016-08-29 15:06 Dusk Note Added: 0015540
2016-08-29 17:57 Torr Samaho Note Added: 0015541
2016-08-29 20:08 Hypnotoad Note Added: 0015542
2016-08-30 06:01 Torr Samaho Note Added: 0015543
2016-08-30 17:12 Hypnotoad Note Added: 0015545
2017-04-02 20:41 Torr Samaho Target Version => 3.0
2017-04-15 17:49 Torr Samaho Note Added: 0017142
2017-04-15 17:49 Torr Samaho Status assigned => needs testing
2017-04-16 03:11 Hypnotoad Note Added: 0017143
2017-04-16 06:58 Torr Samaho Note Added: 0017144
2017-04-18 17:18 Hypnotoad Note Added: 0017195
2017-04-18 18:43 Hypnotoad Note Added: 0017197
2017-04-18 19:16 Hypnotoad Note Edited: 0017197 View Revisions
2017-04-18 19:18 Hypnotoad Note Added: 0017200
2017-04-18 19:22 Torr Samaho Note Added: 0017201
2017-04-18 19:28 Hypnotoad Note Added: 0017202
2017-04-18 19:29 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 19:56 Hypnotoad File Added: voodoo.wad
2017-04-18 19:58 Hypnotoad Note Added: 0017204
2017-04-18 20:48 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 20:50 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 21:36 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-18 21:39 Hypnotoad Note Edited: 0017202 View Revisions
2017-04-23 10:47 Torr Samaho Note Added: 0017268
2017-04-23 11:17 Torr Samaho Note Added: 0017269
2017-04-23 14:25 Hypnotoad Note Added: 0017277
2017-04-23 15:05 Torr Samaho Note Added: 0017280
2017-04-23 16:38 Torr Samaho Note Added: 0017282
2017-04-23 16:42 Torr Samaho Note Edited: 0017282 View Revisions
2017-04-23 20:04 Hypnotoad Note Added: 0017294
2017-04-24 14:34 Fused File Added: DeadSpectatorTest.wad
2017-04-24 14:37 Fused Note Added: 0017308
2017-04-24 15:07 Fused Note Edited: 0017308 View Revisions
2017-04-25 19:59 Torr Samaho Note Added: 0017326
2017-04-26 18:28 Hypnotoad Note Added: 0017348
2017-04-27 13:43 Cutman Note Added: 0017362
2017-04-27 18:24 Fused Note Added: 0017368
2017-04-27 18:24 Fused Note Edited: 0017368 View Revisions
2017-04-27 19:42 Torr Samaho Note Added: 0017373
2017-04-28 18:36 Hypnotoad Note Added: 0017387
2017-04-29 10:29 Torr Samaho Note Added: 0017394
2017-04-29 15:02 Cutman Note Added: 0017401
2017-04-29 15:03 Cutman Note Edited: 0017401 View Revisions
2017-04-29 15:21 Torr Samaho File Added: testdeadspecbots.pk3
2017-04-29 15:21 Torr Samaho Note Added: 0017402
2017-04-29 17:06 Fused File Added: respawnbugtest.wad
2017-04-29 17:08 Fused Note Added: 0017420
2017-04-29 17:08 Fused Note Edited: 0017420 View Revisions
2017-04-29 17:11 Fused Note Edited: 0017420 View Revisions
2017-04-29 17:24 Torr Samaho Note Added: 0017422
2017-04-29 17:32 Fused Note Added: 0017424
2017-04-29 17:35 Torr Samaho Note Added: 0017425
2017-04-29 17:45 Torr Samaho Note Edited: 0017425 View Revisions
2017-04-29 18:19 Torr Samaho Note Added: 0017428
2017-05-07 10:15 Torr Samaho Note Added: 0017566
2017-05-07 12:09 Fused Note Added: 0017571
2017-05-07 12:10 Fused Note Edited: 0017571 View Revisions
2017-05-07 12:10 Fused Note Edited: 0017571 View Revisions
2017-05-07 12:51 Torr Samaho Note Added: 0017574
2017-05-07 12:51 Torr Samaho Note Edited: 0017574 View Revisions
2017-05-07 12:52 Torr Samaho Note Revision Dropped: 17574: 0010551
2017-05-07 13:48 Fused Note Added: 0017579
2017-06-22 14:46 Hypnotoad Note Added: 0017872
2017-06-22 15:42 Hypnotoad Note Added: 0017873
2017-06-22 15:43 Hypnotoad Note Edited: 0017873 View Revisions
2017-06-22 15:48 Hypnotoad Note Edited: 0017873 View Revisions
2017-06-22 15:51 Hypnotoad File Added: DeadSpectTest.wad
2017-06-22 15:55 Hypnotoad Note Edited: 0017873 View Revisions
2017-06-22 16:01 Hypnotoad Note Edited: 0017873 View Revisions
2017-06-25 12:21 Torr Samaho Note Added: 0017904
2017-06-25 13:47 Hypnotoad File Added: inventoryTest.wad
2017-06-25 13:47 Hypnotoad Note Added: 0017908
2017-06-25 14:01 Torr Samaho Note Added: 0017910
2017-06-25 14:11 Hypnotoad Note Added: 0017911
2017-06-25 14:20 Torr Samaho Note Added: 0017912
2017-06-25 14:37 Hypnotoad Note Added: 0017914
2017-06-25 14:44 Torr Samaho Note Added: 0017915
2017-06-25 15:07 Hypnotoad Note Added: 0017916
2017-06-25 16:30 Torr Samaho Note Added: 0017917
2017-06-25 18:54 Hypnotoad Note Added: 0017923
2017-06-25 18:58 Torr Samaho Note Added: 0017924
2017-06-25 19:02 Hypnotoad File Added: TIDTest.wad
2017-06-25 19:03 Hypnotoad Note Added: 0017925
2017-06-26 23:46 Hypnotoad Note Added: 0017940
2017-06-27 05:57 Torr Samaho Note Added: 0017945
2017-07-02 20:12 Hypnotoad Note Added: 0017966
2017-07-03 09:26 Fused Note Added: 0017974
2017-07-04 09:30 Fused Note Edited: 0017974 View Revisions
2017-07-09 19:54 Torr Samaho Note Added: 0017993
2017-07-10 02:37 Kaminsky Note Added: 0018000
2017-07-12 22:09 Ru5tK1ng Status needs testing => resolved
2017-07-12 22:09 Ru5tK1ng Resolution open => fixed
2017-07-12 22:09 Ru5tK1ng Product Version => 3.0-beta
2017-07-12 22:09 Ru5tK1ng Fixed in Version => 3.0
2017-11-13 22:19 Edward-san Relationship added parent of 0003339
2018-09-30 21:41 Blzut3 Status resolved => closed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker