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.

(Probably and easy one) Forcing hero to equip a weapon.

NBEOTM

Member

Seems like it would be an easy adjustment to make to the equip scene.

Any way to make it so the player cannot click the blank space and set their weapon to nothing?
 
You could just go to the hero tab in the database and lock it. Or you could just use one of these lines of code
Code:
$data_actors[actor_id].weapon_fix
Code:
$data_actors[actor_id].armor1_fix
Code:
$data_actors[actor_id].armor2_fix
Code:
$data_actors[actor_id].armor3_fix
Code:
$data_actors[actor_id].armor4_fix
Code:
$data_actors[actor_id].armor5_fix
in an event of some sort, like in a conditional branch, like if weapon 181 is equiped then call script
Code:
$data_actors[actor_id].weapon_fix

Get what I'm saying?
 

NBEOTM

Member

The problem with that is that they can't change their weapons. I wanted them to always have a weapon but not have the ability to be unarmed like most ff games. I did come up with a solution.

I changed this line in scene_Equip
@actor.equip(@right_window.index, item == nil ? 0 : item.id)

to

@actor.equip(@right_window.index, item == nil ? 1 : item.id)

and that seemed to do the trick, although its not very pretty.
 

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