Get game skill from zscript

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Get game skill from zscript

Postby Apeirogon » Sun Nov 17, 2019 1:46 pm

As title say.
What should I need to do to be able to check what difficulty, including custom, player select from zscript? I try change custom cvar from gameskill block in mapinfo but in dont work.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Get game skill from zscript

Postby Matt » Sun Nov 17, 2019 2:37 pm

I think it's just "skill", like "if(skill==0)damage*=0.5;" etc.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Get game skill from zscript

Postby Graf Zahl » Mon Nov 18, 2019 1:26 am

Normally skill related decisions should not be made on this but on the set skill properties. They are not necessarily done so that a higher skill is harder. What are you trying to do?
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Get game skill from zscript

Postby Apeirogon » Mon Nov 18, 2019 2:37 am

I want the monsters in my mod on higher difficulty uses special attacks, which would not be accessible for them on lower difficulty.
So I want a way to set some variables in skill definition which allow to do so.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Get game skill from zscript

Postby Graf Zahl » Mon Nov 18, 2019 3:18 am

The proper way would be to call G_SkillPropertyInt(SKILLP_ACSReturn). That gives you a virtual skill index and allows your mod to function with skill definitions that are non-standard. Directly using the skill index is not recommended.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Get game skill from zscript

Postby SanyaWaffles » Wed Nov 20, 2019 10:57 pm

I remember documenting the G_SkillPropertyInt(SKILLP_ACSReturn) early on.

It's good to see that's actually correct.
User avatar
SanyaWaffles
Navy Did Nothing Wrong
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest