change weapon

Get help using Construct 2

Post » Sat Nov 24, 2012 3:02 am

hey i just got started with this today and iv been trying to figure out how i would set up the events for a weapon change in a top down shooter i gave the player a variable called gun but i cant figure out how to set up the events so if some one could tell me what that would look like id greatly appreciate it   
B
2
Posts: 6
Reputation: 412

Post » Sat Nov 24, 2012 3:49 am

There are a number of ways to do this depending on how the game mechanics work in your game.

You could set a sprite that represents gun1 and another for gun2. Depending on what they fire will come from those gun's custom imagepoint you can set with their separate events for how they fire. Create a Boolean for Equipped.

When gun 1 is selected set Boolean to true for Gun1 and false for the other. And vise versa.

When Equipped is true, create and pin the gun to your character sprite.


There are other methods available too, some may be even better than this. Try working through it and post what you have. Until you try to implement it you may find yourself coming back to the board again and again rather than learning how to set this events up yourself.
B
20
S
4
G
2
Posts: 124
Reputation: 2,482

Post » Sat Nov 24, 2012 5:51 am

im sorry if i wasn't clear my problem is that i cant figure out how set it up so it looks for the variable value then checks if the left mouse is clicked then completes the action im not asking for u to set up my game im asking for some understanding of how the event system works i cant find any real documentation
B
2
Posts: 6
Reputation: 412

Post » Sat Nov 24, 2012 7:17 am

"i cant find any real documentation"

Pretty sure if you read through the manual, you'll find your answer.

I gave you a example of how you could set it up. If you are trying to set up a game without going through any of the basic tutorials then you are in for a long haul.
B
20
S
4
G
2
Posts: 124
Reputation: 2,482

Post » Sat Nov 24, 2012 10:12 am

Try something like this

https://dl.dropbox.com/u/108799982/Capx%20Demos/Gun.png
Using R238 for all examples
B
60
S
17
G
6
Posts: 363
Reputation: 9,125

Post » Sat Nov 24, 2012 5:49 pm

or create global variable and when global variable is 1 and mouse is clicked shot arrow, when global variable is 2 and mouse is clicked shoot bullet
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sun Nov 25, 2012 3:22 am

thanks emoaeden thats just what i needed but i just cant seem to get it to work just right the global value does change but it wont shoot the bullet object when either value is activated could u maybe take a look? thanks its hella weird trying to use this event system im used to blender GE
https://www.dropbox.com/s/55u088hkz15pbc9/2012-11-24_184743.png
B
2
Posts: 6
Reputation: 412

Post » Sun Nov 25, 2012 4:27 am

Well, have a look at this, lemme know if it works :)

https://dl.dropbox.com/u/108799982/Capx%20Demos/MultipleBullets.capx
Using R238 for all examples
B
60
S
17
G
6
Posts: 363
Reputation: 9,125


Return to How do I....?

Who is online

Users browsing this forum: Jarnopa, semaso, Yahoo [Bot] and 14 guests