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 is not automatically opening!! D=
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#1
Door is not automatically opening!! D=

So I'm making a map (obviously) and I set a script event where the player falls to the floor unconscious for a moment when he walks into an area. And when he wakes back up, the door in front of him is supposed to open by itself. But it isn't opening! can someone help me here? This is my script (minus the junk to make the player fall unconscious):

________________________
void OnStart()
{
AddEntityCollideCallback("Player", "fadeoutarea", "autoopendoor", true, 1);
}

void autoopendoor(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 2.0, "dooropensequence");
}

void dooropensequence(string &in asTimer)
{
SetSwingDoorClosed("exitdoor", false, false);
SetSwingDoorDisableAutoClose("exitdoor", true);
AddPropForce("exitdoor", 270.0, 0, 0, "world");
}
___________________________
(This post was last modified: 10-01-2011, 09:21 PM by Statyk.)
10-01-2011, 09:19 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Door is not automatically opening!! D=

try putting f after 270.0

also try different values and directions so you can tell if the prop force actually happens or not. Then just fine tune the force

10-01-2011, 09:25 PM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#3
RE: Door is not automatically opening!! D=

What i would do is rotate the door so that the closing position looks like its open or you can set the open angle (not sure how to do this) to open the door.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-01-2011, 09:27 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Door is not automatically opening!! D=

(10-01-2011, 09:25 PM)Khyrpa Wrote: try putting f after 270.0

also try different values and directions so you can tell if the prop force actually happens or not. Then just fine tune the force
I tried that. When I put an "f" after the axises, the game crashes and give me an error code saying I need to put a "(" or a "," there, but when I don't put the "f"s, the game runs fine. The door just doesn't open.


10-01-2011, 09:30 PM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#5
RE: Door is not automatically opening!! D=

I think he meant 270.0f
Wait i see the problem.

PHP Code: (Select All)
void OnStart()
 {
 
AddEntityCollideCallback("Player""fadeoutarea""autoopendoor"true1);
 }

 
void autoopendoor(string &in asParentstring &in asChildint alState)
 {
//You forgot to put an f after the time.
 
AddTimer(""2.0f"dooropensequence");
 }

 
void dooropensequence(string &in asTimer)
 {
 
SetSwingDoorClosed("exitdoor"falsefalse);
 
SetSwingDoorDisableAutoClose("exitdoor"true);
 
AddPropForce("exitdoor"270.000"world");
 } 

Rep if like me or im helpful or you love my stories!
Stephanos house
(This post was last modified: 10-01-2011, 09:33 PM by Gamemakingdude.)
10-01-2011, 09:31 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#6
RE: Door is not automatically opening!! D=

(10-01-2011, 09:31 PM)Gamemakingdude Wrote: I think he meant 270.0f
Wait i see the problem.

PHP Code: (Select All)
void OnStart()
 {
 
AddEntityCollideCallback("Player""fadeoutarea""autoopendoor"true1);
 }

 
void autoopendoor(string &in asParentstring &in asChildint alState)
 {
//You forgot to put an f after the time.
 
AddTimer(""2.0f"dooropensequence");
 }

 
void dooropensequence(string &in asTimer)
 {
 
SetSwingDoorClosed("exitdoor"falsefalse);
 
SetSwingDoorDisableAutoClose("exitdoor"true);
 
AddPropForce("exitdoor"270.000"world");
 } 
And dont forget the f after 270 ^^
AddPropForce("exitdoor", 270.0f, 0, 0, "world");

When using decimals you need to put f behind...

10-01-2011, 09:35 PM
Find
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#7
RE: Door is not automatically opening!! D=

(10-01-2011, 09:35 PM)Khyrpa Wrote:
(10-01-2011, 09:31 PM)Gamemakingdude Wrote: I think he meant 270.0f
Wait i see the problem.

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""fadeoutarea""autoopendoor"true1);
}

void autoopendoor(string &in asParentstring &in asChildint alState)
{
//You forgot to put an f after the time.
AddTimer(""2.0f"dooropensequence");
}

void dooropensequence(string &in asTimer)
{
SetSwingDoorClosed("exitdoor"falsefalse);
SetSwingDoorDisableAutoClose("exitdoor"true);
AddPropForce("exitdoor"270.000"world");

And dont forget the f after 270 ^^
AddPropForce("exitdoor", 270.0f, 0, 0, "world");

When using decimals you need to put f behind...

No you don't. I use propforce and i dont have to use .0f, you can just use 270 and it will still work.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-01-2011, 09:36 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#8
RE: Door is not automatically opening!! D=

(10-01-2011, 09:36 PM)Gamemakingdude Wrote: No you don't. I use propforce and i dont have to use .0f, you can just use 270 and it will still work.
Umm... Yes when you don't use the dot. I'm not the best one to explain anything because I don't know what the f actually does. If
270
instead of
270.0f
are different in any way. But using f without the dot causes crash and not using f when using dot could too, dis is confusing...

10-01-2011, 09:39 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#9
RE: Door is not automatically opening!! D=

(10-01-2011, 09:36 PM)Gamemakingdude Wrote: No you don't. I use propforce and i dont have to use .0f, you can just use 270 and it will still work.
exactly. I haven't put an "f" after anything and it's been working fine. the door's just having an issue. but let me try the "f" on the timer.

(10-01-2011, 09:39 PM)Khyrpa Wrote: Umm... Yes when you don't use the dot. I'm not the best one to explain anything because I don't know what the f actually does. If
270
instead of
270.0f
are different in any way. But using f without the dot causes crash and not using f when using dot could too, dis is confusing...
The "f" after decimals worked fine, but the door is still doing nothing. Urgh... This is a needed event and it's fighting back so bad =[


I found out that the "SetSwingDoorDisableAutoClose" is set to true so the door won't auto-close when it's near the doorway, but the door still auto-shuts. Is that preventing the door from opening itself?
(This post was last modified: 10-01-2011, 09:49 PM by Statyk.)
10-01-2011, 09:39 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Door is not automatically opening!! D=

(10-01-2011, 09:39 PM)Khyrpa Wrote: Umm... Yes when you don't use the dot. I'm not the best one to explain anything because I don't know what the f actually does. If
270
instead of
270.0f
are different in any way. But using f without the dot causes crash and not using f when using dot could too, dis is confusing...

The f after a decimal number (or integer) is there to tell the parser that you are specifying or passing in a float.

(10-01-2011, 09:39 PM)Statyk Wrote: I found out that the "SetSwingDoorDisableAutoClose" is set to true so the door won't auto-close when it's near the doorway, but the door still auto-shuts. Is that preventing the door from opening itself?

That wouldn't prevent the door from opening. Try having SetSwingDoorDisableAutoClose() come before SetSwingDoorClosed(). If that still doesn't work, try negative values for the prop force.

Tutorials: From Noob to Pro
10-01-2011, 10:18 PM
Website Find




Users browsing this thread: 1 Guest(s)