Frictional Games Forum (read-only)
Door is not automatically opening!! D= - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Door is not automatically opening!! D= (/thread-10550.html)

Pages: 1 2


Door is not automatically opening!! D= - Statyk - 10-01-2011

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");
}
___________________________



RE: Door is not automatically opening!! D= - Khyrpa - 10-01-2011

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



RE: Door is not automatically opening!! D= - Gamemakingdude - 10-01-2011

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.


RE: Door is not automatically opening!! D= - Statyk - 10-01-2011

(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.





RE: Door is not automatically opening!! D= - Gamemakingdude - 10-01-2011

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

PHP Code:
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");
 } 



RE: Door is not automatically opening!! D= - Khyrpa - 10-01-2011

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

PHP Code:
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...



RE: Door is not automatically opening!! D= - Gamemakingdude - 10-01-2011

(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:
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.



RE: Door is not automatically opening!! D= - Khyrpa - 10-01-2011

(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...



RE: Door is not automatically opening!! D= - Statyk - 10-01-2011

(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?



RE: Door is not automatically opening!! D= - Your Computer - 10-01-2011

(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.