View unanswered posts | View active topics It is currently Tue Jan 07, 2025 12:28 am



Reply to topic  [ 7 posts ] 
 Gravitation 
Author Message

Joined: Mon Nov 24, 2008 6:25 pm
Posts: 1
Reply with quote
Post 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:


Mon Nov 24, 2008 7:24 pm
Profile
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post 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.


Mon Nov 24, 2008 8:22 pm
Profile YIM
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post 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.


Tue Nov 25, 2008 2:23 am
Profile
User avatar

Joined: Sun May 18, 2008 8:30 am
Posts: 732
Reply with quote
Post 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.


Tue Nov 25, 2008 2:30 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post 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.


Tue Nov 25, 2008 2:35 am
Profile
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post 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.


Tue Nov 25, 2008 3:00 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Gravitation
im assuming the scene's gravity should be nil, yeah? thats very cool..


Tue Nov 25, 2008 6:04 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.039s | 16 Queries | GZIP : Off ]