OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mr.Peanut on 01 Sep 2006, 15:30:23
-
Do the laws of gravity not apply to both STATIC and THING classes?
-
Sometimes, sometimes not.
OFP is a very strange game.
Just when you think you have sussed out how some command or function works, the game changes the rules and does the exact opposite of what you found out.
Planck
-
Quite..
Some of the objects you mention indeed are not from this universe..
I believe this has to do with the few simulations used in those kinds of objects; simulation="thingeffect" (or something like that), simulation="house" etc..
Usually those objects don't recognise setVelocity, some of them may after you first spawn a bullet and hit them with that bullet, etc..
I think some of the objects don't even recognise setPos but don't quote me on that.. :shhh:
Just when you think you have sussed out how some command or function works, the game changes the rules and does the exact opposite of what you found out.
And sometimes the game even forgets how to use it's own functions/commands :D
-
[aside]Humph. Thought a topic about physics and object classes would be considered advanced. @Planck: pls delete the shadow thread. I know where this thread is now.[/aside]
The objects of these classes I have tried will setPos but setVelocity definitely does nothing. If you setPos one of these objects into the sky, they do not fall. I encountered this problem because I am working on a universal cargo hauling parachute script, and could not figure out why I was having so many problems with ammo crates. It is a big enough problem to force me to develop two versions of the scripts. To try and create one script to deal with both would result in too much spaghetti, and would degrade performance from having to many conditional gotos within fast loops.
A side product of this will be a simple little gravity simulation script for these objects.
-
I made a script that simulates movement using setPos just for this kind of problem. It can be easilly adapted to account for the acceleration of gravity. I will add it to this post when I get home (I am at work on break right now). In my testing of the script I used a fire and made it appear to be moving across the sky like a shooting star. I will adjust it and make it a fire ball falling (I will add gravitational force).
-
S'alright, I already wrote one meself before making my last post. But thanks.
-
Well, just incase you still want to see my script (setPosMove.sqs) and function (MovePos.sqf). Here it is in a demo mision.