Gravity Changing trigger


(TNR360) #1

Is there a way to trigger where when a player presses “USE” that will change gravity for X time?

I think this would require scripting but Im worried I can’t be done with that either


(nUllSkillZ) #2

There’s a possibility to change cvar’s from within the scripts:
http://games.chruker.dk/enemy_territory/scripting_reference.php#cvar_variables

But AFAIK you can only inc cvars by 1 (so you would have to inc them a hundred times to change it by 100 - but please test this).

Not sure how the gravity cvar is named.


(Shaderman) #3

AFAIK you can’t set cvars. IIRC (cvar <cvarName> set <value>) has no effect.


(nUllSkillZ) #4

But you can inc them AFAIK.

Edit:

Found an example mod:
Time Bonus @ rtcwfiles.com


(BigBadWolf) #5

There is some key/value sets for worldspawn i think for gravity, you might be able to do it on a func_static and trigger it, but ive never tried.


(TNR360) #6

or maybe while player is inside the trigger gravity is low?


(SCDS_reyalP) #7

just FWIW, the cvar changing code is slightly broken in etmain. See http://www.splashdamage.com/forums/viewtopic.php?t=15243

It’s fixed in the current etpro and etpub versions.


(TNR360) #8

:shock: good to know


(nikita) #9

does it also apply on timescale?

how do i make a code for reducing timescale e.x 0.6
cause now i have unkown command cvar timescale 0.6

… am really dumb atm :smiley: or i dunno :slight_smile:


(Shaderman) #10

AFAIK timescale is for demo playback only. What do you want to do?


(nikita) #11

a fake effect of “fast/slow motion”

and i managed to do it by that code

cvar timescale inc 1

for fast motion

However it doesnt seems to be working in float numberic
such as 0.something

probebly only round number allowed
1
2
3 allowed
0.1
0.2
0.3 not allowed… i think ?

and if inc = increase
whats decrease?
its not dec

maybe
NOTE: Use negative value to decrease.

but setting nagative value doesnt work as well


(kamikazee) #12

I (and others) found out that inc only does +1, no matter what parameter it is given. I posted a fix some time ago and ETPro and ETPub now support inc -1, whilst etmain doesn’t. (Basicly what SCDS_reyalP said.)

As I think there won’t be an update to etmain, you will have to make a choice if you use the statement or not.

BTW: I only fixed it for integers (Numbers rounded to the lower number) because accums only used integers as well.


(SCDS_reyalP) #13

The numbers have to be integers. Even if they didn’t, messing with timescale on a running server is a Bad Thing.


(TNR360) #14

this is kinda what I want to do now, create a trigger and set a different gravity value when a player is inside it… so say for example he jumps off a cliff and into the trigger brush, therefore falls slower

possible?

oh and sorry for the year old bump :smiley:


(TNR360) #15

any ideas on this at all? I made a few tries that didn’t really work at all


(murka) #16

not really possible, but you could fake the effect making a trigger_multiple and a target_push with a low value.


(Nail) #17

didn’t Northpole have something like that ?


(kamikazee) #18

The thread ReyalP linked to is now found as http://www.splashdamage.com/forums/showthread.php?t=13986.

Ask your mod to include the patch I posted there and it might work.