Data Realms Fan Forums
http://45.55.195.193/

Gravitation
http://45.55.195.193/viewtopic.php?f=1&t=12804
Page 1 of 1

Author:  Rosermax [ Mon Nov 24, 2008 7:24 pm ]
Post subject:  Gravitation

I want to make "Planet Scene" mod, and one question..>
Can I make in CC B22 Round gravitation? :oops:

I want to made round planet with gravitation in the middle. On the schedule, round line can been made by (X-a)^2+(Y-b)^2=R^2 where is R-radius, (X,Y) points on the around line and (A,B)- centre point. But where i can put it in the text i don't know.

// Gravity acceleration, m/s^2
GlobalAcceleration = Vector
X = 0
Y = 19.82


Because here it is numbers, but i need to made from that linear equation. I think these will be interesting thing. :geek:

Author:  Darlos9D [ Mon Nov 24, 2008 8:22 pm ]
Post subject:  Re: Gravitation

Rosermax wrote:
I want to make "Planet Scene" mod, and one question..>
Can I make in CC B22 Round gravitation? :oops:

I want to made round planet with gravitation in the middle. On the schedule, round line can been made by (X-a)^2+(Y-b)^2=R^2 where is R-radius, (X,Y) points on the around line and (A,B)- centre point. But where i can put it in the text i don't know.

// Gravity acceleration, m/s^2
GlobalAcceleration = Vector
X = 0
Y = 19.82


Because here it is numbers, but i need to made from that linear equation. I think these will be interesting thing. :geek:

The normal gravity you set in scene code just does up/down, left/right. For something more complex, you might want to look into Lua. Also, you might want to head over to the Scene Making forum, which is a Scene Releases subforum.

Author:  Lord Tim [ Tue Nov 25, 2008 2:23 am ]
Post subject:  Re: Gravitation

As far as I've bothered to test things, a Scene's gravity is read-only. Meaning you can't change the gravity mid-game with Lua.

Even if you could, that doesn't only affect a certain area. It affects the whole scene.

The best way is through editing each particle/actor's Velocity and setting gravity to zero.

Author:  CandleJack [ Tue Nov 25, 2008 2:30 am ]
Post subject:  Re: Gravitation

Can't you make lua areas that push with the same force as gravity towards the planet's center? It would be very very crude, but I guess it would work to make a square that nobody can walk on because actors are always oriented the same way.

Author:  Duh102 [ Tue Nov 25, 2008 2:35 am ]
Post subject:  Re: Gravitation

Hah, I just thought of a modscene. No gravity, actors mad to look like boxes, a gun for moving and other guns for shooting. Probably PvP only.

Author:  Lord Tim [ Tue Nov 25, 2008 3:00 am ]
Post subject:  Re: Gravitation

To get gravity like you want it, you basically just have to do this in the update code:

Code:
center = Vector (0,0) --Can be any location
g = -10 --power of gravity (you probably have to change this (has to be negative))
for i in MovableMan do
i.Vel = i.Vel + Vector(i.Pos.X-center.X/g,i.Pos.Y-center.Y/g)
end


Plus or minus a few changes. I heard somewhere you could iterate through all the objects in the scene with just MovableMan. I have not tested that. If you can't, you'd do that code for each type of object.

Author:  Geti [ Tue Nov 25, 2008 6:04 am ]
Post subject:  Re: Gravitation

im assuming the scene's gravity should be nil, yeah? thats very cool..

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/