MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
I am trying to create a fight where a mini boss rips off an actor's clothes and then destroys the clothes with fire forcing the affected actor to finish the last 10% of the fight without equipment. (the boss will not take his weapon)

I need some way to store what the actor has equipped on all equipment slots other than his weapon (I know it will require multiple variables).

I then can just do a change equipment command and set everything to none.

But I need what was equipped removed from the inventory as well. My understanding is that the change equipment command just stores your old equipment in the inventory.

How do I do this? Is there a custom variable call script for this?
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,328
Reaction score
11,498
First Language
German
Primarily Uses
RMMV
yes, and there should be a topic for the script equivalents of all event commands to contain and explain that.
Sorry, I can't answer your question directly because VXA was ten years ago and I don't remember all the ruby code from then. But it is listed in said topic, although you'll need to dig a bit deeper into it.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,775
Reaction score
893
First Language
English
Primarily Uses
RMXP
Will the enemy return the stolen equipment or not? Just asking.
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
yes, and there should be a topic for the script equivalents of all event commands to contain and explain that.
Sorry, I can't answer your question directly because VXA was ten years ago and I don't remember all the ruby code from then. But it is listed in said topic, although you'll need to dig a bit deeper into it.
That is incorrect. The script call collection thread only has script calls for things that you can already do without scripts. My situation needs something not listed. Plus, there are only 8 replies to that thread, so there is nothing to dig through. Only a couple more scripts were posted in those 8 comments and they still pertain to what you can do without scripts.
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,328
Reaction score
11,498
First Language
German
Primarily Uses
RMMV
That list (if you got the correct one) contains the command to set an equipment by script.
That is the same as reading out what equipment is there just by using that info slighlty different
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
That list (if you got the correct one) contains the command to set an equipment by script.
That is the same as reading out what equipment is there just by using that info slighlty different

There is not enough information to do what I want.

I see "
$game_actors[id].change_equip_by_id(slot, equip) if $game_actors[id]
# id is actor id
# slot is the slot number (0=weapon, 1=shield, 2=head, 3=body, 4=accessory)
# equip is the weapon or armor id
"

but no clue how to convert it. It appears that it is not the same as reading out what is there.

I assume I have to change something in
"$game_actors[id].change_equip_by_id(slot, equip)"

"$game_actors." something I guess
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,775
Reaction score
893
First Language
English
Primarily Uses
RMXP
Well, if you stop ignoring my previous question, I might be able to help you here.
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
Why do you need to know whether the gear will be returned or not? If you must know, there is an NPC in a nearby town who will give him something better
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,775
Reaction score
893
First Language
English
Primarily Uses
RMXP
I guess that makes it way easier than expected. :o

EDITED

Ruby:
# * Special Equipment Removal ACE * #
#   Scripter : Kyonides Arkanthes
#   2023-05-30

# * Script Calls * #

# - First Step: Find an Actor, namely a Teammate
#   actor = $game_party.members[ActorIndex]

# - Discard Equipment By Index (SlotID)
#   actor.discard_equip_by_index(SlotID)

# - Discard Many of Them By Indexes (SlotIDs)
#   actor.discard_equip_by_indexes(SlotID1, etc.)

# - Discard Equipment By Index (SlotID) and Store it in a Game Variable
#   actor.store_discarded_equip_by_index(VarID, SlotID)

# - Discard Many of Them By Indexes (SlotIDs)
#   -> It will store them in consecutive Game Variables!
#   actor.store_discarded_equip_by_indexes(VarID, SlotID1, etc.)

class Game_Actor
  # Store Equipment ID or Name? :id or :name or :equip (the whole object)
  EQUIP_VAR_MODE = :id
  def discard_equip_by_index(index)
    this_equip = @equips[index]
    this_equip.object = nil if this_equip.object
  end

  def discard_equip_by_indexes(*slot_ids)
    slot_ids.each {|slot_id| discard_equip_by_index(slot_id) }
  end

  def equip_id_or_name(slot_id)
    equip = @equips[slot_id].object
    case EQUIP_VAR_MODE
    when :id
      equip ? equip.id : 0
    when :name
      equip ? equip.name : "?"
    when
      equip
    end
  end

  def store_discarded_equip_by_index(var_id, index)
    $game_variables[var_id] = equip_id_or_name(index)
    discard_equip_by_index(index)
  end

  def store_discarded_equip_by_indexes(var_id, *slot_ids)
    slot_ids.each do |slot_id|
      store_discarded_equip_by_index(var_id, slot_id)
      var_id += 1
    end
  end
