Frictional Games Forum (read-only)

Full Version: [SOLVED]AddPropForce problem :(
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone! i sitting here with an annoying problem :/
I have made some birds(modelled, and imported them as staticprops), but whenever i try to make them move continously, they just do'nt seem to be going anywhere :/ i get no errors or nothing, and all the birds are called :/ Help is gladly appreciated Smile

The code:

Code:
void OnStart(){
//Variables
AddLocalVarInt("MoveBirdsInt", 1);

//Colliders
AddEntityCollideCallback("bird_1", "StopBirds", "StopMoveBirds", true, 1);

//Timers
AddTimer("MoveBirdsBuilding", 0, "MoveBirds");
}

void MoveBirds(string &in asTimer){
    if(GetLocalVarInt("MoveBirdsInt") < 50){
        AddPropForce("bird_1", -5000.0f, 0, 0, "world");
        AddPropForce("bird_2", -5000.0f, 0, 0, "world");
        AddPropForce("bird_3", -5000.0f, 0, 0, "world");
        AddPropForce("bird_4", -5000.0f, 0, 0, "world");
        AddPropForce("bird_5", -5000.0f, 0, 0, "world");
        AddPropForce("bird_6", -5000.0f, 0, 0, "world");
        AddPropForce("bird_7", -5000.0f, 0, 0, "world");
        AddPropForce("bird_8", -5000.0f, 0, 0, "world");
        AddPropForce("bird_9", -5000.0f, 0, 0, "world");
        AddPropForce("bird_10", -5000.0f, 0, 0, "world");
        AddPropForce("bird_11", -5000.0f, 0, 0, "world");
        AddPropForce("bird_12", -5000.0f, 0, 0, "world");
        AddTimer("MoveBirdsRe", 0.1f, "MoveBirds");
    }
}

void StopMoveBirds(string &in asParent, string &in asChild, int alState){
    SetLocalVarInt("MoveBirdsInt", 50);
}
When you make a new entity for MOVING do this ins tgead of STATICPROP.
Go to the modeleditor \ Settings \ userDefinedVariables and make it as an grabobject.
STATIC means NOT MOVE\toutch-able.
Alright, i made it a moveobject, but now my game just crashes :/

EDIT:
Alright i made it not crash, however the entities are still not moving
I think you missed 1 IMPORTEND step.
Go to the editor again and make a MESH. MESH = SHAPES in the modeleditor - (TAB 6)
A mesh you have to make as close as possible as the entitie looks ( the bird )
And then add\connect the mesh to the bird.
Connect it is like this : click on the SHAPE -> go to Shape (on the tab on the right side) Then create body.
Then save again.
If you dont understand let us know we can explane better.
I'm having diner now, so sorry for the short explanation.
---
Edit :
You should make also the BODY.
What i mean is there are like Body material \Mass \ Angular Damping \ Etc etc...
What you should do \ check is this for example.
Open a second MODEL EDITOR and open this : wood_box02.ent
You can find it in entities \ container.
Just copy what is there in the WOODEN box into your BIRD.
Except the BODY MATERIAL, make that ORGANIC, i am not sure what your bird is? wood\stone\organic...
(05-07-2014, 06:27 PM)DnALANGE Wrote: [ -> ]I think you missed 1 IMPORTEND step.
Go to the editor again and make a MESH.
A mesh you have to make as close as possible as the entitie looks ( the bird )
And then add\connect the mesh to the bird.
Then save again.
If you dont udnerstand let us know we can explane better.

So i made a simple box shape, made it into a body, attached the bird mesh to the body mesh, but it still does not work :/
(05-07-2014, 06:28 PM)bjaffedj Wrote: [ -> ]
(05-07-2014, 06:27 PM)DnALANGE Wrote: [ -> ]I think you missed 1 IMPORTEND step.
Go to the editor again and make a MESH.
A mesh you have to make as close as possible as the entitie looks ( the bird )
And then add\connect the mesh to the bird.
Then save again.
If you dont udnerstand let us know we can explane better.

So i made a simple box shape, made it into a body, attached the bird mesh to the body mesh, but it still does not work :/
Edit :
You should make also the BODY.
What i mean is there are like Body material \Mass \ Angular Damping \ Etc etc...
What you should do \ check is this for example.
Open a second MODEL EDITOR and open this : wood_box02.ent
You can find it in entities \ container.
Just copy what is there in the WOODEN box into your BIRD.
Except the BODY MATERIAL, make that ORGANIC, i am not sure what your bird is? wood\stone\organic...

You should check some ORIGINAL files \ entities from the ORIGINAL game.
Thats what a lot of us did before.
Learn from what Frictional Games did.
Thanks man! Big Grin I works now! Love and credits to you! Smile
Your welcome bjaffedj.
For any other questions, we are here to help.
Have a nice day.
-
Edit :
When you have anything SOLVED do like this please.
AddPropForce problem Sad = SOLVED.
So we do not have to go into your solved treadh, because it's already fixed be someone Wink
Thanks!
Since you're using objects that have the same name and other properties, it'll be easier if you wrote "bird_*", rather than writing all the objects individually.