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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] How to unlock door with a Wheel ?
olrik666 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Oct 2014
Reputation: 0
#1
[Solved] How to unlock door with a Wheel ?

hi guys, I want to know which script to use in order to open a leveldoor with a valve.

I can't find it. Undecided


Thanks Smile

(This post was last modified: 10-25-2014, 05:49 PM by olrik666.)
10-24-2014, 07:44 PM
Website Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#2
RE: How to unlock door with a Wheel ?

Hello olrik666

I guess you can find help in here:

https://wiki.frictionalgames.com/doku.ph...nd_buttons

10-24-2014, 07:48 PM
Find
olrik666 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Oct 2014
Reputation: 0
#3
RE: How to unlock door with a Wheel ?

I don't understand :/



My script :

void OnStart()
{
PreloadSound("17_steam.snt");
PreloadSound("unlock_door.snt");
SetLocalVarInt("Valve_iron1", 0);
}

void OnLeave()

{
SetupLoadScreen("Loading", "LoadScreen1", 0, "LoadScreenImage1.png");
}
/////////Interact

void unlockdoor(string &in asEntity, int alState)

{

if(alState == 1)

{
SetLevelDoorLocked("door_complex1", false);
PlaySoundAtEntity("", "unlock_door.snt", "door_complex1", 0, false);
PlaySoundAtEntity("", "17_steam.snt", "barrier", 0, false);

}


}

(This post was last modified: 10-24-2014, 08:49 PM by olrik666.)
10-24-2014, 08:39 PM
Website Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: How to unlock door with a Wheel ?

Try adding this in OnStart
PHP Code: (Select All)
SetEntityConnectionStateChangeCallback("NameofyourwheelintheLeveleditor""unlockdoor"); 

(This post was last modified: 10-25-2014, 12:43 PM by DnALANGE.)
10-25-2014, 12:40 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#5
RE: How to unlock door with a Wheel ?

As DnALANGE said add that code on "void OnStart()"

so it should looks like

Spoiler below!
PHP Code: (Select All)
void OnStart()
{
SetEntityConnectionStateChangeCallback("NameofyourwheelintheLeveleditor""unlockdoor"); 
PreloadSound("17_steam.snt");
PreloadSound("unlock_door.snt");
SetLocalVarInt("Valve_iron1"0);
}

void OnLeave()

{
SetupLoadScreen("Loading""LoadScreen1"0"LoadScreenImage1.png");
}
/////////Interact

void unlockdoor(string &in asEntityint alState)

{

if(
alState == 1)

{
SetLevelDoorLocked("door_complex1"false);
PlaySoundAtEntity("""unlock_door.snt""door_complex1"0false);
PlaySoundAtEntity("""17_steam.snt""barrier"0false);

}





And try using the spoiler it saves a lot of place in thread :P

like:[.spoiler]text[./spoiler] (without the dot) :D

(This post was last modified: 10-25-2014, 01:06 PM by Straxedix.)
10-25-2014, 01:03 PM
Find
burge4150 Offline
Member

Posts: 56
Threads: 15
Joined: Feb 2014
Reputation: 0
#6
RE: How to unlock door with a Wheel ?

I'm just here to reaffirm:

SetEntityConnectionStateChangeCallback("string entity name", "function name");

Whenever a valve changes state (from all the way off to all the way on, etc) it will trigger this function. I would remove the callback or put a check in the function to make sure it can't be repeated because that'll cause issues.
10-25-2014, 02:31 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#7
RE: How to unlock door with a Wheel ?

Then this guy should fix this issue by doing this function IN the script itself ;
PHP Code: (Select All)
SetWheelStuckState("YOURWheelName"1true); 
This will STUCK it''s state in
Quote:
PHP Code: (Select All)

or
Quote:
PHP Code: (Select All)
-
-
Burge4150, next time if you have an argument, please add the solution as well.
(This post was last modified: 10-25-2014, 05:33 PM by DnALANGE.)
10-25-2014, 04:09 PM
Find
olrik666 Offline
Junior Member

Posts: 7
Threads: 2
Joined: Oct 2014
Reputation: 0
#8
RE: How to unlock door with a Wheel ?

Thanks you all guys Wink it's work fine Smile

10-25-2014, 05:11 PM
Website Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#9
RE: How to unlock door with a Wheel ?

(10-25-2014, 05:11 PM)olrik666 Wrote: Thanks you all guys Wink it's work fine Smile

+Rep for me Tongue
You can give people kudo's \ reputatuion points for fun.
Only if you want to offcourse..
You dont have to do that now.
Just IF you want you can press on players name and REP + a small tekst for it.
For any other issues. be free to post them.
HINT; IF you have anything solved, please add SOLVED on your theeadh page.
So people do not have to go look into your "solved threadh"
10-25-2014, 05:32 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#10
RE: [Solved] How to unlock door with a Wheel ?

Glad i helped :P

10-25-2014, 06:40 PM
Find




Users browsing this thread: 1 Guest(s)