Actor Battler Replacement Script

Status
Not open for further replies.

ViperX420

Veteran
Veteran
Joined
Mar 28, 2014
Messages
62
Reaction score
23
First Language
English
Primarily Uses
Ok so i'm using holder's animated battler's and Victor Engine - Animated Battlers.

What i need done is this below.



normally what i do is place the note tag <battler name: FILENAME> in the actors notes and it calls the actor battler file so that it can use holders animated batters.

what i need done is the ability to put this same notetag in the armor section instead of the actors notes shown below.



this way when i equip any type of armor it will switch between the different battler graphics i have setup for the character shown below.



This is done with multiple characters in my game so a script setup just like this would be a great fix to my little problem.

Thanks in Advanced!

UPDATE: Problem solved by ShadowLurk

Victor Engine - Actors Battlers Add-on [Armor NoteTags]

Author : ShadowLurk

http://pastebin.com/w5bUPYLm

Other Scripts needed for this to run

- Victor Engine - Basic Module

- Victor Engine - Animated Battle

- Victor Engine - Actors Battlers

Note this script only works in-game and not in the test battle screen so keep that in mind before saying it doesn't work like i did. :)
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support (Scripts is for new script requests; support is for help with existing scripts). Please be sure to post your threads in the correct forum next time. Thank you.


Please add a link to the script.
 

ViperX420

Veteran
Veteran
Joined
Mar 28, 2014
Messages
62
Reaction score
23
First Language
English
Primarily Uses
I've moved this thread to RGSSx Script Support (Scripts is for new script requests; support is for help with existing scripts). Please be sure to post your threads in the correct forum next time. Thank you.

Please add a link to the script.
well technically i want a new script to work along side it thats why i posted it in that section but i'll post the other script all the same.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
No, that's not a new script. It's just a small tweak to the existing one :)


Are you only adding the note tag to specific pieces of armor? Only one slot? If not, have you considered what will/should happen if the actor is wearing two pieces of armor that both have the note tag?
 

ViperX420

Veteran
Veteran
Joined
Mar 28, 2014
Messages
62
Reaction score
23
First Language
English
Primarily Uses
No, that's not a new script. It's just a small tweak to the existing one :)

Are you only adding the note tag to specific pieces of armor? Only one slot? If not, have you considered what will/should happen if the actor is wearing two pieces of armor that both have the note tag?
yes each actor has their own type of armor class so you'll never run into 2 actors wearing same armor and its only for the chest piece that the note tag is being inserted. that way everything else like swords and stuff don't affect it only the chest piece itself will have any sort of notetags
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
The script you should be referring to is VE-ActorsBattlers, not VE-AnimatedBattlers.
 
And yes, you don't need to make a full script for this. A small piece of code is enough....
 

class Game_Actor < Game_Battler alias :change_equip_ve_ab_x :change_equip def change_equip(*args) change_equip_ve_ab_x(*args) self.battler_name = actor_battler_name armors.each {|armor| if armor.note =~ /<BATTLER NAME: ([^><]*)>/i self.battler_name = $1.to_s end if armor.note =~ /<BATTLER HUE: ([^><]*)>/i self.battler_hue = $1.to_i end } end endNow you can use those tags in armors~
 

ViperX420

Veteran
Veteran
Joined
Mar 28, 2014
Messages
62
Reaction score
23
First Language
English
Primarily Uses
The script you should be referring to is VE-ActorsBattlers, not VE-AnimatedBattlers.

And yes, you don't need to make a full script for this. A small piece of code is enough....

class Game_Actor < Game_Battler alias :change_equip_ve_ab_x :change_equip def change_equip(*args) change_equip_ve_ab_x(*args) self.battler_name = actor_battler_name armors.each {|armor| if armor.note =~ /<BATTLER NAME: ([^><]*)>/i self.battler_name = $1.to_s end if armor.note =~ /<BATTLER HUE: ([^><]*)>/i self.battler_hue = $1.to_i end } end endNow you can use those tags in armors~
so do i just paste that over what was previously in that section? sorry i'm still new to Ruby scripting, but i'm trying to learn so all info helps with the learning process :)
or paste it in between like this below

