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 Help with door script
CrushedRaiD Offline
Member

Posts: 115
Threads: 10
Joined: Dec 2010
Reputation: 0
#7
RE: Help with door script

(01-17-2012, 08:43 PM)SilentStriker Wrote: Do you want to door locked? Smile
Yes, and later i need to open it with a key Big Grin
(01-17-2012, 08:56 PM)Juby Wrote: We all go through that learning process, one day it will click to you and become easy.

Okay, make an script area (a.k.a the 3-D cube on the left toolbar or hotkey 8). Basically, when you touch this area, the event will play, but to do that you need to first name your area whatever you feel like, I'll just name it Cupcakes for now, then add this to your .hps file in the OnStart function:

AddEntityCollideCallback("Player", "Cupcakes", "CupcakeEvent", true, 1);

Then add this outside of the OnStart:


void CupcakeEvent(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("DOORNAME", 0, 0, 0, "world");
for(int x = 1; x <= 5; x++) SetLampLit("LightName_"+x, false, false);
}

You're going to need to edit these if you want them to work. For the impulse command, the three zeros are actually the coordinates X, Y, Z in that order to "impulse" the prop (the door). First, find what direction you need to push your door, in the editor, the red line is X, the green is Y, and the blue is Z. Change one of the zeros to 100 to push the door that certain way. Also change "DOORNAME" to the name of the door you want to close Wink

The second line there will turn off all the candles from the names "LightName_1" to "LightName_5". x <= 5 determines this, change that to x <= 8 if you need to turn of 8 lights, etc..

I hope I explained that well enough.
Thx Smile I really want to learn but i think that i wont be scripting as well as others in many years Big GrinDD
(This post was last modified: 01-18-2012, 12:57 PM by CrushedRaiD.)
01-18-2012, 12:55 PM
Find


Messages In This Thread
Help with door script - by CrushedRaiD - 01-17-2012, 08:38 PM
RE: Help with door script - by SilentStriker - 01-17-2012, 08:43 PM
RE: Help with door script - by CrushedRaiD - 01-18-2012, 12:55 PM
RE: Help with door script - by Juby - 01-17-2012, 08:56 PM
RE: Help with door script - by Shadowfied - 01-17-2012, 10:04 PM
RE: Help with door script - by Tripication - 01-18-2012, 04:08 AM
RE: Help with door script - by Juby - 01-18-2012, 04:49 AM



Users browsing this thread: 1 Guest(s)