Jump to content

Please help with Doom 3 DSL


SoDOOManiac

Recommended Posts

I'm trying to patch Overthinked Doom 3, what I want to do is disable the wall/enemy/ladder awareness for the pump-action shotgun by means of DSL.

 

There's a boolean CVar in the code that I need to use in the script:

game/gamesys/SysCvar.cpp

153:idCVar g_wallHide( "g_wallHide", "1", CVAR_GAME | CVAR_BOOL, "Hide gun when approaching a wall" );

 

In zDefScript.pk4/script/weapon_shotgun.script I added:

object weapon_shotgun : weapon_base {

...

object    WeaponAwarenessConVar;

float WeaponAwarenessSetting;

...

}
void weapon_shotgun::Raise() {

WeaponAwarenessConVar = sys.getcvar("g_wallHide"); //remember the global setting to recollect when switching to other weapons

WeaponAwarenessSetting = WeaponAwarenessConVar.getFloat(); //getInt() or getBool() or getBoolean() are unknown functions
sys.setcvar("g_wallHide", "0");

...

}

and

void weapon_shotgun::Lower() {

sys.setcvar("g_wallHide", WeaponAwarenessSetting);

...

}

 

On launching the mod, for the line

WeaponAwarenessSetting = WeaponAwarenessConVar.getFloat();

I get the console error:

ERROR: Error: file script/weapon_shotgun.script, line 207: type mismatch for '='

 

How do I get the boolean value of the console variable and assign it to WeaponAwarenessSetting?

Edited by SoDOOManiac
Code formatting

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...