Aller au contenu

Photo

Constant variable override


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
OneBadAssMother

OneBadAssMother
  • Members
  • 1 086 messages
I'm just curious if anyone has any idea how to redefine a core script constant variable using a seperate NCS module script.

The constant in question I'm trying to change is in combat_h - a header file, and hence editing it won't allow me to compile the script except by re-compiling a HUGE bunch of scripts. Is it possible to make a script that OVERRIDES the variable on the core script?

So far my script looks like this:

#include "combat_h"

const float SPECIAL_BOSS_DEATHBLOW_THRESHOLD = 0.10;        // at this % of health, any meelee attack may trigger the deathblow of special bosses;

void main()
{
}


In combat_h the variable value is 0.04

When trying to compile my module script the error is "duplicate constant declaration". I'm hoping there is a way for my script to OVERRIDE the constant declaration of combat_h.

Please help, any reply would help - even a 'no its not possible' reply would help =(

#2
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
You can't override a variable declaration. Your options are either change the value of the original declaration, or figure out where the variable is used and change it there.


#3
OneBadAssMother

OneBadAssMother
  • Members
  • 1 086 messages
Hmmm, which means changing the header file is the only option (variable is only in that script)



Thanks for replying FalloutBoy, now I can move to plan B =)