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
Another script with levers
WLN73 Offline
Junior Member

Posts: 10
Threads: 3
Joined: Apr 2012
Reputation: 0
#1
Big Grin  Another script with levers

Hi again .... i hope someone can give me an hand.......
I need a script to enable / disable a series of levers with a main lever ( if the MAIN lever is off the other don't work, if the lever is on .... i can use the other levers )

Thanks...... Big Grin
(This post was last modified: 04-30-2012, 07:03 AM by WLN73.)
04-30-2012, 01:06 AM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#2
RE: Another script with levers

Here ya go...

SetEntityInteractionDisabled(string& asName, bool abDisabled);
(This post was last modified: 04-30-2012, 01:22 AM by Rapture.)
04-30-2012, 01:22 AM
Find
WLN73 Offline
Junior Member

Posts: 10
Threads: 3
Joined: Apr 2012
Reputation: 0
#3
RE: Another script with levers

(04-30-2012, 01:22 AM)Rapture Wrote: Here ya go...

SetEntityInteractionDisabled(string& asName, bool abDisabled);
Thank you ... I tried but they work even if I don't use the first lever
Or i wronged something....what i have to write at "bool abDisabled" ????
I maked this:

void OnEnter()
{
SetEntityPlayerInteractCallback("switch4", "func1", true);
SetEntityPlayerInteractCallback("switch1", "func2", true);
}

void func1(string &in EntityName, int alState)
{
if( alState == -1)
SetEntityInteractionDisabled("switch1", true);
if( alState == 1)
SetEntityInteractionDisabled("switch1", false);
}

void func2(string &in EntityName, int alState)
{
if( alState == -1)
SetLampLit("lampada1", false, true);
if( alState == 1)
SetLampLit("lampada1", true, true);
}

What i wrong????? Huh
04-30-2012, 01:39 AM
Find
WLN73 Offline
Junior Member

Posts: 10
Threads: 3
Joined: Apr 2012
Reputation: 0
#4
RE: Another script with levers

...ew....i resolved half problem...im put the "Callback" and the "SetEntityInteractionDisabled" ON START void .... and now working..............BUT......and i say....but...... I have to set the lever to OFF in the game ....ew.... Instead I want is already OFF automatically when the level start ... Sad ...

Edit......

I've resolved the other half problem Big Grin
Putted this in the START:

SetLeverStuckState("switch1", -1, true);
(This post was last modified: 04-30-2012, 07:02 AM by WLN73.)
04-30-2012, 06:29 AM
Find




Users browsing this thread: 1 Guest(s)