how do i get this working? i know why it doesnt.

Get help using Construct 2

Post » Sun Mar 31, 2013 6:53 am

hi.
when i press a, my character walks left and plays the left walking animation.
the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)
however, it doesn't like me trying to do 2 things at once when i press A.

if anyone knows how i can get this working, i would be very grateful :)

the relevant event sheet and sprites:
http://i.imgur.com/YjMeVRe.png
B
3
Posts: 4
Reputation: 424

Post » Sun Mar 31, 2013 7:28 am

[QUOTE=ziggurati] hi.
when i press a, my character walks left and plays the left walking animation.
the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)
however, it doesn't like me trying to do 2 things at once when i press A.

if anyone knows how i can get this working, i would be very grateful :)

the relevant event sheet and sprites:
http://i.imgur.com/YjMeVRe.png[/QUOTE]


Judging from what I'm seeing, it seems that you don't have an event where holdinggun becomes = to 1.

Did you create an event where, lets say if player is on "collision with gun" then "set value HoldingGun=1"?

Otherwise the animation won't work because HoldingGun never becomes equal to 1. You need an event where the global variable "HoldingGun" can become equal to 1.
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Sun Mar 31, 2013 7:29 am

[QUOTE=ziggurati] hi.
when i press a, my character walks left and plays the left walking animation.
the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)
however, it doesn't like me trying to do 2 things at once when i press A.

if anyone knows how i can get this working, i would be very grateful :)

the relevant event sheet and sprites:
http://i.imgur.com/YjMeVRe.png[/QUOTE]

If you need more help then quote my last message so I get an update on your forum post
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Sun Mar 31, 2013 7:40 am

[QUOTE=retrodude] [QUOTE=ziggurati] hi.
when i press a, my character walks left and plays the left walking animation.
the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)
however, it doesn't like me trying to do 2 things at once when i press A.

if anyone knows how i can get this working, i would be very grateful :)

the relevant event sheet and sprites:
http://i.imgur.com/YjMeVRe.png[/QUOTE]


Judging from what I'm seeing, it seems that you don't have an event where holdinggun becomes = to 1.

Did you create an event where, lets say if player is on "collision with gun" then "set value HoldingGun=1"?

Otherwise the animation won't work because HoldingGun never becomes equal to 1. You need an event where the global variable "HoldingGun" can become equal to 1.[/QUOTE]


Yeah that's in the "purchase" section, it happens when you are touching the gun and you press E.

http://i.imgur.com/pwAGkcp.png

here are the aiming and purchase classes
B
3
Posts: 4
Reputation: 424

Post » Sun Mar 31, 2013 10:18 pm

bumping, sorry, i'm still not sure about how to fix it
B
3
Posts: 4
Reputation: 424

Post » Sun Mar 31, 2013 11:25 pm

@retrodude < that's how alerts work in those forums, not via quoting.

@ziggurati: you should post your whole capx rather than just a few screenshots.
As it is, the issue might be with the way you setted your animations, but without the full capx, no way to be sure.
Also you might want to use sub events to check the value of holdinggun and apply the correct animation accordingly.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sun Mar 31, 2013 11:31 pm

[QUOTE=Kyatric] @retrodude < that's how alerts work in those forums, not via quoting.

@ziggurati: you should post your whole capx rather than just a few screenshots.
As it is, the issue might be with the way you setted your animations, but without the full capx, no way to be sure.
Also you might want to use https://www.scirra.com/manual/128/sub-events to check the value of holdinggun and apply the correct animation accordingly.[/QUOTE]

ah, thank you! i now have the A keypress as an event with 2 variable checks as sub-events. it works fine, thanks for the help
B
3
Posts: 4
Reputation: 424


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Sotir31, Yahoo [Bot] and 29 guests