SoDOOManiac Posted June 23, 2023 (edited) 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 June 23, 2023 by SoDOOManiac Code formatting 0 Quote Share this post Link to post
SoDOOManiac Posted June 23, 2023 Sorry, I was stupid, just found out that sys.getcvar("g_wallHide") returned string value. 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.