Home   Help Search Login Register  

Author Topic: odd declaration of string variable  (Read 497 times)

0 Members and 1 Guest are viewing this topic.

voodzia

  • Guest
odd declaration of string variable
« on: 31 May 2005, 11:25:41 »
Hello,
I was browsing some a bit complex script and in one place I noticed very odd line:

Code: [Select]
_nstring = "scalar bool array string 0xfcffffef"I've never seen anything like that before - I mean such strange type of string variable.
Can anyone tell me what it's all about?
Thank you in advance for help.
Regards,
voodzia

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:odd declaration of string variable
« Reply #1 on: 31 May 2005, 11:41:34 »
That string is the generic error message you get when the game encounters something it doesn't understand, such as an undefined variable with which it cannot cope.
Plenty of reviewed ArmA missions for you to play

voodzia

  • Guest
Re:odd declaration of string variable
« Reply #2 on: 31 May 2005, 15:31:14 »
OK - I got it but could you tell me if this error message is exactly the same all the time? I mean no matter what kind of problem game engine encounters this string has always the same value as in this example? Or in other words - is that string a kind of constant in OFP?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:odd declaration of string variable
« Reply #3 on: 31 May 2005, 15:35:53 »
It's just an error message, it has no more significance than that.   There are other error messages of course, this is just one of the most annoying.

I think if you did

hint format ["%1", var1]

you would get it, providing of course that var1 does not exist.

Why somebody would set a local variable to that value I cannot imagine.   It sounds like the sort of thing you would do when you need some kind of random string, and you've been getting that error a lot.
Plenty of reviewed ArmA missions for you to play

voodzia

  • Guest
Re:odd declaration of string variable
« Reply #4 on: 31 May 2005, 16:21:38 »
So it looks like to me that this error message must be exactly the same whenever you try to refer to none existing variable. Here're two examples of using this strange string in the same script as mentioned above:

Code: [Select]
?(format ["%1",hitEffects] == _nstring): hiteffects = true

?(format ["%1",bloodloss] == _nstring): bloodloss = false
I'm not sure but I guess someone has a strong belief that this string ain't random. But please macguba correct me if I'm wrong about that.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:odd declaration of string variable
« Reply #5 on: 31 May 2005, 16:38:07 »
The script is checking to see if the variables exist or not.  If they don't, the format command will return that string, I presume.

I take back part of what I said.  It's not an error message at all, it's an error that appears in place of what should appear.   If you try my hint format you'll see what I mean.

It's not a random thing, it's hardcoded into the game.
Plenty of reviewed ArmA missions for you to play