Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, ozgur), 1,240 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to make my plane accelerate? #348032
11/22/10 01:56
11/22/10 01:56
Joined: Sep 2010
Posts: 67
FutureRaptor Offline OP
Junior Member
FutureRaptor  Offline OP
Junior Member

Joined: Sep 2010
Posts: 67
I need my plane to accelerate when the player holds the forward arrow and slow down when the player lets go. I have looked over the manual and it only confused me further, my attempts to get what I wrote above to happen failed. I need this pretty badly so pls help, all help will be appreciated. I use 3dgs A7 7.86 PRO and run Win Vista, thx.

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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
You are just getting started and already have a pro version of GS? grin
Strange, but if so, lucky you...
Look at the manual for 'accelerate'.
Here is how you can use it:
Code:
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);
	}
}




Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Junior Member
FutureRaptor  Offline 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] #348161
11/23/10 07:30
11/23/10 07:30
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Emhh...
First, why do you use "if(key_cuu)" before "C_MOVE"??
Second, the only number that you need to reduce is "force.x = 10"!! You only need to reduce 10!!
Third, do you lock FPS in main function?? You need to lock it!! For me the script above works great, the only problem here is, that you use it wrong!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: How to make my plane accelerate? [Re: 3run] #348214
11/24/10 01:13
11/24/10 01:13
Joined: Sep 2010
Posts: 67
FutureRaptor Offline OP
Junior Member
FutureRaptor  Offline OP
Junior Member

Joined: Sep 2010
Posts: 67
Ok, just now I used it just like u said and it didnt work. I even made a special model for it with its own action. The model just went crazy and went off the map.
For the locking the FPS part in the main action if you are talking about fps_max=60; part yes I do have that.

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 Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Why do this work then?!
Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Junior Member
FutureRaptor  Offline 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.
Re: How to make my plane accelerate? [Re: FutureRaptor] #348336
11/25/10 05:45
11/25/10 05:45
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
No problem bro, I'm always glad to help, let me know and PM me if you'll need any help.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1