Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Equip/unequip weapon or armor by clicking a button

Hi!
im gonna tell you how to make a event where you click one button to equip and one to unequip your weapon
(it works on armors too ofcourse)(Pictures in the spoilers)

Needed things in this tutorial:
2 common events
6 Conditional branch (choose so "else" also is there, it wont work if its not)
2 call common event
2 change equipment
2 play se (not needed but, more fun :D)
2 text
2 wait
(thats all you need)

now pictures and explainations

2uq279y.jpg
here we say when we press L (on keyboard its Q) we check if named actor is in party and if actor is then if weapon is in
inventory then we equip the weapon then we "play se" (not needed)(i have put in a wait there just in case so it dont slow down the game too much)after that we tell the event to change weapon to(in this case) bronze sword after a text that says that we equipt the weapon( \c[1] \c[0] the first one tell what color next letter is going to be and the the second one says that after that one is a other color in this case ( \c[1] "blue")( \c[0] "white")standard color).
28hlz49.jpg
 
we can copy the first common event after that we only need to modify it a bit.
first we need to change the first conditional branch so instead of "L" choose "R" (R = W on keyboard)
and second thoose text and play se and so on copy these and set these under the first "else" (look on picture if you dont understand).
now were done with that.
now were going to call these common events so we can (in game) equip/unequip by clicking a button
close the database and after that on map screen(on event layer)we just double click and there we have the
event commander the only thing we do is to choose "call common event" and then wich common event we want to get
and one is EXTREMLY important is to set "trigger" on "parallel process" becouse if you dont it wont work and now were done!!
(check these 2 last pictures just in case so you havent missed something or misunderstood anything if it is something
just tell me)
2cr8ti1.jpg
2dgs19g.jpg
 
Great Even tho i know how to do this..

But what would the use be for this?..Unless if you are making a system for it you have weapons equiped or illegal stuff on you people would be scared making them call the cops run away, Or even the people wil lfreeze up and not talk to you or move....
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top