Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Door
Author Message
flamez3 Offline
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
Post: #11
RE: Door
(11-11-2011 06:49 PM)proshitness Wrote:  didn't work
If his didn't work:


void OnStart()

{
AddEntityCollideCallback("Player", "Shut1", "CloseDoors", true, 1);
}

void CloseDoors(string &in asParent, string &in asChild, int alState)
{
AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects); // you have to edit these with the correct information
}

11-11-2011 07:00 PM
Find all posts by this user Quote this message in a reply
proshitness Offline
Junior Member

Posts: 20
Joined: Nov 2011
Reputation: 0
Post: #12
RE: Door
but what should i put in the afX afY and afZ
11-11-2011 08:31 PM
Find all posts by this user Quote this message in a reply
Statyk Offline
Modmau5

Posts: 3,600
Joined: Sep 2011
Reputation: 198
Post: #13
RE: Door
a float. a number to represent force amount. could be 0, or 300-1000. make Y zero so there's no issues. (a door doesn't open UP >> ) move the door on the map to see which direction is X or Z. then make sure if it will be a positive number or negative number, depending on the direction the door opens or closes.

(This post was last modified: 11-11-2011 08:37 PM by Statyk.)
11-11-2011 08:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
proshitness Offline
Junior Member

Posts: 20
Joined: Nov 2011
Reputation: 0
Post: #14
RE: Door
so when it opens to the Z and and closes to the X so i need to put somewhere about 600 to X?
11-11-2011 08:41 PM
Find all posts by this user Quote this message in a reply
Statyk Offline
Modmau5

Posts: 3,600
Joined: Sep 2011
Reputation: 198
Post: #15
RE: Door
(11-11-2011 08:41 PM)proshitness Wrote:  so when it opens to the Z and and closes to the X so i need to put somewhere about 600 to X?
yes, sounds about right. if it doesn't go anywhere or the wrong way, just set it to negative.

11-11-2011 08:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
proshitness Offline
Junior Member

Posts: 20
Joined: Nov 2011
Reputation: 0
Post: #16
RE: Door
Still doesn't work... =\
11-19-2011 12:50 AM
Find all posts by this user Quote this message in a reply
JenniferOrange Offline
Senior Member

Posts: 428
Joined: Jun 2011
Reputation: 33
Post: #17
RE: Door
All of the suggestions are correct. Are you sure the script areas and door names correspond? Yes, the easiest way to do it IS with SetSwingDoorClosed.

[Image: button.png]
11-19-2011 01:03 AM
Find all posts by this user Quote this message in a reply
proshitness Offline
Junior Member

Posts: 20
Joined: Nov 2011
Reputation: 0
Post: #18
RE: Door
Here please look at the code, it still isn't working...
please look at this and tell me what am i doing wrong
void OnStart(){    AddEntityCollideCallback("Player", "Light_Out", "LampsOff_func", true, 1);    AddEntityCollideCallback("Player", "Shut1", "CloseDoors", true, 1);}
void OnEnter(){}
void OnLeave(){}
void LampsOff_func(string &in asParent, string &in asChild, int alState){    if (asChild == "Light_Out")    {        SetLampLit("candlestick_wall_1", false, true);        SetLampLit("candlestick_wall_2", false, true);        SetLampLit("candlestick_wall_3", false, true);        SetLampLit("candlestick_wall_4", false, true);        SetLampLit("candlestick_wall_5", false, true);        SetLampLit("candlestick_wall_6", false, true);        PlaySoundAtEntity("", "general_wind_whirl.snt", "candlestick_wall_1", 0, false);        PlaySoundAtEntity("", "general_wind_whirl.snt", "candlestick_wall_2", 0, false);        PlaySoundAtEntity("", "general_wind_whirl.snt", "candlestick_wall_3", 0, false);        PlaySoundAtEntity("", "general_wind_whirl.snt", "candlestick_wall_4", 0, false);        PlaySoundAtEntity("", "general_wind_whirl.snt", "candlestick_wall_5", 0, false);        PlaySoundAtEntity("", "general_wind_whirl.snt", "candlestick_wall_6", 0, false);    }}
void CloseDoors(string &in asParent, bool abChild, int alState){    SetSwingDoorClosed("castle_1", true, true);    SetSwingDoorLocked("castle_1", true, true);    PlaySoundAtEntity("", "general_wind_whirl.snt", "castle_1", 0, false);}
11-20-2011 04:40 PM
Find all posts by this user Quote this message in a reply
Statyk Offline
Modmau5

Posts: 3,600
Joined: Sep 2011
Reputation: 198
Post: #19
RE: Door
Honestly, I hope you get this working because I have the SAME problem you do. My door does NOT want to open, no matter what I script (I'm almost abandoning the idea). When I script this, the door jerks like it WANTS to open, but it IMMEDIATELY shuts within one frame of a second. =\ You're not alone on this boat.

11-20-2011 05:06 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,233
Joined: Jul 2011
Reputation: 215
Post: #20
RE: Door
(11-20-2011 04:40 PM)proshitness Wrote:  Here please look at the code, it still isn't working...
please look at this and tell me what am i doing wrong

Change

PHP Code: (Select All)
void CloseDoors(string &in asParentbool abChildint alState

to

PHP Code: (Select All)
void CloseDoors(string &in asParentstring &in asChildint alState

Tutorials: From Noob to Pro
11-20-2011 06:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)