Kain Nobel
Member
Good day everybody!
This headache topic is resolved, anybody interested to know what was wrong, Aleworks overwrote the Array method, 'insert', which caused it not to work correctly. I'm contacting vgvgf and letting him know of the errors existance, thanks to everyone who contributed their time and help.
I'll leave the topic intact for anybody who needs to read up on it for any reason.
This headache topic is resolved, anybody interested to know what was wrong, Aleworks overwrote the Array method, 'insert', which caused it not to work correctly. I'm contacting vgvgf and letting him know of the errors existance, thanks to everyone who contributed their time and help.
I'll leave the topic intact for anybody who needs to read up on it for any reason.
I need a little bit of help, what I'm trying to do is create a Steal/Mug system, but I've ran into some headbutts with it. Well, first off, I started with the easier part, implementing "Mug" in Game_Battler#attack_effect and into the Battle @actor_command_window (so that it replaces "Attack" if your actor has a "Mug" skill).
What I'm working on now, isn't Mug anymore, because Mug is done and over with, now I am onto "Steal". What I want to do with "Steal" (which is typically the same for "Mug") is to be able to set up a Skill that represents it. Whenever an actor has this skill, first of all I want it to be inserted between "Skill" and "Defend", but... its not inserting at all.
Yes, I did a print test and it did return true for "p actor.has_steal?" and false for "p actor.has_mug?", so I know that part is working fine... but, the commands still remain the default "Attack, Skill, Defend, Item". Further print test reveals that its even executing process of changing the commands, yet... the print test (and the command window) still show the default 4 commands and not Command "Steal". Is it possible that the Array.insert() function is obsolete?
To sum it all up, I want the commands to be like so (if you don't have Mug but have Steal)...
Attack
Skill
Steal
(Other things that could go here later...)
Defend
Item
How the heck can I get ["Attack", "Skill", "Steal", ...whatever, "Defend", "Item"] like I'm trying to do? I'm trying to avoid everything being underneath Item, because people might not otherwise know its there. It works doing commands.push... doesn't work with commands.insert(2, command)...
EDIT: Y'know what, after rigorous print tests... I just realised stupid Array.insert doesn't even work on RGSS! @_@ Am I just going crazy or anybody else notice that too?
What I'm working on now, isn't Mug anymore, because Mug is done and over with, now I am onto "Steal". What I want to do with "Steal" (which is typically the same for "Mug") is to be able to set up a Skill that represents it. Whenever an actor has this skill, first of all I want it to be inserted between "Skill" and "Defend", but... its not inserting at all.
Code:
#-----------------------------------------------------------------------------
# * Phase 3 : Setup Command Window
#-----------------------------------------------------------------------------
def phase3_setup_command_window
steal_scnbtlp3_setup_command_window
actor = $game_party.actors[@actor_index]
if actor.has_mug?
unless @steal_command_set
@steal_command_set = true
commands = @actor_command_window.commands.dup
commands[0] = SDK::Scene_Commands::Scene_Battle::Mug
@actor_command_window.commands = commands
end
elsif actor.has_steal?
unless @steal_command_set
@steal_command_set = true
commands = @actor_command_window.commands.dup
commands.insert(2, SDK::Scene_Commands::Scene_Battle::Steal)
#commands << SDK::Scene_Commands::Scene_Battle::Steal
@actor_command_window.commands = commands
end
end
end
Yes, I did a print test and it did return true for "p actor.has_steal?" and false for "p actor.has_mug?", so I know that part is working fine... but, the commands still remain the default "Attack, Skill, Defend, Item". Further print test reveals that its even executing process of changing the commands, yet... the print test (and the command window) still show the default 4 commands and not Command "Steal". Is it possible that the Array.insert() function is obsolete?
To sum it all up, I want the commands to be like so (if you don't have Mug but have Steal)...
Attack
Skill
Steal
(Other things that could go here later...)
Defend
Item
How the heck can I get ["Attack", "Skill", "Steal", ...whatever, "Defend", "Item"] like I'm trying to do? I'm trying to avoid everything being underneath Item, because people might not otherwise know its there. It works doing commands.push... doesn't work with commands.insert(2, command)...
EDIT: Y'know what, after rigorous print tests... I just realised stupid Array.insert doesn't even work on RGSS! @_@ Am I just going crazy or anybody else notice that too?