Code:
#==============================================================================# ** Game_Actor#------------------------------------------------------------------------------#  This class handles actors. It's used within the Game_Actors class# ($game_actors) and referenced by the Game_Party class ($game_party).#==============================================================================class Game_Actor < Game_Battler  #--------------------------------------------------------------------------  # * Equipment Battler Switch  #--------------------------------------------------------------------------  alias :change_equip_ve_ab_x :change_equip  def change_equip(*args)    change_equip_ve_ab_x(*args)    self.battler_name = actor_battler_name    armors.each {|armor|      if armor.note =~ /<BATTLER NAME: ([^><]*)>/i        self.battler_name = $1.to_s      end      if armor.note =~ /<BATTLER HUE: ([^><]*)>/i        self.battler_hue = $1.to_i      end    }  end  end  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_accessor :screen_x                 # Coordenada X na tela  attr_accessor :screen_y                 # Coordenada Y na tela  #--------------------------------------------------------------------------  # * Alias method: setup  #--------------------------------------------------------------------------  alias :setup_ve_actor_battlers :setup  def setup(actor_id)    setup_ve_actor_battlers(actor_id)    @battler_name = actor_battler_name    @battler_hue  = actor_battler_hue  end  #--------------------------------------------------------------------------  # * Aquisição do índice do herói  #--------------------------------------------------------------------------  def index    $game_party.members.index($game_actors[@actor_id])  end  #--------------------------------------------------------------------------  # * Overwrite method: use_sprite?  #--------------------------------------------------------------------------  def use_sprite?    return true  end  #--------------------------------------------------------------------------  # * Overwrite method: screen_z  #--------------------------------------------------------------------------  def screen_z    return 100  end  #--------------------------------------------------------------------------  # * New method: actor_battler_name  #--------------------------------------------------------------------------  def actor_battler_name    actor.note =~ /<BATTLER NAME: ([^><]*)>/i ? $1.to_s : ""  end  #--------------------------------------------------------------------------  # * New method: actor_battler_hue  #--------------------------------------------------------------------------  def actor_battler_hue    actor.note =~ /<BATTLER HUE: (\d+)>/i ? $1.to_i : 0  end  #--------------------------------------------------------------------------  # * New method: battler_name  #--------------------------------------------------------------------------  def battler_name=(name)    @battler_name = name if name.is_a?(String)  end  #--------------------------------------------------------------------------  # * New method: battler_hue  #--------------------------------------------------------------------------  def battler_hue=(hue)    @battler_hue = hue if hue.numeric?  end  #--------------------------------------------------------------------------  # * New method: screen_x  #--------------------------------------------------------------------------  def screen_x    setup_x  end  #--------------------------------------------------------------------------  # * New method: screen_y  #--------------------------------------------------------------------------  def screen_y    setup_y  end  #--------------------------------------------------------------------------  # * New method: setup_x  #--------------------------------------------------------------------------  def setup_x    case $game_custom_formation    when :front  then position = get_frontal_x    when :side   then position = get_sideview_x    when :iso    then position = get_isometric_x    when :custom then position = $game_custom_positions[index + 1][:x]    end    position + $game_position_adjust[:x]  end  #--------------------------------------------------------------------------  # * New method: setup_y  #--------------------------------------------------------------------------  def setup_y    case $game_custom_formation    when :front  then position = get_frontal_y    when :side   then position = get_sideview_y    when :iso    then position = get_isometric_y    when :custom then position = $game_custom_positions[index + 1][:y]    end    position + $game_position_adjust[:y]  end  #--------------------------------------------------------------------------  # * New method: get_frontal_x  #--------------------------------------------------------------------------  def get_frontal_x    if VE_BATTLE_CENTRALIZE      size = $game_party.battle_members.size      position = (index + 1) * Graphics.width / (size + 1)    else      size = $game_party.max_battle_members      position = index * Graphics.width / size + 64    end    position  end  #--------------------------------------------------------------------------  # * New method: get_frontal_y  #--------------------------------------------------------------------------  def get_frontal_y    Graphics.height - 16  end  #--------------------------------------------------------------------------  # * New method: get_sideview_x  #--------------------------------------------------------------------------  def get_sideview_x    if VE_BATTLE_CENTRALIZE      size = $game_party.max_battle_members      x    = dist[:x] / 8      position = -index * (index * x - x * size) + Graphics.width - 160    else      position = index * dist[:x] + Graphics.width - 192    end    position  end  #--------------------------------------------------------------------------  # * New method: get_sideview_y  #--------------------------------------------------------------------------  def get_sideview_y    if VE_BATTLE_CENTRALIZE      size   = $game_party.battle_members.size      height = Graphics.height      position = (index - size) * dist[:y] + size * dist[:y] / 2 + height - 160    else      position = index * dist[:y] +  Graphics.height - 200    end    position  end  #--------------------------------------------------------------------------  # * New method: get_isometric_x  #--------------------------------------------------------------------------  def get_isometric_x    if VE_BATTLE_CENTRALIZE      position = -index * (index * dist[:x] - 32) + Graphics.width - 160    else      position = index * dist[:x] +  Graphics.width - 192    end    position  end  #--------------------------------------------------------------------------  # * New method: get_isometric_y  #--------------------------------------------------------------------------  def get_isometric_y    if VE_BATTLE_CENTRALIZE      position = index * (dist[:y] - index * 6) + Graphics.height - 160    else      position = Graphics.height - 96 - index * dist[:y]    end    position  end  #--------------------------------------------------------------------------  # * New method: dist  #--------------------------------------------------------------------------  def dist    VE_DISTANCE_ADJUST  endend
 
