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 Help Need help with several scripts.
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#9
RE: Need help with several scripts.

use a global/local variable(depends on where you use the item)that is normally 0 and 1 when that item has been picked up, and initiate the callback only if that variable is 0.
Example:
void OnStart()
{
SetGlobalVarInt("CallbackVariable1", 0);
}
void UsedKeyOnDoor(syntax stuff)
{
SetGlobalVarInt("CallbackVariable1", 1);

}
void DisplayText(string &in asEntity)
{
if(GetGlobalVarInt("CallbackVariable1")==0)
{
SetMessage("Locked", "Basement", 0);
}
}
It should also work if you set the if for the callback itself, not the called function
(This post was last modified: 06-26-2012, 11:08 PM by Cruzore.)
06-26-2012, 11:04 PM
Find


Messages In This Thread
Need help with several scripts. - by Randael - 06-22-2012, 11:28 PM
RE: Need help with several scripts. - by Randael - 06-23-2012, 03:05 PM
RE: Need help with several scripts. - by Randael - 06-23-2012, 06:09 PM
RE: Need help with several scripts. - by Randael - 06-26-2012, 09:19 PM
RE: Need help with several scripts. - by Cruzore - 06-26-2012, 09:54 PM
RE: Need help with several scripts. - by Randael - 06-26-2012, 10:04 PM
RE: Need help with several scripts. - by Cruzore - 06-26-2012, 11:04 PM
RE: Need help with several scripts. - by Randael - 06-26-2012, 11:31 PM
RE: Need help with several scripts. - by Cruzore - 06-27-2012, 12:46 PM
RE: Need help with several scripts. - by Cruzore - 06-28-2012, 12:15 AM
RE: Need help with several scripts. - by Randael - 06-28-2012, 09:43 AM



Users browsing this thread: 1 Guest(s)