Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, ozgur, AbrahamR, wdlmaster), 849 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: joystick stubborn [Re: Error014] #406431
08/19/12 22:25
08/19/12 22:25
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
That post will get you points for the most sensitive function name.

Re: joystick stubborn [Re: JazzDude] #406432
08/19/12 22:33
08/19/12 22:33
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Works perfectly

O appears

Fire button changes it to 1

But no bullets

I changed it to mouse_left and 280 and it worked for the mouse and I also got bullets.

So it's not the joystick that's cranky. It's the bullets. LOL

Re: joystick stubborn [Re: JazzDude] #406433
08/19/12 22:56
08/19/12 22:56
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
I found the problem. I added this code to allow the bofors gun to pan and tilt smoothly with the camera when firing. I don't know yet why but at least I know where.

Code:
while (mouse_left == off)
		{
		vec_set (weapon_offset.x, vector (120, 5, -35));
		vec_rotate (weapon_offset.x, vector (camera.pan, camera.tilt,0)); 
		vec_add (weapon_offset.x, camera.x);
		vec_set (my.x, weapon_offset.x);
		my.pan -= 8 * mouse_force.x * time_step;   
		my.tilt += 8 * mouse_force.y * time_step;
		my.tilt = clamp(my.tilt, -25, 85);
		wait (1);
		}
		while (joy_1 == off)
		{
		vec_set (weapon_offset.x, vector (120, 5, -35));
		vec_rotate (weapon_offset.x, vector (camera.pan, camera.tilt,0)); 
		vec_add (weapon_offset.x, camera.x);
		vec_set (my.x, weapon_offset.x);
		my.pan -= 2 * joy_force.x * time_step;   
		my.tilt += 2 * joy_force.y * time_step;
		my.tilt = clamp(my.tilt, -25, 85);
		wait (1);
		}



Re: joystick stubborn [Re: JazzDude] #406434
08/19/12 23:04
08/19/12 23:04
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline OP
User
JazzDude  Offline OP
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
Okay...thanks for all the help. All's well. I changed some "whiles" to "ifs" and that solved the problem.

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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