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


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Need help debugging various script functions
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#16
RE: Need help debugging various script functions

For starters, you'd have to start using AddGlobalVarInt (this takes negative numbers, just like AddPlayerSanity) in place of SetGlobalVarInt. You could also remove the item that gets added automatically when the player interacts with the syringe item and replace it with something like "syr_"+GetGlobalVarInt("pick"). That way you can remove it using the same syntax and can loop through the syringes (e.g. with a for loop) and check if they're in the inventory (since there's no guarantee what order the player will use the syringes). Also, you should avoid having SetGlobalVarInt("picked", 0) in OnStart or OnEnter. By default all undefined map variables will be given null-like values when accessed. Since you're using global map variables, this implies you're going to repeat this script across multiple maps, and you wouldn't want these other maps screwing with the inventory count.

Tutorials: From Noob to Pro
09-15-2013, 12:07 AM
Website Find


Messages In This Thread
RE: Need help debugging various script functions - by Your Computer - 09-15-2013, 12:07 AM



Users browsing this thread: 4 Guest(s)