Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Not Working D:
Homicide13 Offline
Senior Member

Posts: 323
Threads: 41
Joined: Nov 2010
Reputation: 14
#3
RE: Script Not Working D:

(11-12-2010, 01:31 PM)Arvaga Wrote: Now I see you use AddLocalVarInt to add the values, but you are using GetGlobalVarInt, my guess is that it should be GetLocal and that you have to set the variable with SetLocalVar before using it.

Nur, that last section of code was a mistake on my part. That was a copy/paste from when I was using global variables instead of local variables but switched it to local variables because that made more sense (and also because the global variables weren't working and I figured that the local variables might). If you look in the original code at the top, it does use the GetLocalVarInt() function. I have also tried adding SetLocalVariableInt("NumBodyParts",0) in the "Run first time starting map" section, but it didn't make a difference and none of the examples I have seen in the amnesia game code use this. Also the example here does not require this.

Humm, Problem solved... for some reason
if(GetLocalVarInt("NumBodyParts") == 3)
needed to be changed to
if(GetLocalVarInt("NumBodyParts") == 2)
I don't really understand this.... but it works now. :/

Edit again:
Duh, I know why. Because the if function is checking to see if there are 3 body parts in the grill BEFORE it's adding the third value to the function so... ok. It all makes sense now. Big Grin

(This post was last modified: 11-12-2010, 04:40 PM by Homicide13.)
11-12-2010, 04:19 PM
Find


Messages In This Thread
Script Not Working D: - by Homicide13 - 11-12-2010, 04:29 AM
RE: Script Not Working D: - by Arvaga - 11-12-2010, 01:31 PM
RE: Script Not Working D: - by Homicide13 - 11-12-2010, 04:19 PM



Users browsing this thread: 1 Guest(s)