Jump to content


Photo

Check image_index issue


  • Please log in to reply
2 replies to this topic

#1 KevinBacon

KevinBacon

    GMC Member

  • GMC Member
  • 37 posts
  • Version:GM8

Posted 27 April 2012 - 11:04 PM

Hey

this is what im doin....

http://imageupper.com/gi/?galID=S0300010041O13355668922147771&n=1&m=1

this is in the highlighted script
image_angle = point_direction(x,y,mouse_x,mouse_y)
///////
reload  = false
///////
if sprite_index = PistolReload_spr{
if image_index=12 {ammo = PlayerParent.maxpistolammo if mouse_check_button(mb_right)
sprite_index = Pistol_spr else sprite_index = PistolNO_spr reloading = 0 }
if image_index=10 if not reload then sound_play(Reload)}






I know its messy..i get it to work first then neaten it up XD

so what is meant to happen is matie reloads when the sprite reaches image_index=12, he does do this but only when he's in a single subimage sprite before the reload animation, so its like.. PistolStill_spr to PistolReload_spr"works" but PistolWalk_spr to PistolReload_spr"doesnt work".
in the image ive provided the ifs are if reloading = 0 {if the walking sound is playing change spr to walking,if runing sound is playing change spr to runing}..is the jist,
sorry if i didnt explain very well, im no good at that :P
help would be nice. thanks

Edited by KevinBacon, 27 April 2012 - 11:20 PM.

  • 0

#2 Fihrilkamal

Fihrilkamal

    GMC Member

  • GMC Member
  • 348 posts

Posted 27 April 2012 - 11:14 PM

If you set image_speed to something like 0.3 or 0.4 your image_index might never equal to 12, it might be 11.77 and so on. I would suggest you to use if round(image_index)==12 to check.
That"s might not be the problem though.
  • 0

#3 KevinBacon

KevinBacon

    GMC Member

  • GMC Member
  • 37 posts
  • Version:GM8

Posted 27 April 2012 - 11:20 PM

If you set image_speed to something like 0.3 or 0.4 your image_index might never equal to 12, it might be 11.77 and so on. I would suggest you to use if round(image_index)==12 to check.
That"s might not be the problem though.



Hey that sorted it,
cheers dude, that was quik XD
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users