I need a total control over the player >:D

Discuss all aspects related to modding Zandronum here.
User avatar
Zeberpal
Forum Regular
Posts: 476
Joined: Mon Jun 04, 2012 6:55 am

I need a total control over the player >:D

#1

Post by Zeberpal » Thu Aug 14, 2014 3:10 am

So I make a mod, where I HAVE TO force players to use basic Skin and limit their free mouselook to dimensions like in software render.
Ofcourse, I want to do so only for a time they play my mod, I don't want new settings to be saved in the zandronum.ini forever. I tried to make a script for this temporary thingy:

Script 1 OPEN Clientside
{
if(GetCVar("disable_autoconfig") <= 0)
{
ConsoleCommand("set disable_autoconfig 0");
ConsoleCommand("archivecvar disable_autoconfig");
}}


Script 2 ENTER Clientside
{
if(GetCVar("disable_autoconfig") == True) Terminate;
While(1)
{
if(getcvar("cl_skins") == True) Consolecommand("cl_skins false"); //////////////////////////////////////<---This doesn't work :(
if(getcvar("cl_disallowfullpitch") == False) Consolecommand("cl_disallowfullpitch True"); //////////////<---This doesn't work :(
if(getcvar("sv_noidentifytarget") == False) Consolecommand("sv_noidentifytarget true"); ////////////<---This works :D
Delay(1);
}
Delay(1);
}
//Catastrophed


And it still save it in .ini, except where "This works"
As you can see, SV cvars do that and CL cvars don't. Is there any other way ???

P.S. I found this issue in bug tracker. Does it mean, if they add official CVar support to ACS, I will be able to accomplish my target?
Last edited by Zeberpal on Thu Aug 14, 2014 5:19 am, edited 1 time in total.
Image ImageImage

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

RE: I need a total control over the player >:D

#2

Post by Catastrophe » Thu Aug 14, 2014 3:52 am

Why is script 2 not clientsided? Also why is it not an enter script instead? Script 1 needs to be clientsided as well. Please look here: http://wiki.zandronum.com/Clientside_Scripting
Last edited by Catastrophe on Thu Aug 14, 2014 3:53 am, edited 1 time in total.

User avatar
Zeberpal
Forum Regular
Posts: 476
Joined: Mon Jun 04, 2012 6:55 am

RE: I need a total control over the player >:D

#3

Post by Zeberpal » Thu Aug 14, 2014 5:16 am

I did so Catastrophe, thanks for pointing this out. It doesn't solve my main problem obviously though.
Last edited by Zeberpal on Thu Aug 14, 2014 5:18 am, edited 1 time in total.
Image ImageImage

Absolute Zero
 
Posts: 78
Joined: Fri Feb 14, 2014 1:43 am

RE: I need a total control over the player >:D

#4

Post by Absolute Zero » Thu Aug 14, 2014 5:33 am

Make a new server-side script for sv_noidentifytarget.
IMPLEMENT WEAPON PICKUP PREDICTION 2K14! VOTE NOW! YES/YES

In fact, I hate Kelvins, and humans too, because they are carrying nearly 300 of them EVERYWHERE!

User avatar
Zeberpal
Forum Regular
Posts: 476
Joined: Mon Jun 04, 2012 6:55 am

RE: I need a total control over the player >:D

#5

Post by Zeberpal » Thu Aug 14, 2014 5:56 am

It's not connected Absolute Zero. I deleted sv_noidentifytarget line at all just to make sure. It still saves cl_dissalowfullpitch 1 and cl_skins 0 to config.
Image ImageImage

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

RE: I need a total control over the player >:D

#6

Post by ZzZombo » Thu Aug 14, 2014 9:37 am

Add +NOSKIN to the player class. No need to mess with settings.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

User avatar
Zeberpal
Forum Regular
Posts: 476
Joined: Mon Jun 04, 2012 6:55 am

RE: I need a total control over the player >:D

#7

