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
prop force
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#1
prop force

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

here's my 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 (:

[Image: 44917299.jpg]Dubstep <3
06-22-2011, 03:56 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: prop force

remove the void before addpropforce...
06-22-2011, 03:59 PM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#3
RE: prop force

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

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 06-22-2011, 04:12 PM by xtron.)
06-22-2011, 04:11 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#4
RE: prop force

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

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");
}
06-22-2011, 07:39 PM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#5
RE: prop force

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

[Image: 44917299.jpg]Dubstep <3
06-22-2011, 09:38 PM
Find
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#6
RE: prop force

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

06-23-2011, 03:04 AM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#7
RE: prop force

[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 :/

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 06-24-2011, 01:07 PM by xtron.)
06-24-2011, 01:06 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#8
RE: prop force

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.
06-24-2011, 01:17 PM
Find
Rownbear Offline
Member

Posts: 157
Threads: 13
Joined: Apr 2011
Reputation: 2
#9
RE: prop force

maybe you cant add propimpulse to that entity

(This post was last modified: 06-24-2011, 01:41 PM by Rownbear.)
06-24-2011, 01:40 PM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#10
RE: prop force

How to check the debug messages? o.O

[Image: 44917299.jpg]Dubstep <3
06-24-2011, 02:04 PM
Find




Users browsing this thread: 1 Guest(s)