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
Door PropForce?
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#1
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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
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)
[Image: k6vbdhu]

Aculy iz dolan.
11-22-2012, 03:55 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#3
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
Find
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#4
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? Smile
11-26-2012, 04:33 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Door PropForce?

Show us the lines Smile

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
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#6
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 Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 11-26-2012, 05:48 PM by The chaser.)
11-26-2012, 05:47 PM
Find
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#7
RE: Door PropForce?

The chaser, you are my God Big Grin It works, thank you! Wink
11-26-2012, 06:05 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#8
RE: Door PropForce?

(11-26-2012, 06:05 PM)giacomo9 Wrote: The chaser, you are my God Big Grin It works, thank you! Wink
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 Wink

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 Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 11-26-2012, 06:46 PM by The chaser.)
11-26-2012, 06:41 PM
Find




Users browsing this thread: 2 Guest(s)