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 Door
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#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
proshitness Offline
Junior Member

Posts: 20
Threads: 3
Joined: Nov 2011
Reputation: 0
#12
RE: Door

but what should i put in the afX afY and afZ
11-11-2011, 08:31 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#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
Find
proshitness Offline
Junior Member

Posts: 20
Threads: 3
Joined: Nov 2011
Reputation: 0
#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
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#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
Find
proshitness Offline
Junior Member

Posts: 20
Threads: 3
Joined: Nov 2011
Reputation: 0
#16
RE: Door

Still doesn't work... =\
11-19-2011, 12:50 AM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#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.

Ba-da bing, ba-da boom.
11-19-2011, 01:03 AM
Find
proshitness Offline
Junior Member

Posts: 20
Threads: 3
Joined: Nov 2011
Reputation: 0
#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
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#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
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find




Users browsing this thread: 3 Guest(s)