Home   Help Search Login Register  

Author Topic: Laws of gravity  (Read 1340 times)

0 Members and 2 Guests are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Laws of gravity
« on: 01 Sep 2006, 15:30:23 »
Do the laws of gravity not apply to both STATIC and THING classes?
urp!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Laws of gravity
« Reply #1 on: 01 Sep 2006, 15:33:48 »
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
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Laws of gravity
« Reply #2 on: 01 Sep 2006, 17:16:07 »
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:

Quote
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
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Laws of gravity
« Reply #3 on: 01 Sep 2006, 18:07:09 »
[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.
« Last Edit: 07 Sep 2006, 20:02:20 by Mr.Peanut »
urp!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Laws of gravity
« Reply #4 on: 07 Sep 2006, 00:03:55 »
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).
« Last Edit: 08 Sep 2006, 22:24:41 by Raptorsaurus »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Laws of gravity
« Reply #5 on: 07 Sep 2006, 20:01:37 »
S'alright, I already wrote one meself before making my last post.  But thanks.
urp!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Laws of gravity
« Reply #6 on: 09 Sep 2006, 05:50:49 »
Well, just incase you still want to see my script (setPosMove.sqs) and function (MovePos.sqf). Here it is in a demo mision.
« Last Edit: 09 Sep 2006, 06:32:09 by Raptorsaurus »