Last edited by a moderator:

ShadowLurk

Tanoshii~
Veteran
Joined
Feb 14, 2014
Messages
226
Reaction score
53
Primarily Uses
Uh, no. Just put it in a new script page below that script. Just like any regular scripts. :)
 
Last edited by a moderator:

ViperX420

Veteran
Veteran
Joined
Mar 28, 2014
Messages
62
Reaction score
23
First Language
English
Primarily Uses
Uh, no. Just put it in a new script page below that script.
alright that solved the first error now what are the exact note tags i use in the notes section?

<BATTLER NAME: FILENAME>

<BATTLER HUE: FILENAME>

am i correct from what i read above? cause its not working for me right now
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I have put your code into spoilers to stop it taking up so much room. There is no need to paste the entire script here if you have given a link to it already.


My question was not whether two actors will have the same armor. It was whether ONE actor could be equipped with MORE than one piece of armor that has the tag.


Post a screenshot of your armor showing how the file names are set up.


Did you HAVE it working when you just had the note tags on the actors? I wonder if spaces or unusual characters (not letters or numbers) in the filename might cause issues? Do you ONLY have the tag on the appropriate pieces of armor, or do you have it on all of them with no filename specified? (if you do, remove it from the ones that don't affect the graphic).


Also, are you playing a saved game, or are you starting a new one since the script change? Have you actually gone in and changed their equipment? That's the method that causes the battler sprite to change. If you haven't changed it since adding the script, then it will still have the sprite as at the last save.
 
Last edited by a moderator:

ViperX420

Veteran
Veteran
Joined
Mar 28, 2014
Messages
62
Reaction score
23
First Language
English
Primarily Uses
I have put your code into spoilers to stop it taking up so much room. There is no need to paste the entire script here if you have given a link to it already.

Post a screenshot of your armor showing how the file names are set up.

Did you HAVE it working when you just had the note tags on the actors? I wonder if spaces or unusual characters (not letters or numbers) in the filename might cause issues?
that was from a completely different script he mentioned i took just the area i was talking about not the entire script to give as example and i forgot to set that as spoiler.

Yes it worked in Actor written like this <battler namer: Kirito> but i doesnt seem to work at all in armor i've been flipping back a forth to see the difference and see if there is something missing but i'm still new to this so i can't see the problem yet.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
screenshot of your armor tab, please.


It can't have been working with that line you just wrote, because you wrote


<battler namer: Kirito>


See why screenshots are better than you just telling us? If it doesn't work because of a typo you've made, and you don't make the same typo when you retype it, we'll never figure it out. And on the other hand, if you do make a typo when you put it here (as you've just done), we'll pick that up as the problem when it really isn't.


And what about the other questions I asked?


Please don't quote people when you're replying immediately after them.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I added more to my last post while you were providing that. You didn't answer the other questions I asked previously. Answers to those would be helpful in figuring out where to look (or not to look) next.


Your actor actually HAS those clothes equipped? Can you unequip and re-equip them?
 
Last edited by a moderator:

ViperX420

Veteran
Veteran
Joined
Mar 28, 2014
Messages
62
Reaction score
23
First Language
English
Primarily Uses
ok im testing it in the troops section not in game that way i don't have to wait for a battle to test it i can test it with rpg makers test battle engine.

next i didn't write <battler namer: Kirito> it was <battler name: Kirito>  which is a direct copy from actor and it works on it but when i take it off actor it won't work with armor equipped then i tried with actor on 1 set then tried having armor switch to a new set but didn't work it just showed initial armor from actor.

Next only chest armor will have tags and they are class specific and the way i set it up each actor has his own class named after them so no 2 players will be able to wear each others chest plate. Swords and stuff is interchangeable but that doesn't effect it and neither will any other armor pieces cause only the chest piece is being tagged with note tags.

Video of what is happening and what i've done.

https://www.youtube.com/watch?v=o8JMTZ_vPcM&feature=youtu.be

starting a newgame and seeing if i un-equip it then equip it if it will work

EDIT: well i'll be damned that is it lmao so apperently this only works in-game and not on the test menu i can live with that it works thank you guys.

sorry remember i'm still new to these things, but i understand exactly why it worked there and why not in test its cause of the if variable in his code that waits for you to actually equip something before it actually runs the code otherwise if he starts with it it does nothing *smacks forehead* well at least i understand more about the code he provided now thanks for your time guy's and case solved!
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
No, this is what it is ...


When you make changes to scripts, you have to save your game in the editor so the script changes will take effect. If you don't save in the editor, any changes in your scripts will not be applied. When you PLAY a game from the editor, it pops up the box asking if you want to save your changes first, and usually you say yes. When you do a battle test, you don't get asked to save, and it doesn't do it automatically. So any changes to scripts that have been made since the last time you saved in the editor will not take effect in battle tests. If you just want to do battle tests, make sure you manually save first :)


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top