Page 2 of 2
Re: wait 1
Posted: Sat Mar 27, 2004 6:09 am
by kai0ty
tltrude wrote:Change "wait 1".
the lower the number the faster it will accelerate
Posted: Sat Mar 27, 2004 9:53 pm
by fuhrer
Code: Select all
local.speed == local.speed * local.speed
isnt doing anything
Posted: Sat Mar 27, 2004 10:35 pm
by jv_map
That's because 1 * 1 = 1
To make the speed increase exponentially, use the following:
local.speed = 1.1 * local.speed
Where 1.1 is the 'factor of growth'

Posted: Sat Mar 27, 2004 11:01 pm
by fuhrer
lol i aint that simple, i changed the start speed to 5, n it still didnt work
Posted: Sat Mar 27, 2004 11:22 pm
by wacko
fuhrer wrote:lol i aint that simple, i changed the start speed to 5, n it still didnt work
is it == or = u're using in that line?
Posted: Sun Mar 28, 2004 12:15 am
by fuhrer
==
after reading the scripting reference just now i get the feeling it should be = aint had time to try it yet
Posted: Sun Mar 28, 2004 12:50 am
by wacko
yes, i believe == is just for comparing two variables. At least I would use = ( and == just in if clauses), but then, I'm here mostly in search for As then for Qs

Posted: Sun Mar 28, 2004 3:50 am
by fuhrer
its only moving at a constant speed, altho it seems to multiply once as its definatley moving faster than 5 ups......so maybe its not looping for some reason just making the speed at local speed * 5 and keeping it at that.
Code: Select all
level waittill spawn
end
go:
local.speed = 1
$acc_trig waittill trigger
$accelerator moveto $end
$accelerator move
while(local.speed < 2000)
{
local.speed = local.speed * 5
$accelerator speed local.speed
wait .02
}
end
move
Posted: Sun Mar 28, 2004 6:43 am
by tltrude
I don't think you can change the speed without telling it to move again.
Code: Select all
level waittill spawn
end
go:
local.speed = 1
$acc_trig waittill trigger
$accelerator moveto $end
while(local.speed < 2000)
{
local.speed = local.speed * 5
$accelerator speed local.speed
$accelerator move
if ( $accelerator.origin == $end.origin )
{
break
}
wait .001
}
end
It is going to be a rather sudden stop. Using "end" as a targetname is probably not a good idea.
Posted: Sun Mar 28, 2004 6:55 am
by fuhrer
not doing anything now
Posted: Mon Mar 29, 2004 1:25 pm
by fuhrer
ok its working,
but for some reason when the speed gets to around 600, the acclerator stops and im gettin crushed, thers nothing in the way to stop it from reaching the waypoint,
after about it takes 1/4 of my health it carries on moving, then crushes me again when it reaches the waypoint.
any ideas?
go:
local.speed = 1
$acc_trig nottriggerable
local.rider = parm.other
local.rider glue $1
while(local.speed < 2000)
{
iprintln "speed " local.speed
local.speed = local.speed + 10
$accelerator speed local.speed
$accelerator moveto $end
$accelerator move
wait .08
}
goto go
end
waypoints
Posted: Tue Mar 30, 2004 9:23 am
by tltrude
The "end" waypoint may be to low and the cab slowly sinks down as it gets closer to it. Info_waypoints should always be in the exact center of the object and object detination.
Ps: I tested it and found there are limits to the speed you can move the player. At a top speed of 553 all was well, but at 1024 the player blocked movement and was slowly crushed to death. You might get around that by making the player "notsolid" while he is glued.
Here is the script I used for the test--my track was 7300 unit long.
Code: Select all
main:
level waittill prespawn
exec global/ambient.scr mohdm1
$a_spot bind $accelerator
$accelerator_trigger bind $accelerator
level.aspeed = 2
thread go_fast
level waittill spawn
end
//------------------------------------------
// Accelerator
//------------------------------------------
go_fast:
$accelerator_trigger waittill trigger
local.rider = parm.other
local.rider glue $a_spot
wait 1
$accelerator loopsound lighthouse_run
while ( level.aspeed < 512 )
{
level.aspeed = (1.1 * level.aspeed)
$accelerator speed level.aspeed
iprintln "Speed = " (int(level.aspeed))
$accelerator moveto $end_point
$accelerator move
wait .08
}
while (vector_length ($accelerator.origin - $end_point.origin) > 16)
wait .1 // loops every .1 seconds until not true
iprintln "Final speed = " (int(level.aspeed))
$accelerator stoploopsound
local.rider unglue
//goto go_fast
end