Post by Zeberpal » Thu Aug 14, 2014 10:34 am

ZzZombo, true. Anyway, I guess i'll have to look forward for CVARINFO backport. Can't wait.
Last edited by Zeberpal on Thu Aug 14, 2014 10:40 am, edited 1 time in total.
Image ImageImage

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

RE: I need a total control over the player >:D

#8

Post by Catastrophe » Thu Aug 14, 2014 3:56 pm

Script 1 OPEN
{
if(getcvar("sv_noidentifytarget") == False) Consolecommand("sv_noidentifytarget true");
}


Script 2 ENTER Clientside
{
if(consoleplayernumber() != playernumber()) terminate;
if(GetCVar("disable_autoconfig") <= 0)
{
ConsoleCommand("set disable_autoconfig 0");
ConsoleCommand("archivecvar disable_autoconfig");
}
if(GetCVar("disable_autoconfig") == True) Terminate;
While(1)
{
if(getcvar("cl_skins") == True) Consolecommand("cl_skins false");
if(getcvar("cl_disallowfullpitch") == False) Consolecommand("cl_disallowfullpitch True");
Delay(1);
}
Delay(1);
}

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: I need a total control over the player >:D

#9

Post by Torr Samaho » Fri Aug 15, 2014 6:11 am

Note that we are planning to remove ConsoleCommand from 2.0 (CVARINFO and SetCVar were the last major things missing to replace the legit uses of ConsoleCommand), so unless you release your mod before 2.0 comes out, I recommend you not to rely on ConsoleCommand. If you need to restrict the pitch, request something like sv_disallowfullpitch at the tracker.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: I need a total control over the player >:D

#10

Post by Vincent(PDP) » Fri Aug 15, 2014 10:43 am

Torr Samaho wrote: Note that we are planning to remove ConsoleCommand from 2.0 (CVARINFO and SetCVar were the last major things missing to replace the legit uses of ConsoleCommand), so unless you release your mod before 2.0 comes out, I recommend you not to rely on ConsoleCommand. If you need to restrict the pitch, request something like sv_disallowfullpitch at the tracker.
Puking scripts though ConsoleCommand is sometimes useful for modders. :G
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: I need a total control over the player >:D

#11

Post by Hypnotoad » Fri Aug 15, 2014 11:04 am

Torr Samaho wrote: Note that we are planning to remove ConsoleCommand from 2.0 (CVARINFO and SetCVar were the last major things missing to replace the legit uses of ConsoleCommand), so unless you release your mod before 2.0 comes out, I recommend you not to rely on ConsoleCommand. If you need to restrict the pitch, request something like sv_disallowfullpitch at the tracker.
What if you want to dynamically change Zandro's built in CVARs? As far as I understand it SetCvar and CVARINFO only allows you to set and change mod specific CVARs.

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: I need a total control over the player >:D

#12

Post by Ijon Tichy » Fri Aug 15, 2014 12:06 pm

Vincent(PDP) wrote: Puking scripts though ConsoleCommand is sometimes useful for modders. :G
That got addressed too.

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: I need a total control over the player >:D

#13

Post by Torr Samaho » Fri Aug 15, 2014 5:58 pm

Hypnotoad wrote: What if you want to dynamically change Zandro's built in CVARs? As far as I understand it SetCvar and CVARINFO only allows you to set and change mod specific CVARs.
Messing with user settings was never an intended purpose of ConsoleCommand. Actually, this was abused several times by mods to the point that I almost removed ConsoleCommand without having replacements for its legitimate uses in place.

If you have a specific example of a usage case you consider legitimate that has no replacement, I'd be happy to discuss this in the tracker ticket.

User avatar
Hypnotoad
Retired Staff / Community Team Member
Posts: 528
Joined: Tue May 29, 2012 8:50 pm
Location: Britland

RE: I need a total control over the player >:D

#14

Post by Hypnotoad » Fri Aug 15, 2014 6:56 pm

