RPG maker xp: Adding "Equip" to Actor battle command

Tiamat5774

Dragon Master (yes, I am a DM
Veteran
Joined
Jul 9, 2013
Messages
92
Reaction score
7
First Language
English
Primarily Uses
The game I'm creating is as close to Dungeons and Dragons as I can possibly get it. However, in D&D, the player
can change weapon or don armor in battle and I need an "Equip" command in the actor battle command menu
(phase 3 if I'm not mistaken or Scene_Battle 3 in the script editor), "Attack, Skill, Item, Defend") I was able to put a "Equip" command in the menu window, but that's all it is, a word in the window. When I select "Equip" I need it to bring up the equipment screen/screens.
I've tried to do this myself to no avail. I don't know which script ( or parts of scripts) to call up, or methods to use.
I've accomplished only syntax errors and Nomethod errors in attempting this, so I'm hoping someone here can help.

I also am not sure what further information is needed to get the help I need so if anyone is interested in doing a back-and-forth on this to hammer out a solution, I'm definitly up for it.

Thanks in advance!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,293
Reaction score
11,878
First Language
English
Primarily Uses
RMMV
Do you have any added or modified battle scripts, or are you JUST using the default?


You need to have the command added to the list, the logic of what to do when it's run, and you need to have a Window_BattleEquip window and the appropriate logic in the scene. As you can see, there's much more to it than just adding the word :)
 
Last edited by a moderator:

Tiamat5774

Dragon Master (yes, I am a DM
Veteran
Joined
Jul 9, 2013
Messages
92
Reaction score
7
First Language
English
Primarily Uses
In response to your questions, yes I am using/modifying the defalt scripts.  I understand all too well it's going to require more than just adding a word to the menu.  Here is what I've done so far.  This is from Scene_battle 1:

class Scene_Battle


#--------------------------------------------------------------------------


# * Main Processing


#--------------------------------------------------------------------------


def main


# Initialize each kind of temporary battle data


$game_temp.in_battle = true


$game_temp.battle_turn = 0


$game_temp.battle_event_flags.clear


$game_temp.battle_abort = false


$game_temp.battle_main_phase = false


$game_temp.battleback_name = $game_map.battleback_name


$game_temp.forcing_battler = nil


# Initialize battle event interpreter


$game_system.battle_interpreter.setup(nil, 0)


# Prepare troop


@troop_id = $game_temp.battle_troop_id


$game_troop.setup(@troop_id)


# Make actor command window


s1 = $data_system.words.attack


s2 = $data_system.words.skill


s3 = $data_system.words.guard


s4 = $data_system.words.item


s5 = $data_system.words.equip


@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
The last two lines (30 and 31) were all I modified that got a working result (the word "Equip" placed nicely in themenu). Then I opened Scene_battle3:


I added to the script in lines 152 - 158 using the same patterns I saw with the menu choices above. Got a sound as if the program was confirming my selection but then got a Name error: Start_Scene_Equip.

#--------------------------------------------------------------------------


# * Start Enemy Selection


#--------------------------------------------------------------------------


def start_enemy_select


# Make enemy arrow


@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)


# Associate help window


@enemy_arrow.help_window = @help_window


# Disable actor command window


@actor_command_window.active = false


@actor_command_window.visible = false


end


#--------------------------------------------------------------------------


# * End Enemy Selection


#--------------------------------------------------------------------------


def end_enemy_select


# Dispose of enemy arrow


@enemy_arrow.dispose


@enemy_arrow = nil


# If command is [fight]


if @actor_command_window.index == 0


# Enable actor command window


@actor_command_window.active = true


@actor_command_window.visible = true


# Hide help window


@help_window.visible = false


end


end


#--------------------------------------------------------------------------


# * Start Actor Selection


#--------------------------------------------------------------------------


def start_actor_select


# Make actor arrow


@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)


@actor_arrow.index = @actor_index


# Associate help window


@actor_arrow.help_window = @help_window


# Disable actor command window


