Jump to content
MasterMoes

Forcing a skill onto an actor

Recommended Posts

I'm trying to design a little cooking system using Selchar's weapon durability script. When a player cooks something, they need to have a certain "weapon" equipped like a spatula. When they cook the item, the tool's durability goes down by a few points. Basically, when the player cooks an item, a skill is supposed to be forced on the player. This skill takes away 3 durability points when used. The only issue is, the "force action" command doesn't work outside of battle. I tried everything, like changing the skill's targeting to "The User".

 

Does anyone know how I can force an action onto a certain actor out of battle?

Share this post


Link to post
Share on other sites
Posted (edited)
7 hours ago, MasterMoes said:

When they cook the item, the tool's durability goes down by a few points. Basically, when the player cooks an item, a skill is supposed to be forced on the player.

I don't understand how lowering an items durability relates to using a skill.

I assume you have make you cooking system check for the proper equipment check to do the cooking, so does it not account for the item losing some durability? Why do you need a skill?

Now I see, the script wants a skill to damage the weapon, because it's supposed to be damaged in battle.

Well this worked for me, but you have to specify the actor id.

image.png.1f8737b6861815ee418b1396099f6133.png

module R2_WDS
  Skill = 130
end
class Game_Interpreter
  def damage_weapon_durability(actor_id)
    actor = $game_actors[actor_id]
    return if actor == nil
    skill = $data_skills[R2_WDS::Skill]
    actor.process_weapon_durability(skill)
  end
end

Then set the note tag on that skill, e.g. <durability cost: 1>

Edited by roninator2

Share this post


Link to post
Share on other sites

This seems interesting, but I'm a little confused about how to use this. Could you give some instructions on how to use this little script? Everything I tried doesn't make the durability go down and sometimes crashes the game...

Share this post


Link to post
Share on other sites
22 hours ago, MasterMoes said:

Could you give some instructions on how to use this little script? Everything I tried doesn't make the durability go down and sometimes crashes the game...

I assumed that since you were 'making' a cooking system that you were programming one. either by script or by event.

If so then use the script call to call the interpreter function.

Share this post


Link to post
Share on other sites

So it seems the game crashes once the weapon's durability goes down to 0 using this function. The game probably doesn't know what to do once the weapon disappears (I have it set so that the weapon vanishes once it reaches 0). Any idea how this can be fixed? (sorry I'm not very good at scripting...)

Share this post


Link to post
Share on other sites
10 hours ago, MasterMoes said:

how this can be fixed?

Are you getting the error "log_window" for Game_Map

that's what I got.

It looks like the call for showing a message is in the vx style of code.

I changed to this

  def broken_weapon_text(actor)
    message = "%s's %s broke!" % [actor.name, @non_durability_name]
#~     SceneManager.scene.log_window.add_text(message)
    $game_message.add(message)
  end

line 151 - selchar weapon durability script

Share this post


Link to post
Share on other sites

Oh, I see, it was a message error, not a discard issue. For me, the message just gave me a script eval error. I actually like this system much better in general; makes it easier for the player to see the weapon-breaking message in battle. Thank you very much for your help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted