Gamestudio Links
Zorro Links
Newest Posts
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
5 registered members (AndrewAMD, alibaba, Konsti, 2 invisible), 1,418 guests, and 2 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
integer for joy_raw.x #384538
10/04/11 17:23
10/04/11 17:23
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
I am trying to get the solid integer for the analog stick, but when I do something like below it stops at 140ish then jumps to 255 a second later when the stick is pushed all the way.

var stickv;

while(1){
stickv=integer(joy_raw.x);
wait(1);
}

I have this displayed in a panel along with the actual joy_raw.x.
the joy updates super fast and the integer shows pretty fast when below 100 (or above -100) but much past that and it freezes.
any ideas?


Black holes are where God divided by zero.
Re: integer for joy_raw.x [Re: Nicholas] #384542
10/04/11 17:46
10/04/11 17:46
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
try
Code:
#include <acknex.h>
#include <default.c>

var var_joyForceX;
PANEL* pnl = {
	digits(20, 20, "joy_raw.x = %.2f", *, 1, joy_raw.x);
	digits(20, 50, "joy_force.x = %.2f", *, 1, joy_force.x);
	digits(20, 80, "var_joyForceX = %.2f", *, 1, var_joyForceX);
	flags = SHOW;
}

void main(){
	
	while(1){
		
		var_joyForceX = integer(joy_raw.x);
		wait(1);
	}
}

I'm guessing you have something else in your code or you have a dodgy joypad causing the issue. Hopefully this code should highlight it.

Re: integer for joy_raw.x [Re: MrGuest] #384545
10/04/11 18:40
10/04/11 18:40
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
I'll give that a try when I get home. I haven't been checking the joy_force.x
I do have some other code in my while loop, but nothing that should give me trouble past a cetain threshold, but work fine below that.
I'll check it out tonight.


Black holes are where God divided by zero.

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