Page 1 of 1

Gravity

Posted: Wed Jul 21, 2004 4:12 pm
by Dani
Is it possible to have a lever and when you pull it the grravity flips???

Posted: Thu Jul 22, 2004 12:30 pm
by Angex
Well the g_allclasses has a gravity attribute for the worldspawn, so I guess you can use that, but it doesn't give any ranges so you'll have to play around with it:
g_allclasses.html wrote:gravity( Float worldGravity )

Set the gravity for the whole world.
E.G.

Code: Select all

$world gravity 1.0

Posted: Thu Jul 22, 2004 12:40 pm
by M&M
cool ,that never came to mind :D ,id love to try it out when ur map is done dani :wink:

Posted: Fri Jul 23, 2004 12:38 am
by blue60007
don't use 1.0, that should give you virtually 0 gravity, gravity 800 is default. Or around the neck of the woods. :wink:

Posted: Fri Jul 23, 2004 4:59 am
by bdbodger
I hear that $world gravity is about 800 but while working with physics I found that a setting of 1 is normal gravity when setting the gravity of an entity . I guess that is 100% of the worldgravity setting of 800 .

Posted: Fri Jul 23, 2004 11:09 am
by Dani
Thanks for all ur help guys, but the thing is i don't even know how to make a lever. Let alone make it do nething, could u guys give me som hints of were i can find this out?

Posted: Fri Jul 23, 2004 12:02 pm
by M&M
im nothing close to a scripter ,but i can tell u theoritically what u need .
1st of all u need a basic grasp of scripting which is all i know :D .
here are all the tuts on .map
check them out ,specially the script language ones .

there are several types of levers ,so choose one (from animate_equipment) and place it in ur map and give it a targetname (lever for example) .i choose alarmswitch
then put a trigger_use over it and give this one a target name too (lever_trigger for example.)

then type the following code in ur .scr file for ur map

Code: Select all

no_gravity_thread:
$lever_trigger waittill trigger
$lever anim on //this turns the switch animation on 
$lever playsound alarm_switch
$world gravity 1.0

$lever_trigger waittill trigger
$lever anim off //this turns the switch animation off
$lever playsound alarm_switch
$world gravity 800 //if thats the default value .
goto no_gravity_thread
this should make it turn on or off or on again ;)
if u want the player to wait for a while b4 turning it off again then put

Code: Select all

wait //and number of seconds here
in the empty line i left ;)



*cool ,my 1st piece of thought up script *

something might be wrong with it but im sure some1 might come and save the day

Posted: Fri Jul 23, 2004 7:05 pm
by Dani
Wow thx m8! :D Great. Cos i know how to do action script Very well (macromedia flash programing). I am full of good ideas i just don't know how to make em.
:wink: Thx again

A few mins l8er:
Soz m8 it didn't work :( maybe next time

Posted: Fri Jul 23, 2004 7:13 pm
by M&M
well,i hope it works :D it is my 1ST thought up script ,used to just copy paste b4 ;) .

check out the tuts i told u about ,specially the script language ones .u can do alot of things in mohaa if u know script (unfortunatly i dont know much )

Posted: Sat Jul 24, 2004 12:14 pm
by Dani
Sorry m8 it didn't work, the lever didn't animate and nothing happened. Sorry :(

Posted: Sat Jul 24, 2004 5:04 pm
by M&M
darn .it was a nice try though :D ,im sure some1 would come and save the day *nervously looking around*

edit:
oops .i think u might have forgotten to activate the thread .i kinda skipped that part ,maybe this is the problem ?

u stick the peace of script i told u somewhere at the end (u do have a base .scr file i am assuming )

then put

Code: Select all

thread no_gravity_thread
somewhere b4 waittill spawn and after waittill prespawn