giacomo9
Junior Member
Posts: 37
Threads: 11
Joined: Nov 2012
Reputation:
0
|
Door PropForce?
I know there's a script to self opening doors, but I want to do this:
1)The player enters the area - the door closes behind him (not be able to open them)
2)When a player raises something, doors open by themselves.
That's PropForce, right? But how to make the door shut on their own, then blocked? And After that unlocked and opened?
|
|
11-22-2012, 03:07 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Door PropForce?
(11-22-2012, 03:07 PM)giacomo9 Wrote: I know there's a script to self opening doors, but I want to do this:
1)The player enters the area - the door closes behind him (not be able to open them)
2)When a player raises something, doors open by themselves.
That's PropForce, right? But how to make the door shut on their own, then blocked? And After that unlocked and opened? 1:
AddEntityCollideCallback("Player", "Area_close", "Close", true, 1);
void Close (string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Nameofdoor", true);
AddTimer("", 0.1, "Lock");
}
void Lock (string &in asTimer)
{
SetSwingDoorLocked("Nameofdoor", true);
}
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
11-22-2012, 03:55 PM |
|
Tomato Cat
Senior Member
Posts: 287
Threads: 2
Joined: Sep 2012
Reputation:
20
|
RE: Door PropForce?
*edit* Yeah, like what chaser said. ^
If by close you mean slammed, then yeah, addpropforce and setswingdoorlocked would work for the first one.
I'm assuming by "raise" you mean like a lever? For that, I would play around with switch/if statements, local variables, and the setswingdoorclosed function.
To unlock and reopen the doors, you would have to call another function. Or use variables and switch/if statements.
RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 11-22-2012, 04:02 PM by Tomato Cat.)
|
|
11-22-2012, 04:02 PM |
|
giacomo9
Junior Member
Posts: 37
Threads: 11
Joined: Nov 2012
Reputation:
0
|
RE: Door PropForce?
The Chaser, I've got problem with your script (1):
main (280,1): ERR: No matching signatures to
'SetSwingDoorClosed(string@&, const bool)'
main (286,1): ERR: No matching signatures to
'SetSwingDoorLocked(string@&, const bool)'
What should I do?
|
|
11-26-2012, 04:33 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Door PropForce?
Show us the lines
string = Some letters inside these: ""
bool = true or false, not inside these ""
Trying is the first step to success.
|
|
11-26-2012, 05:47 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Door PropForce?
AddEntityCollideCallback("Player", "Area_close", "Close", true, 1);
void Close (string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Nameofdoor", true, bool abEffects); ///I don't know what is bool abEffects, but setting false (it's a bool) should work.
AddTimer("", 0.1, "Lock");
}
void Lock (string &in asTimer)
{
SetSwingDoorLocked("Nameofdoor", true, bool abEffects);
}
Ok, fixed it
THE OTHERWORLD (WIP)
Aculy iz dolan.
(This post was last modified: 11-26-2012, 05:48 PM by The chaser.)
|
|
11-26-2012, 05:47 PM |
|
giacomo9
Junior Member
Posts: 37
Threads: 11
Joined: Nov 2012
Reputation:
0
|
RE: Door PropForce?
The chaser, you are my God It works, thank you!
|
|
11-26-2012, 06:05 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Door PropForce?
(11-26-2012, 06:05 PM)giacomo9 Wrote: The chaser, you are my God It works, thank you! I'm not a god, I'm Dolan, and I think I'm more interesting this way ^^
I just help people, so if you need help I'll try to be there
If for 2 you mean grabbing an entity (like a box) you can:
void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity)
asName - internal name
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity
Directly extracted from the wiki
THE OTHERWORLD (WIP)
Aculy iz dolan.
(This post was last modified: 11-26-2012, 06:46 PM by The chaser.)
|
|
11-26-2012, 06:41 PM |
|
|