flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
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 |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
RE: Door
but what should i put in the afX afY and afZ
|
|
11-11-2011, 08:31 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
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 |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
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 |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
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 |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
RE: Door
Still doesn't work... =\
|
|
11-19-2011, 12:50 AM |
|
JenniferOrange
Senior Member
Posts: 424
Threads: 43
Joined: Jun 2011
Reputation:
33
|
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 |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
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 |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
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 |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
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
void CloseDoors(string &in asParent, bool abChild, int alState)
to
void CloseDoors(string &in asParent, string &in asChild, int alState)
|
|
11-20-2011, 06:49 PM |
|
|