@actor_command_window.active = false


@actor_command_window.visible = false


end


#--------------------------------------------------------------------------


# * End Actor Selection


#--------------------------------------------------------------------------


def end_actor_select


# Dispose of actor arrow


@actor_arrow.dispose


@actor_arrow = nil


end


#--------------------------------------------------------------------------


# * Start Skill Selection


#--------------------------------------------------------------------------


def start_skill_select


# Make skill window


@skill_window = Window_Skill.new(@active_battler)


# Associate help window


@skill_window.help_window = @help_window


# Disable actor command window


@actor_command_window.active = false


@actor_command_window.visible = false


end


#--------------------------------------------------------------------------


# * End Skill Selection


#--------------------------------------------------------------------------


def end_skill_select


# Dispose of skill window


@skill_window.dispose


@skill_window = nil


# Hide help window


@help_window.visible = false


# Enable actor command window


@actor_command_window.active = true


@actor_command_window.visible = true


end


#--------------------------------------------------------------------------


# * Start Item Selection


#--------------------------------------------------------------------------


def start_item_select


# Make item window


@item_window = Window_Item.new


# Associate help window


@item_window.help_window = @help_window


# Disable actor command window


@actor_command_window.active = false


@actor_command_window.visible = false


end


#--------------------------------------------------------------------------


# * End Item Selection


#--------------------------------------------------------------------------


def end_item_select


# Dispose of item window


@item_window.dispose


@item_window = nil


# Hide help window


@help_window.visible = false


# Enable actor command window


@actor_command_window.active = true


@actor_command_window.visible = true


end


end
So I went down a bit and tried to create (methods?) code for Start_scene_equip and End_scene_equip. 5 hours of messing with the


code resulted in sytax error after syntax error, and that is when I decided I needed help. :(
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,293
Reaction score
11,878
First Language
English
Primarily Uses
RMMV
When you post code, please put it into code tags. It keeps it formatted correctly (easier to read) and stops the forum turning certain character combinations into smilies.


Yes, you'd need a start_scene_equip and end_scene_equip. Be careful how you write it - I don't see the methods in the code above, but you've spelled it two different ways in your post. Case is important - Start_Scene_Equip and Start_scene_equip are two different things. If you look at the method names, you'll see that NONE of them use capital letters. When you post stuff here, it's important to put EXACTLY what you have in your script. With just the information above, I would say you're getting the error because you've spelled it one way in the method name and another in the call to that method, and it couldn't find a method with a name that exactly matched what you put in the call. But that may not be the case. Maybe it just doesn't like you using capital letters for a method name.
 

Tiamat5774

Dragon Master (yes, I am a DM
Veteran
Joined
Jul 9, 2013
Messages
92
Reaction score
7
First Language
English
Primarily Uses
Thanks for the info both of you! Got the problem solved and can now equip in battle.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,293
Reaction score
11,878
First Language
English
Primarily Uses
RMMV
Glad you got it sorted. Next time you have a problem that's resolved, please use the Mark Solved button on the post that actually solves the problem, not on the one where you say it's solved. The reason for this is the post you "mark solved" appears at the top of the thread, so if anyone else has the problem they can just look at the final solution instead of having to read through the whole thing. A solution that says "it's solved" won't be very helpful to them :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Look, I get that it's illegal, but...
It just happen we got P7 as booth number, so i draw Girls Frontline's P7 in this
Stream will be live shortly! Going to start with some Minecraft spriting, and might switch mid-stream. Depends~ Feel free to drop by!
MushroomCake28 wrote on Finnuval's profile.
Glad to see you're back! I was wondering what you've become! It's been a while since we spoke to each other!
zachb wrote on Human_Male's profile.
I know this was months ago, but I don't completely understand the lunatic states program (how you set it up). I just want to apply a stone state (and death) to a character after x amount of time. Can you show me an example of how to set it up?

Forum statistics

Threads
93,469
Messages
912,756
Members
123,005
Latest member
Digimanthan
Top