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
Switch problem
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#1
Switch problem

I cant figure it out. It seems that whenever I make callback of when state changes, then it will stay forever. But I want to cancel that callback after it is used (not making it stuck)! So after it has done whatever it does, if you release it, it will go back to its own spot and next time you use it, callback won't be used again and it is as... empty lever till i reassign this Smile!

help?

The Interrogation
Chapter 1

My tutorials
(This post was last modified: 09-27-2011, 10:07 PM by Elven.)
09-27-2011, 08:56 PM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Switch problem

You can re-define the callback function without nothing in it.

09-27-2011, 09:04 PM
Website Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#3
RE: Switch problem

I see Smile. TY! I also found method - maybe it helps someone:

void lever(string &in asTimer)
{
if(GetLeverState("levername") == -1/0/1) //whatever state u want Tongue!
{
//DO ur stuff here Smile!
RemoveTimer("lever");
}
AddTimer("", 0, "lever");
}

The Interrogation
Chapter 1

My tutorials
09-27-2011, 09:15 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#4
RE: Switch problem

(09-27-2011, 09:15 PM)Elven Wrote: I see Smile. TY! I also found method - maybe it helps someone:

void lever(string &in asTimer)
{
if(GetLeverState("levername") == -1/0/1) //whatever state u want Tongue!
{
//DO ur stuff here Smile!
RemoveTimer("lever");
}
AddTimer("", 0, "lever");
}
Well that does in fact work, I would prefer this type of thing. (although all cases vary naturally)

SetEntityConnectionStateChangeCallback("Ent", "StateChangeEnt");
void StateChangeEnt(string &in asEntity, int alState)    {     if(alState == 1) (stuff) else (stuff) }

-Edit- read it wrong... but information nontheless? : D

Insanity. Static.
(This post was last modified: 09-28-2011, 01:39 AM by Juby.)
09-28-2011, 01:37 AM
Find




Users browsing this thread: 1 Guest(s)