Gamestudio Links
Zorro Links
Newest Posts
WFO Training with parallel cores Zorro64
by Martin_HH. 02/23/26 10:49
ZorroGPT
by TipmyPip. 02/21/26 19:15
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, alx, Martin_HH), 6,129 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
A little help for a n00b #366158
04/01/11 18:28
04/01/11 18:28
Joined: Apr 2011
Posts: 2
D
Darkflare19 Offline OP
Guest
Darkflare19  Offline OP
Guest
D

Joined: Apr 2011
Posts: 2
hey, couple of simple questions

How do you use 'accelerate' without the system crashing and I mean a simple program I'm literally messing about with script 18 from the online tutorial pack of scripts.

var accel = 5
var accelneg = -5
function main()
{
level_load ("work18.wmb");

}

action move_me()
{
while(!key_cuu) wait(1); // wait for up key
while(1)
{
if (key_cuu) accelerate(NULL, accel, 1) ;
if (key_cud) accelerate(NULL, accelneg, 1);


var distance_fwdorbck = (key_cuu-key_cud) *5*time_step;

c_move(me, vector(distance_fwdorbck,0,0), NULL, GLIDE);
my.pan += (key_cul-key_cur)*2*time_step;
wait(1);
}
}

It runs the program fine, but then says system crash in move_me: SYS in an error window when I run the program and press up.

If you don't know why the above happens could you tell me how to accelerate an object another way

Cheers.

Re: A little help for a n00b [Re: Darkflare19] #366162
04/01/11 18:49
04/01/11 18:49
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
You can't pass NULL as the first parameter to accelerate. It needs a pointer to a var, and it will change the value stored in this var.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: A little help for a n00b [Re: JibbSmart] #366164
04/01/11 18:58
04/01/11 18:58
Joined: Apr 2011
Posts: 2
D
Darkflare19 Offline OP
Guest
Darkflare19  Offline OP
Guest
D

Joined: Apr 2011
Posts: 2
Cheers, I got rid of the NULL and replaced them both with distance_fwdorbck (which is the variable (key_cuu-key_cud)*5

And it doesn't crash anymore, but it doesn't accelerate either, just stays at a constant speed.

Anyway could I make the object accelerate at a certain rate?

Or is there anyway I could increment the variable above by a certain amount every second the corresponding button is being held down?

Thanks again.

Re: A little help for a n00b [Re: Darkflare19] #366169
04/01/11 19:19
04/01/11 19:19
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Perhaps reduce the friction (third parameter)?

Jibb


Formerly known as JulzMighty.
I made KarBOOM!

Gamestudio download | 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