Acceleration / Deceleration with gotomarker?


(hummer) #1

So, I’m doing the whole boulder rolling thing from Indiana Jones.

I tried using splines, but some weird stuff started happening (like the boulder disappearing afterwards, the boulder “fell” instantly, even with speeds set, etc.), so I went back to path_corners and gotomarkers. Also, I’m using the setrotation command to roll the boulder.

Anyway, when the boulder falls, it falls at a constant speed. I’d like to make it seem like gravity is in effect… like the boulder should pick up speed as it gets closer to the ground. Here’s my script so far:

trigger go
	{
		gotomarker boulder_sp1 230  // falls to the ground
		gotomarker boulder_sp2 230 // goes to first path_corner
		setrotation 0 0 230 // rolls the boulder
		gotomarker boulder_sp3 230 // next corner
		setrotation 0 0 230 // keeps the roll going 
		gotomarker boulder_sp4 230 // final path corner
	}

What do I have to add to make this work? The documentation is pretty murky when it comes to acceleration / deceleration.


(Lanz) #2

Add more corners and increase the speed for every corner.


(kat) #3

or if it’s still there you can add ‘accellerate’ to the script with a start speed. There should be some reference to it in the script command files


(hummer) #4

This is what I found in the RTCW documentation, although it’s not very helpful…

gotomarker <targetname> <speed> [accel/deccel] [turntotarget] [wait]

This will tell the SCRIPT_MOVER to move to a target, usually a Path_corner. Targetname is “name” of the PATH_CORNER; SPEED is used for how fast the SCRIPT_MOVER will move to the PATH_CORNER; ACCEL/DECCEL are used to accelerate/deccelerate to a PATH_CORNER. NOTE: For ACCEL, the SCRIPT_MOVER needs to start at speed of 0, and DECCEL needs to end at a speed of 0; TURNTOTARGET will face towards the targer (PATH_CORNER) depending on the angle; WAIT is used so that the script will not read ahead until the SCRIPT_MOVER has reached the TARGETNAME.

So, are accel / decel numerical values? Or are they wait commands? If it starts at 0, and ends at 0, does that mean there has to be three gotomarkers? I don’t get it…


(chavo_one) #5

are accel / decel numerical values?

No, you put the actual keyword in.
ie. gotomarker pc1 50 accel wait

If it starts at 0, and ends at 0, does that mean there has to be three gotomarkers?

To accelerate, you must start from a standstill.
To deccelerate, you must be moving.
So to do both, you would need at least three path_corners.
With this system, you can’t set the rate at which the acceleration/decceleration happens.


(hummer) #6

So, the acceleration and deceleration is fixed :confused:

Is there some way to have an adjustible rate of acceleration?


(hummer) #7

Cool… just accelerated to one path corner… seems to be working well.


(Lanz) #8

It might depend on the distance between the corners? Just a wild guess though.