Personal graph by actor
#1
Hi there,

I am using Add-On: HP/SP/TP/EXP Meter (REVISED FOR ACBS)of Atoa Custom Battle System.

Is there a way to change graph image from HP/SP/TP/EXP Meter to Actor ID?



[Image: attachment.php?aid=1603]




The image is an example. I want to decorate the battle window with a warrior with a green SP graph, a priest with a yellow CP graph, and a wizard with a blue MP graph.

Each actor succeeded in changing the SP name. Shocked

    If Actor.name != "Hilda"
        ;Another
        self.contents.draw_text(x + 1, y + 4, 32, 32, "MP")
    End

Now all you need to do is figure out how to change the graph image with the Actor ID.
I'm sorry to come here often and ask questions, but can you help me?

((Related article))
ACBS-ATOA Custom Battle System (https://save-point.org/thread-2136.html)
ACBS - Atoa Custom Battle System and TP System: https://save-point.org/thread-8381.html








DerVV translating from Korean to English



Hi there,



I am using Add-On: HP/SP/TP/EXP Meter (REVISED FOR ACBS)of Atoa Custom Battle System.



Is there a way to change graph image from HP/SP/TP/EXP Meter to Actor ID?



[Image: attachment.php?aid=1603]



The image is an example. I want to decorate the battle window with a warrior with a green SP graph, a priest with a yellow CP graph, and a wizard with a blue MP graph.



Each actor succeeded in changing the SP name. Shocked



    If Actor.name != "Hilda"

        ;Another

        self.contents.draw_text(x + 1, y + 4, 32, 32, "MP")

    End



Now all you need to do is figure out how to change the graph image with the Actor ID.

I'm sorry to come here often and ask questions, but can you help me?



((Related article))

ACBS-ATOA Custom Battle System (https://save-point.org/thread-2136.html)

ACBS - Atoa Custom Battle System and TP System: https://save-point.org/thread-8381.html


Attached Files
.png   K-20211021-668727.png (Size: 199.3 KB / Downloads: 40)
Reply }
#2
Welcome back.  Long time no see!!!  Winking with a tongue sticking out

I took more time translating your post from Korean to English than I did figuring this out.

So you just want the "SP" for your default points to change based on the actor?  THAT'S EASY!!!!  Just a case of knowing where it is!!!

Now, normally you would go to the Window_Base class to alter the 'draw_actor_sp' method.  But Vic rewrote that with his battlesystem.  You will find that it is in the Battle Windows script ....  WHICH I UPGRADED FOR YOU to add the TP points. So where I suggest will be based upon the new script. 

In the Battle Windows script, you will find the draw_actor_sp method begin on line 290.  To be more specific, that is where the 'alias' command begins for that method.  With that, you will find the offending statement.....

self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)

...on line 297.  It is here where simple magic can be made.


Now I just made this little bit of code... and it replaces the line on 297 itself, though it of course utilizes the same draw_text command.

Code:
      # CHANGE BEGINS HERE---------------------------------------------------
      sp_replace = "SP"
      case actor.id
      when 2; sp_replace = "MP"
      when 4; sp_replace = "CP"
      end
      self.contents.draw_text(x, y, 32, 32, sp_replace)
      # CHANGE ENDS HERE ----------------------------------------------------
This replaces the original line on 297, and should look like this in your script.


Code:
      self.contents.font.color = system_color
      self.contents.font.name = SP_Text[2]
      self.contents.font.size = SP_Text[3]
      self.contents.font.bold = SP_Text[4]
      # CHANGE BEGINS HERE---------------------------------------------------
      sp_replace = "SP"
      case actor.id
      when 2; sp_replace = "MP"
      when 4; sp_replace = "CP"
      end
      self.contents.draw_text(x, y, 32, 32, sp_replace)
      # CHANGE ENDS HERE ----------------------------------------------------
      if width - 32 >= 108
        sp_x = x + width - 108
        flag = true
      elsif width - 32 >= 48
        sp_x = x + width - 48
        flag = false
      end


It is keyed to use the Actor's ID rather than the actor's name.  Any changes/additions to the list of actors with alternate versions of SP will need to be done here.

And note you can do a variation above with the HP stats, or further down with the TP system replacing the line that references the MOG::TP_NAME value.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#3
(10-21-2021, 04:24 PM)DerVVulfman Wrote: Welcome back.  Long time no see!!!  Winking with a tongue sticking out

I took more time translating your post from Korean to English than I did figuring this out.

So you just want the "SP" for your default points to change based on the actor?  THAT'S EASY!!!!  Just a case of knowing where it is!!!

Now, normally you would go to the Window_Base class to alter the 'draw_actor_sp' method.  But Vic rewrote that with his battlesystem.  You will find that it is in the Battle Windows script ....  WHICH I UPGRADED FOR YOU to add the TP points. So where I suggest will be based upon the new script. 

In the Battle Windows script, you will find the draw_actor_sp method begin on line 290.  To be more specific, that is where the 'alias' command begins for that method.  With that, you will find the offending statement.....

self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)

...on line 297.  It is here where simple magic can be made.


Now I just made this little bit of code... and it replaces the line on 297 itself, though it of course utilizes the same draw_text command.

Code:
      # CHANGE BEGINS HERE---------------------------------------------------
      sp_replace = "SP"
      case actor.id
      when 2; sp_replace = "MP"
      when 4; sp_replace = "CP"
      end
      self.contents.draw_text(x, y, 32, 32, sp_replace)
      # CHANGE ENDS HERE ----------------------------------------------------
This replaces the original line on 297, and should look like this in your script.


