Frictional Games Forum (read-only)

Full Version: Door
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(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
}
but what should i put in the afX afY and afZ
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.
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)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.
Still doesn't work... =\
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.
Here please look at the code, it still isn't working...
please look at this and tell me what am i doing wrong
Code:
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);}
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, 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:
void CloseDoors(string &in asParentbool abChildint alState

to

PHP Code:
void CloseDoors(string &in asParentstring &in asChildint alState
Pages: 1 2 3