end

It includes several instructions on how to use it, but feel free to ask questions if needed.
 
Last edited:

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
I ended up moving this fight to later in the game.

@kyonides

Is this how you do this to permanently remove equpped equipment?

1687660027505.png
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,775
Reaction score
893
First Language
English
Primarily Uses
RMXP
Why did you add zeroes to those indexes? And by indexes I meant equipment slots starting from 0...
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
I see "
$game_actors[id].change_equip_by_id(slot, equip) if $game_actors[id]
# id is actor id
# slot is the slot number (0=weapon, 1=shield, 2=head, 3=body, 4=accessory)
# equip is the weapon or armor id
"
These slots? removing head, body, and accessory.

And I do not need the preceding 0s?
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,775
Reaction score
893
First Language
English
Primarily Uses
RMXP
Yes, the weapon, the shield or secondary weapon, the helmet, etc.
No leading zeros at all.
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
Thanks. I probably will not be able to try it out until at least tomorrow
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
@kyonides

your script is broken!!! It crashes my game every time!!!

1687731933688.png


Code:
Game_Interpreter:1409:in `eval': undefined method `discard_equip_by_indexes' for #<Game_Actor:0x9f56c58>, NoMethodError
    from Game_Interpreter:1409:in `eval'
    from Game_Interpreter:1409:in `command_355'
    from Game_Interpreter:196:in `execute_command'
    from Game_Interpreter:102:in `run'
    from Game_Interpreter:59:in `block in create_fiber'


Fix this please
 

TheoAllen

Self-proclaimed jack of all trades
Regular
Joined
Mar 16, 2012
Messages
7,494
Reaction score
11,663
First Language
Indonesian
Primarily Uses
N/A
It probably as simple as "save project before doing battle test"
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
Nope. I was actually in game when this happens. I talked to the six people that triggers a man to tell me to go to the desert, I talk to that man, which turns on a switch for Palkia to appear. Touch Palkia, battle, and when the Palkia tries to steal the armor, the game always crashes


It makes you save to do a test play.
 

TheoAllen

Self-proclaimed jack of all trades
Regular
Joined
Mar 16, 2012
Messages
7,494
Reaction score
11,663
First Language
Indonesian
Primarily Uses
N/A
Then check again if the script is installed
 

MoltresRider

Moltres Rider/Dragon Whisperer
Regular
Joined
Apr 16, 2023
Messages
379
Reaction score
50
First Language
English
Primarily Uses
RMVXA
Script is definitely installed
1687732922530.png


Edit: I noticed that the error output does not even mention the script itself whatsoever. This means either the script is not running at all for whatever reason or @kyonides script is all wrong
 
Last edited:

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,775
Reaction score
893
First Language
English
Primarily Uses
RMXP
You see, you don't have to use it. I don't mind, especially if you're involved in one way or another. You're always extremely unpolite, making huge statements about how terrible something is. I'm tired of your bad attitude so I don't care if it works or not.
 

Latest Threads

Latest Posts

Latest Profile Posts

AAAGH... I hate navigating the new RPG Maker website!
Forgive my rudimentary video editing skills, thought I'd start sharing progress on my status posts as well. Here's the second character of my roster, Mǽlhafoc, the Ælven ranger.

And if you missed the first one many moons ago, here's Vilhelm, the tarnished knight.
Knocked through three more rough draft sprites. (A frog beast thing, a skeleton, and vampire bat) down to seven sprites and a thing more appropriately done as tiles.

Forum statistics

Threads
135,014
Messages
1,252,918
Members
177,938
Latest member
l3rgith
Top