Code:
      self.contents.font.color = system_color
      self.contents.font.name = SP_Text[2]
      self.contents.font.size = SP_Text[3]
      self.contents.font.bold = SP_Text[4]
      # CHANGE BEGINS HERE---------------------------------------------------
      sp_replace = "SP"
      case actor.id
      when 2; sp_replace = "MP"
      when 4; sp_replace = "CP"
      end
      self.contents.draw_text(x, y, 32, 32, sp_replace)
      # CHANGE ENDS HERE ----------------------------------------------------
      if width - 32 >= 108
        sp_x = x + width - 108
        flag = true
      elsif width - 32 >= 48
        sp_x = x + width - 48
        flag = false
      end


It is keyed to use the Actor's ID rather than the actor's name.  Any changes/additions to the list of actors with alternate versions of SP will need to be done here.

And note you can do a variation above with the HP stats, or further down with the TP system replacing the line that references the MOG::TP_NAME value.




uh...?
I obviously used a translator to post in English, but did it come out in Korean? Why...? Ah... is this my mistake?  Shocked Shocked Shocked Shocked
I'm really sorry. I made a stupid mistake...

Ummm... First of all, thanks for the reply.  Very cheery
Thanks for the expert advice on how to rename actors by name! The script I wrote was very rudimentary... (XD...)



I'm very sorry, but what I was asking for help was how to change the image of the graph to a file.
Yes, in the HP/SP/TP/EXP Meter (REVISED FOR ACBS) script ((https://save-point.org/thread-8381.html))

  HP_Meter = 'HPMeter' # Name of the HP meter graphic file
  SP_Meter = 'SPMeter' # Name of the SP meter graphic file
  TP_Meter = 'TPMeter' # Name of the TP meter graphic file
  EXP_Meter = 'EXPMeter' # Name of the EXP meter graphic file

this part!
I hope the graph file for this part is different for each actor.
For each actor ID, a warrior using a green SP graph image, a priest using a yellow SP graph image, a wizard using a blue SP graph image...
Yes, my explanation was lacking, which made it cumbersome. I am really sorry


((Related article)) Sweat
ACBS-ATOA Custom Battle System (https://save-point.org/thread-2136.html)
ACBS - Atoa Custom Battle System and TP System: https://save-point.org/thread-8381.html
Reply }
#4
Oh oh oh.... the colored meter bar you want altered as well.    The image you provided (below) did show that the Actors did have differing options for SP, the Gloria and Hilda actors having CP and SP in the example.
[Image: attachment.php?aid=1603]

That and your post contained (once translated)

Quote:Each actor succeeded in changing the SP name. [Image: shocked.gif]

If Actor.name != "Hilda"
;Another
self.contents.draw_text(x + 1, y + 4, 32, 32, "MP")
End


I guess I neglected to notice the bar itself was different for each.  Well, the edit... THIS time... will be in the subsequently replaced HP/SP/TP Meter replacement script you just received.  And it is actually quite similar.

In the meter script, you will find the draw_actor_sp method begin on line 93.  To be more specific, that is where the 'alias' command begins for that method.  With that, you will find the offending statement.....

@skin = RPG::Cache.windowskin(SP_Meter)

...on line 97.  It is here where simple magic can be made.

(Um, yeah... I actually COPY/PASTED THE ABOVE EXPLANATION FROM YESTERDAY'S POST!) Laughing

Now I just made this little bit of code... and it replaces the line on 97 itself, though it of course utilizes the same RPG::Cache command.


Code:
    # CHANGE BEGINS HERE---------------------------------------------------
    sp_replace = "SP_Meter"
    case actor.id
    when 2; sp_replace = "Gold_Meter"
    when 4; sp_replace = "Blue_Meter"
    end
    @skin = RPG::Cache.windowskin(sp_replace)
    # CHANGE ENDS HERE ----------------------------------------------------

Now, you may be thinking "What the?  Is this the same code?"  Basically yes!  Since this too alters the draw_actor_sp method as the previous reply, it too can use the actor ID.  And this just substitutes the SP_Meter string used when generating the windowskin much like replacing the "SP" string in the previous.

So this took even LESS time for me than before...   And again, you can use this for the above HP, or below TP and EXP bars.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#5
ah ha ha ha...

Looking at DerVVulfman's code, I knew I needed a lot of study. 
(I was thinking in a difficult direction. In fact, it was a little embarrassing because it was a very simple method. Sweat Sweat Sweat )

The code works just as I wanted it to! thank you! Blushing + Cheery Very cheery Blushing + Cheery Very cheery
Winter is coming soon. Take Care of yourself  Very cheery
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Actor names in Quest Script jreagan406 5 8,645 03-07-2017, 08:06 AM
Last Post: JayRay
   Actor Graphic/Reflection Refuses to Update/Refresh penguwin 6 9,815 11-06-2014, 09:51 PM
Last Post: penguwin
  Attack from an enemy to a actor as condinitional branch Djigit 7 10,051 07-05-2014, 06:58 PM
Last Post: Djigit
   Modifying Actor ID to Class ID for Advanced Individual Battle Commands Script NewHope 1 4,637 07-11-2012, 11:37 PM
Last Post: NewHope
   Repositioning the actor command window. MegaPowerNinja 4 9,399 04-12-2011, 05:21 AM
Last Post: MegaPowerNinja
   [RMXP] Actor Cloning dagarath 2 9,177 03-08-2011, 07:18 AM
Last Post: dagarath
   Ring Menu + Actor Train? Other party members dissapear... Shadowgaz 2 6,344 05-19-2009, 01:35 PM
Last Post: Shadowgaz
   How to check if actor has certain stat(s) with RGSS? Twin Matrix 4 9,771 01-04-2009, 05:35 PM
Last Post: Twin Matrix



Users browsing this thread: 1 Guest(s)