2 registered members (TipmyPip, ozgur),
1,240
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How to make my plane accelerate?
[Re: FutureRaptor]
#348044
11/22/10 07:09
11/22/10 07:09
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
You are just getting started and already have a pro version of GS? Strange, but if so, lucky you... Look at the manual for 'accelerate'. Here is how you can use it:
action plane()
{
VECTOR force;
VECTOR dist;
while(1)
{
force.x = 10 * key_force.x * time_step; // play with 10
accelerate(dist.x,force.x,0.5); // play with 0.5 (lower it)
c_move(my,dist,nullvector,IGNORE_PASSABLE|GLIDE);
wait(1);
}
}
|
|
|
Re: How to make my plane accelerate?
[Re: 3run]
#348148
11/23/10 02:15
11/23/10 02:15
|
Joined: Sep 2010
Posts: 67
FutureRaptor
OP
Junior Member
|
OP
Junior Member
Joined: Sep 2010
Posts: 67
|
hmm I used the code as it is and tried a couple of other things but every time I try the plane just seems to go really far and even when I reduced the numbers it didnt go slower.. Kinda problematic, anybody else?
action plane() { VECTOR force; VECTOR dist; while(1) { force.x = 10 * key_force.x * time_step; // play with 10 accelerate(dist.x,force.x,0.5); // play with 0.5 (lower it) if (key_cuu) c_move(my,dist,nullvector,IGNORE_PASSABLE|GLIDE); wait(1); } }
Last edited by FutureRaptor; 11/23/10 02:16.
|
|
|
Re: How to make my plane accelerate?
[Re: FutureRaptor]
#348226
11/24/10 08:35
11/24/10 08:35
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Why do this work then?!
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function main() // AND THIS IS FUNCTION!! NOT THE MAIN ACTION!!!
{
fps_max = 60;
level_load("1.WMB");
wait(3);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VECTOR force;
VECTOR dist;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
action hero()
{
player = my;
while(1)
{
force.x = 10 * key_force.y * time_step; // PLAY WITH 10 (SPEED)
accelerate(dist.x,force.x,0.2); // PLAY WITH 0.2 (FRICTION)
dist.y = 0;
dist.z = 0;
c_move(my,dist,nullvector,IGNORE_PASSABLE|GLIDE);
wait(1);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
IT WORKS AND ITS TESTED!!!!!!!!!!!! AND EVEN YOU CAN'T GET THIS ONE TO WORK, FOR SOME UNKNOWN FOR ME REASONS!!! HERE IS THE DEMO THEN: Download link
|
|
|
Re: How to make my plane accelerate?
[Re: 3run]
#348324
11/25/10 00:44
11/25/10 00:44
|
Joined: Sep 2010
Posts: 67
FutureRaptor
OP
Junior Member
|
OP
Junior Member
Joined: Sep 2010
Posts: 67
|
I didnt have this part. dist.y = 0; dist.z = 0; Thx for all your help man I am really stupid sometimes too. It all worked out fine in the end so thats what counts for me.
Last edited by FutureRaptor; 11/25/10 00:45.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|