Gamestudio Links
Zorro Links
Newest Posts
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 (Quad, Petra, 1 invisible), 6,102 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
Need some help with my code #255835
03/12/09 22:14
03/12/09 22:14
Joined: Dec 2008
Posts: 56
B
binsky33333 Offline OP
Junior Member
binsky33333  Offline OP
Junior Member
B

Joined: Dec 2008
Posts: 56
Here is the function i have. Basically this function animates a gun when the left mouse button is clicked. Btw this code is in a different .wdl file.
Code:
var gun_percent = 0;
function run_weapons()
{
	wait(1);
	while(player!=NULL)
	{
		while(mouse_left)
		{
			while(int(gun_percent)<98)
			{
				ent_animate(gun0,"shoot",gun_percent,ANM_CYCLE);
				gun_percent=(gun_percent+10*time)%100;
				
				wait(1);
			}
			gun_percent=0;
			wait(1);
		}
		wait(1);
	}
}
 

Now i want to use this function for my player, so in the p1biped action on the first line of it i add, run_weapon();
But then when i run the game, i click and the animation doesnt happen, nor does a sound i have added which is supposed to play(its not in the code up there). What wrong? Any suggestions?

Thanks!

Re: Need some help with my code [Re: binsky33333] #255838
03/12/09 23:15
03/12/09 23:15
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

time in
gun_percent=(gun_percent+10*time)%100;


should be time_step // in Lite-C

Ottawa smile


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