Torr Samaho wrote:
Hypnotoad wrote: What if you want to dynamically change Zandro's built in CVARs? As far as I understand it SetCvar and CVARINFO only allows you to set and change mod specific CVARs.
Messing with user settings was never an intended purpose of ConsoleCommand. Actually, this was abused several times by mods to the point that I almost removed ConsoleCommand without having replacements for its legitimate uses in place.

If you have a specific example of a usage case you consider legitimate that has no replacement, I'd be happy to discuss this in the tracker ticket.
I suggested in #zatesting that a new thread be made, possibly on the forums rather than in the tracker because it will get more exposure, where we attempt to list all the legitimate uses of consolecommand() and let mod authors submit their own uses, then we use this list as a checklist of sorts to make sure we can recreate this with new 2.0 commands before releasing 2.0.

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

RE: I need a total control over the player >:D

#15

Post by ZzZombo » Sat Aug 16, 2014 8:02 am

How

Code: Select all

if(ConsolePlayerNumber()!=PlayerNumber())
is supposed to work? For each player these functions return identical values when called from a clientside script.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: I need a total control over the player >:D

#16

Post by Torr Samaho » Sat Aug 16, 2014 11:36 am

Hypnotoad wrote: I suggested in #zatesting that a new thread be made, possibly on the forums rather than in the tracker because it will get more exposure, where we attempt to list all the legitimate uses of consolecommand() and let mod authors submit their own uses, then we use this list as a checklist of sorts to make sure we can recreate this with new 2.0 commands before releasing 2.0.
Alright, I'll create such a thread when I release the next 2.0 beta build. This way people can easily check what's possible with 2.0 now.
ZzZombo wrote: How

Code: Select all

if(ConsolePlayerNumber()!=PlayerNumber())
is supposed to work? For each player these functions return identical values when called from a clientside script.
No, ConsolePlayerNumber returns a different value on each client.

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: I need a total control over the player >:D

#17

Post by Vincent(PDP) » Sat Aug 16, 2014 5:29 pm

PlayerNumber returns the player's number that activated the script. ConsolePlayerNumber returns your current player number. So if there's a server with 8 players, and player 3 activated the script but it for some reason still was executed to everybody, PlayerNumber would always return 3, while ConsolePlayerNumber would return 0 for player 1 and 1 for player 2, 2 for player 3 etc etc etc.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

RE: I need a total control over the player >:D

#18

Post by Catastrophe » Sat Aug 16, 2014 5:31 pm

ZzZombo wrote: How

Code: Select all

if(ConsolePlayerNumber()!=PlayerNumber())
is supposed to work? For each player these functions return identical values when called from a clientside script.
See http://wiki.zandronum.com/ConsolePlayerNumber

User avatar
Vincent(PDP)
Forum Regular
Posts: 527
Joined: Thu Mar 14, 2013 7:35 pm
Location: Sweden
Clan: My DOOM site
Clan Tag: <MDS>
Contact:

RE: I need a total control over the player >:D

#19

Post by Vincent(PDP) » Sat Aug 16, 2014 5:35 pm

One question, anybody that knows this... Will DISCONNECT scripts be activated when closing a Singleplayer game?
Last edited by Vincent(PDP) on Sat Aug 16, 2014 5:36 pm, edited 1 time in total.
//Visual Vincent ( Vincent (PDP) )
- My DOOM site Team

My projects:
Spoiler: (Open)
Doom Writer
Escape From The Laboratory - Done
Escape From The Laboratory Part 2
Parkskolan Zombie Horde Map (ZM10) - Done
In game Admin Commands for Zandronum.
Achievement Mod for Zandronum
Stats mod

User avatar
Dusk
Developer
Posts: 581
Joined: Thu May 24, 2012 9:59 pm
Location: Turku

RE: I need a total control over the player >:D

#20

Post by Dusk » Sat Aug 16, 2014 8:30 pm

I highly doubt it. Once you close a singleplayer game no scripts will be running anyway.

Post Reply