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
[SOLVED]AddPropForce problem :(
bjaffedj Offline
Junior Member

Posts: 39
Threads: 8
Joined: Aug 2012
Reputation: 0
#1
[SOLVED]AddPropForce problem :(

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:

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);
}
(This post was last modified: 05-07-2014, 06:43 PM by bjaffedj.)
05-07-2014, 06:12 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#2
RE: AddPropForce problem :(

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.
(This post was last modified: 05-07-2014, 06:22 PM by DnALANGE.)
05-07-2014, 06:19 PM
Find
bjaffedj Offline
Junior Member

Posts: 39
Threads: 8
Joined: Aug 2012
Reputation: 0
#3
RE: AddPropForce problem :(

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
(This post was last modified: 05-07-2014, 06:27 PM by bjaffedj.)
05-07-2014, 06:23 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#4
RE: AddPropForce problem :(

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...
(This post was last modified: 05-07-2014, 06:35 PM by DnALANGE.)
05-07-2014, 06:27 PM
Find
bjaffedj Offline
Junior Member

Posts: 39
Threads: 8
Joined: Aug 2012
Reputation: 0
#5
RE: AddPropForce problem :(

(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
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#6
RE: AddPropForce problem :(

(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.
(This post was last modified: 05-07-2014, 06:37 PM by DnALANGE.)
05-07-2014, 06:35 PM
Find
bjaffedj Offline
Junior Member

Posts: 39
Threads: 8
Joined: Aug 2012
Reputation: 0
#7
RE: AddPropForce problem :(

Thanks man! Big Grin I works now! Love and credits to you! Smile
05-07-2014, 06:42 PM
Find
DnALANGE Offline
Banned

Posts: 1,549
Threads: 73
Joined: Jan 2012
#8
RE: AddPropForce problem :(

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!
(This post was last modified: 05-07-2014, 06:45 PM by DnALANGE.)
05-07-2014, 06:43 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#9
RE: [SOLVED]AddPropForce problem :(

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.

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-08-2014, 01:12 PM
Find




Users browsing this thread: 1 Guest(s)