Gamestudio Links
Zorro Links
Newest Posts
Bug in train mode, or it seem to me
by mistery. 09/24/26 17:34
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 09/22/26 12:21
Capital slider is not saving in Z12
by Petra. 09/22/26 06:49
Parent/child object
by VoroneTZ. 09/22/26 05:52
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
Trades during a running bar
by Martin_HH. 09/21/26 12:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Knull, LoT), 13,663 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Knull, Opus, Jubilee, lopezsergio07, mistery
19240 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 | 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