Gravity
Moderator: Moderators
Gravity
Is it possible to have a lever and when you pull it the grravity flips???
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:
E.G.g_allclasses.html wrote:gravity( Float worldGravity )
Set the gravity for the whole world.
Code: Select all
$world gravity 1.0im 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
.
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
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 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
1st of all u need a basic grasp of scripting which is all i know
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_threadif 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*cool ,my 1st piece of thought up script *
something might be wrong with it but im sure some1 might come and save the day
Wow thx m8!
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.
Thx again
A few mins l8er:
Soz m8 it didn't work
maybe next time
A few mins l8er:
Soz m8 it didn't work
Last edited by Dani on Fri Jul 23, 2004 7:25 pm, edited 1 time in total.
darn .it was a nice try though
,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 putsomewhere b4 waittill spawn and after waittill prespawn
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
