Frictional Games Forum (read-only)
prop force - 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: prop force (/thread-8744.html)

Pages: 1 2 3


prop force - xtron - 06-22-2011

I tried a prop force script but all I get is " ERR: Expected '(' or ',' "

here's my code:
Code:
void OnStart()
{
AddEntityCollideCallback("door1_2_3", "door_collide1", "func_door123_collide", true, 1);
}

void func_door123_collide(string &in asParent, string &in asChild, int alState)
{
void AddPropForce("grunt_ragdoll_1", -100f, 0f, 0f, "world");
}

thanks (:


RE: prop force - Khyrpa - 06-22-2011

remove the void before addpropforce...


RE: prop force - xtron - 06-22-2011

oh silly me...
fail hehe...same error.


RE: prop force - Roenlond - 06-22-2011

float means that the number has decimals, yet you have none.

Code:
void OnStart()
{
AddEntityCollideCallback("door1_2_3", "door_collide1", "func_door123_collide", true, 1);
}

void func_door123_collide(string &in asParent, string &in asChild, int alState)
{
void AddPropForce("grunt_ragdoll_1", -100.0f, 0.0f, 0.0f, "world");
}



RE: prop force - xtron - 06-22-2011

Thanks. Now I dont get any stupid errors Smile but now the prop wont fly towards the player :S. Any suggestions?


RE: prop force - Rownbear - 06-23-2011

AddPropImpulse("Door", X, Y, Z, "World"); //red is x axis, blue is z axis, green is y axis.

tweek the numbers there to get the result you want


RE: prop force - xtron - 06-24-2011

[Image: grunt.th.png]

Here's how it looks. I want the grunt to fly towards the door and -100 at X in my script will make him go with force against him but it doesn't work :/


RE: prop force - Roenlond - 06-24-2011

Code:
void OnStart()
{
AddEntityCollideCallback("door1_2_3", "door_collide1", "func_door123_collide", true, 1);
}

void func_door123_collide(string &in asParent, string &in asChild, int alState)
{
AddPropForce("grunt_ragdoll_1", -100.0f, 0.0f, 0.0f, "world");
AddDebugMessage("Grunt should now move", false);
}

With debug messages turned on, does the message display? If it doesn't, the function is never called. If it does but the grunt doesn't move, something is wrong with the propforce command.


RE: prop force - Rownbear - 06-24-2011

maybe you cant add propimpulse to that entity


RE: prop force - xtron - 06-24-2011

How to check the debug messages? o.O