How to manually score (non-team) or end the level?
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
How to manually score (non-team) or end the level?
There are scoring functions for team-based modes but I can't find anything regarding player score modifying (via Decorate/ACS). ScoreItem does not appear to work, nor does Team_Score do anything on said gamemodes.
I feel I'm missing something really obvious... or should be, since score is such a trivial thing and can be fully controlled via ACS on team games. Does anyone know a way?
I can get around this if there's a way to end/exit the current level that is not a classic exit function (those appear to do nothing if sv_noexit is true, even if called from a script). Of course, ConsoleCommand("nextmap") would do the trick but I'd rather not use that unless it's my last option...
I feel I'm missing something really obvious... or should be, since score is such a trivial thing and can be fully controlled via ACS on team games. Does anyone know a way?
I can get around this if there's a way to end/exit the current level that is not a classic exit function (those appear to do nothing if sv_noexit is true, even if called from a script). Of course, ConsoleCommand("nextmap") would do the trick but I'd rather not use that unless it's my last option...
- ZZYZX
- Posts a lot
- Posts: 742
- Joined: Thu Jun 07, 2012 5:56 pm
- Location: Ukraine
- Clan: A3
- Clan Tag: [A3]
Re: How to manually score (non-team) or end the level?
http://zdoom.org/wiki/Score
P.S. you can also exit with sv_noexit if you reset activator to world, according to this function in ZDoom source code:It can be manipulated from ACS with APROP_Score
Code: Select all
// [RH] Check dmflags for noexit and respond accordingly
bool CheckIfExitIsGood (AActor *self, level_info_t *info)
{
cluster_info_t *cluster;
// The world can always exit itself.
if (self == NULL) // <----------------------------------------------------------
return true;
// We must kill all monsters to exit the level.
if ((dmflags2 & DF2_KILL_MONSTERS) && level.killed_monsters != level.total_monsters)
return false;
// Is this a deathmatch game and we're not allowed to exit?
if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT))
{
P_DamageMobj (self, self, self, TELEFRAG_DAMAGE, NAME_Exit);
return false;
}
// Is this a singleplayer game and the next map is part of the same hub and we're dead?
if (self->health <= 0 &&
!multiplayer &&
info != NULL &&
info->cluster == level.cluster &&
(cluster = FindClusterInfo(level.cluster)) != NULL &&
cluster->flags & CLUSTER_HUB)
{
return false;
}
if (deathmatch)
{
Printf ("%s exited the level.\n", self->player->userinfo.GetName());
}
return true;
}
quality DoomExplorer hackeringFilystyn wrote:Do you know what windows.h is? It's D, DWORD.
overcomplicated ZDoom grenade
random Doom things
GZDoomBuilder-Bugfix
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: How to manually score (non-team) or end the level?
Changing the score property does not affect the player's score on Zandronum's point-based gamemodes, I tested that as well as ScoreItem. It seems the score property and player score in Zandronum are completely unrelated.
You're right, though, I should've suspected sv_noexit would only affect players. That takes care of a lot of things. Thank you!
You're right, though, I should've suspected sv_noexit would only affect players. That takes care of a lot of things. Thank you!
- doomista
- Forum Regular
- Posts: 147
- Joined: Sat Mar 07, 2015 6:58 pm
- Location: I've been to hell. Twice
Re: How to manually score (non-team) or end the level?
It does, indeed. But what about non-team game? I cannot adjust player score directly, so I have to use a variable (or a dummy item, it doesn't matter since it is not displayed in the hud). But when I use Exit_Normal(0) then how can I alter intermission scoreboard screen to display my custom points? I know how for example ZanXP does that (in OPEN script with HudMessageBold) but that is not applicable since the execution of all scripts is terminated after calling Exit_Normal and intermission screen itself somehow does not start a new OPEN script (I wonder how it is even possible to alter it with the open script. I would expect from "pointlimit hit" event to terminate the open script and call unloading and then terminating it too and switching to intermission).SwordGrunt wrote:Changing the score property does not affect the player's score on Zandronum's point-based gamemodes, I tested that as well as ScoreItem. It seems the score property and player score in Zandronum are completely unrelated.
You're right, though, I should've suspected sv_noexit would only affect players. That takes care of a lot of things. Thank you!
-
- Retired Staff / Community Team Member
- Posts: 2569
- Joined: Sat Jun 02, 2012 2:44 am
Re: How to manually score (non-team) or end the level?
Friendly reminder that these tickets exist and you should support them:
http://zandronum.com/tracker/view.php?id=2046
http://zandronum.com/tracker/view.php?id=2575
If these get added, everything you guys are saying on this thread can be done.
http://zandronum.com/tracker/view.php?id=2046
http://zandronum.com/tracker/view.php?id=2575
If these get added, everything you guys are saying on this thread can be done.
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: How to manually score (non-team) or end the level?
Your best bet is to customize your own score display and intermission picture before actually ending the level (a la Shotgun Frenzy).doomista wrote:It does, indeed. But what about non-team game? I cannot adjust player score directly, so I have to use a variable (or a dummy item, it doesn't matter since it is not displayed in the hud). But when I use Exit_Normal(0) then how can I alter intermission scoreboard screen to display my custom points? I know how for example ZanXP does that (in OPEN script with HudMessageBold) but that is not applicable since the execution of all scripts is terminated after calling Exit_Normal and intermission screen itself somehow does not start a new OPEN script (I wonder how it is even possible to alter it with the open script. I would expect from "pointlimit hit" event to terminate the open script and call unloading and then terminating it too and switching to intermission).SwordGrunt wrote:Changing the score property does not affect the player's score on Zandronum's point-based gamemodes, I tested that as well as ScoreItem. It seems the score property and player score in Zandronum are completely unrelated.
You're right, though, I should've suspected sv_noexit would only affect players. That takes care of a lot of things. Thank you!
- doomista
- Forum Regular
- Posts: 147
- Joined: Sat Mar 07, 2015 6:58 pm
- Location: I've been to hell. Twice
Re: How to manually score (non-team) or end the level?
Some tickets regarding having the same account on tracker and forum would be nice too...Catastrophe wrote:Friendly reminder that these tickets exist and you should support them:
http://zandronum.com/tracker/view.php?id=2046
http://zandronum.com/tracker/view.php?id=2575
If these get added, everything you guys are saying on this thread can be done.
- doomista
- Forum Regular
- Posts: 147
- Joined: Sat Mar 07, 2015 6:58 pm
- Location: I've been to hell. Twice
Re: How to manually score (non-team) or end the level?
Never played it and official download link seems to be down... But i guess you meant stuff from this picture [spoiler]SwordGrunt wrote: Your best bet is to customize your own score display and intermission picture before actually ending the level (a la Shotgun Frenzy).

Pros & Cons:
+ Players can play and see the scores at the same time. This way they will not get bored even if the scores are displayed for 10s
+ I can display scores before each round
- When somebody wins, there will be 10s long scoreboard (but players can still play) and then the game jumps to another intermission screen with totally inadequate results
- HUD mania. For the lower resolutions, the screen will get overpopulated by numbers and letters (but only during the countdowns)
The last problem, the messy HUD is not that much of an issue, though. Even four years old netbooks can run doom and namely this mod with slopes and 3D floors in a decent resolution of 1024x768, not to mention that cheapest today's computers should be able to run the game at HD resolution (but they should have a Windows and a 4GB ram).
But I guess there is no such thing as Exit_Silent which would act in the same manner as the silent teleport, only between levels with no intermission screen

- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: How to manually score (non-team) or end the level?
No I did not mean that, it displays a picture at round end with a victory or defeat message and some stats of the level if I recall correctly.
You can set players as invulnerable and totally frozen upon round end just like Zandronum usually does to avoid an inconsistent score on the intermission, and you can use the forcescaled property so the HUD always has the same resolution reagrdless of the user's own.
You can set players as invulnerable and totally frozen upon round end just like Zandronum usually does to avoid an inconsistent score on the intermission, and you can use the forcescaled property so the HUD always has the same resolution reagrdless of the user's own.
- doomista
- Forum Regular
- Posts: 147
- Joined: Sat Mar 07, 2015 6:58 pm
- Location: I've been to hell. Twice
Re: How to manually score (non-team) or end the level?
Yeah, but how to skip the real intermission screen? I cannot find any practical cvar for this purpose.SwordGrunt wrote:No I did not mean that, it displays a picture at round end with a victory or defeat message and some stats of the level if I recall correctly.
You can set players as invulnerable and totally frozen upon round end just like Zandronum usually does to avoid an inconsistent score on the intermission, and you can use the forcescaled property so the HUD always has the same resolution reagrdless of the user's own.
Btw: How can I get a player name from a script in a multiplayer? GetCVarString("name") gives me the name of the player who runs the server. GetUserCvarString(PlayerNumber(), "name") gives me the string "prog1" regardless of the connected player (I am calling this from ENTER).
-
- Retired Staff / Community Team Member
- Posts: 2569
- Joined: Sat Jun 02, 2012 2:44 am
Re: How to manually score (non-team) or end the level?
use strparamdoomista wrote:Yeah, but how to skip the real intermission screen? I cannot find any practical cvar for this purpose.SwordGrunt wrote:No I did not mean that, it displays a picture at round end with a victory or defeat message and some stats of the level if I recall correctly.
You can set players as invulnerable and totally frozen upon round end just like Zandronum usually does to avoid an inconsistent score on the intermission, and you can use the forcescaled property so the HUD always has the same resolution reagrdless of the user's own.
Btw: How can I get a player name from a script in a multiplayer? GetCVarString("name") gives me the name of the player who runs the server. GetUserCvarString(PlayerNumber(), "name") gives me the string "prog1" regardless of the connected player (I am calling this from ENTER).
- doomista
- Forum Regular
- Posts: 147
- Joined: Sat Mar 07, 2015 6:58 pm
- Location: I've been to hell. Twice
Re: How to manually score (non-team) or end the level?
I cannot see how it's supposed to help. But I just found out that not one but two different approaches to the subject work in Zan3.0, so it might be just a problem of 2.1.2. At the other hand, SetActorProperty(0, APROP_Health, 100); does not work in Zan3.0, so it's a lose-lose situation.Catastrophe wrote:use strparamdoomista wrote:Yeah, but how to skip the real intermission screen? I cannot find any practical cvar for this purpose.SwordGrunt wrote:No I did not mean that, it displays a picture at round end with a victory or defeat message and some stats of the level if I recall correctly.
You can set players as invulnerable and totally frozen upon round end just like Zandronum usually does to avoid an inconsistent score on the intermission, and you can use the forcescaled property so the HUD always has the same resolution reagrdless of the user's own.
Btw: How can I get a player name from a script in a multiplayer? GetCVarString("name") gives me the name of the player who runs the server. GetUserCvarString(PlayerNumber(), "name") gives me the string "prog1" regardless of the connected player (I am calling this from ENTER).
EDIT: It's not APROP_Health, it's the custom projectile with Damage (50). It always does only half of the damage. Last time I was trying reproduce this bug I failed, I'll maybe have more luck this time.
-
- Retired Staff / Community Team Member
- Posts: 2569
- Joined: Sat Jun 02, 2012 2:44 am
Re: How to manually score (non-team) or end the level?
int name = strParam(n:playernumber()+1);doomista wrote:I cannot see how it's supposed to help. But I just found out that not one but two different approaches to the subject work in Zan3.0, so it might be just a problem of 2.1.2. At the other hand, SetActorProperty(0, APROP_Health, 100); does not work in Zan3.0, so it's a lose-lose situation.Catastrophe wrote:use strparamdoomista wrote:Yeah, but how to skip the real intermission screen? I cannot find any practical cvar for this purpose.SwordGrunt wrote:No I did not mean that, it displays a picture at round end with a victory or defeat message and some stats of the level if I recall correctly.
You can set players as invulnerable and totally frozen upon round end just like Zandronum usually does to avoid an inconsistent score on the intermission, and you can use the forcescaled property so the HUD always has the same resolution reagrdless of the user's own.
Btw: How can I get a player name from a script in a multiplayer? GetCVarString("name") gives me the name of the player who runs the server. GetUserCvarString(PlayerNumber(), "name") gives me the string "prog1" regardless of the connected player (I am calling this from ENTER).
EDIT: It's not APROP_Health, it's the custom projectile with Damage (50). It always does only half of the damage. Last time I was trying reproduce this bug I failed, I'll maybe have more luck this time.
Keep in mind strparam has its limits and it can't be used outside of the same tic it was made unless you are playing this on the latest dev-build, which in that case it lasts forever.
- doomista
- Forum Regular
- Posts: 147
- Joined: Sat Mar 07, 2015 6:58 pm
- Location: I've been to hell. Twice
Re: How to manually score (non-team) or end the level?
Oh, the "n" cast type! Apparently I didn't do my homework when I completely disregarded the documentation page of print. I would never expect to have this kind of functionality implemented here. Thanks, I'll try to finish the job with this.Catastrophe wrote: int name = strParam(n:playernumber()+1);
Keep in mind strparam has its limits and it can't be used outside of the same tic it was made unless you are playing this on the latest dev-build, which in that case it lasts forever.
-
- Retired Staff / Community Team Member
- Posts: 2569
- Joined: Sat Jun 02, 2012 2:44 am
Re: How to manually score (non-team) or end the level?
No prob, if you find strange anomalies that only happen online, please report it on the tracker.doomista wrote:Oh, the "n" cast type! Apparently I didn't do my homework when I completely disregarded the documentation page of print. I would never expect to have this kind of functionality implemented here. Thanks, I'll try to finish the job with this.Catastrophe wrote: int name = strParam(n:playernumber()+1);
Keep in mind strparam has its limits and it can't be used outside of the same tic it was made unless you are playing this on the latest dev-build, which in that case it lasts forever.
- doomista
- Forum Regular
- Posts: 147
- Joined: Sat Mar 07, 2015 6:58 pm
- Location: I've been to hell. Twice
Re: How to manually score (non-team) or end the level?
I already did, but it turned out I just didn't know about the relation of skill and damage reduction even in MP.Catastrophe wrote:No prob, if you find strange anomalies that only happen online, please report it on the tracker.doomista wrote:Oh, the "n" cast type! Apparently I didn't do my homework when I completely disregarded the documentation page of print. I would never expect to have this kind of functionality implemented here. Thanks, I'll try to finish the job with this.Catastrophe wrote: int name = strParam(n:playernumber()+1);
Keep in mind strparam has its limits and it can't be used outside of the same tic it was made unless you are playing this on the latest dev-build, which in that case it lasts forever.