Rename SP Script

Started by Griver03, June 12, 2011, 12:07:56 pm

Previous topic - Next topic

Griver03

June 12, 2011, 12:07:56 pm Last Edit: June 12, 2011, 12:57:55 pm by ForeverZer0
hi searching for a script to change the string of "SP" to "TP" or whatelse by "ClassID".
means warrior have tp and mage have mp...
the script by moghunter adds tp to every actor and not just rename the string, in his script actors have both...
i want just rename by classID is that possible ?

EDIT:
http://rmrk.net/index.php/topic,42164.0.html
this script can do this but its vx....
My most wanted games...



nathmatt

you can change all that in the database under system
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Griver03

June 12, 2011, 01:32:27 pm #2 Last Edit: June 12, 2011, 01:49:00 pm by Griver03
no just 1 i need for every class a specific string/vocab
sry when i confuse you ^^

edit: and sry that i forgot the [xp]  :shy:
My most wanted games...



brewmeister

Something like...    edit the ## Magic Users line to include the class ids of all magic user classes

class Window_Base
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    # Draw "SP" text string
    self.contents.font.color = system_color
    case actor.class_id
    when 7, 8  ## Magic Users
      sp_word = "SP"
    else
      sp_word = "TP"
    end
    self.contents.draw_text(x, y, 32, 32, sp_word)
    # Calculate if there is draw space for MaxSP
    if width - 32 >= 108
      sp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    # Draw SP
    self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
    # Draw MaxSP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
    end
  end
end

Griver03

thx this is great !
but can i ask you 2 things to add?
one is easy the other not ^^
first thing i want to use a color and maybe more than 2 strings

second thing is hard i believe to make it really a new state like i mogs script but every class have only the one i want not more.
this must have a ability to create items they restore the new points....
like i said this a bit harder...

youre in my credits and thx in advance
My most wanted games...



brewmeister

To use different colors for each string, just add a
self.contents.font.color = Color.new(255,0,0,255)  ## Red
statement under each sp_word = "" statement

To add another string, just add another 'when' statement

class Window_Base
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    # Draw "SP" text string
    self.contents.font.color = system_color
    case actor.class_id
    when 7, 8  ## Magic Users
      sp_word = "SP"
      self.contents.font.color = Color.new(255,0,0,255)  # Red
    when 9, 10  ## Something Else
      sp_word = "EP"
      self.contents.font.color = Color.new(0,255,0,255)  # Green
    else
      sp_word = "TP"
      self.contents.font.color = Color.new(0,0,255,255)  # Blue
    end
    self.contents.draw_text(x, y, 32, 32, sp_word)
    # Calculate if there is draw space for MaxSP
    if width - 32 >= 108
      sp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      sp_x = x + width - 48
      flag = false
    end
    # Draw SP
    self.contents.font.color = actor.sp == 0 ? knockout_color :
      actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
    # Draw MaxSP
    if flag
      self.contents.font.color = normal_color
      self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
      self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
    end
  end
end

[/quote]

I don't really understand the 2nd thing.  You want only certain items to restore SP, and others to restore TP?
You can do that with a common event for the healing/restoring items.
Not sure what you mean about "new state".  I haven't looked at MOG's script.

Griver03

thx again brewmeister (sag ma biste deutsch ?)
yeah i want that i have independent potions for mp,tp,ap and wtf else.
but i have the problem that i cant use common events in battle because i use gtbs tactical battle system which not allow common events, at least in battle...
so i need that by script  :huh:
thx in advance
My most wanted games...



brewmeister

I think what we need to do is talk to Gubid & see if we can't get a battle interpreter implemented so at least common events for skills & items will work.
Does GTBS use Troops?

Quote(sag ma biste deutsch ?)


1/16

Griver03

June 13, 2011, 11:04:56 am #8 Last Edit: June 13, 2011, 11:14:14 am by Griver03
yeah it works with troops.
i can ask in the gtbs thread of creation asylum, if you tell me what i should ask ?!
fixing that would be nice because i need a stealing system as well and it doesnt work for me beacuse i cant use common events...

edit: ok we need a battle interpreter for common events that will work in battle at least for skills and items ?!
edit2: i allready asked him but if you want heres a link to the thread:
http://www.creationasylum.net/forum/index.php?showtopic=20353&st=1560&gopid=331563&#entry331563
My most wanted games...



Griver03

ok gubid answered me

Quote
Yes, it uses troops. And yeah, I see what you mean. I can certainly update that to support them better.

This should do the trick. This should update common events, just like normal. Although, keep in mind a couple things. I do not stop a scene when running a common event. This meaning that if your event has message boxes and the like, they might be accompanied by other actors/enemies taking their turns etc. Why is this, because if I stopped, then parallel process event would stop the battle from happening. It can probably be implemented better, but this will suffice for now. Let me know if it doesnt work.

Heres the script he made:
Spoiler: ShowHide


#-------------------------------------------------------------------------------
# Common Event Patch for GTBS
#-------------------------------------------------------------------------------
class Scene_Battle_TBS
  #----------------------------------------------------------------------------
  # tbs_phase_9 - updated to refresh common events (allowing them to launch if needed)
  #----------------------------------------------------------------------------
  alias tbs_Phase_9_common_event_refresh tbs_phase_9
  def tbs_phase_9
    if @step == 5
      for common_event in @common_events
        common_event.refresh
      end
    end
    tbs_Phase_9_common_event_refresh
  end
  #----------------------------------------------------------------------------
  # Update Event Queue
  #----------------------------------------------------------------------------
  alias upd_evnt_q_com_fix update_event_queue
  def update_event_queue
   
    for common_event in @common_events
      common_event.update
    end
    upd_evnt_q_com_fix
  end
end

My most wanted games...



Griver03

thx brewmeister for your help but i asked LoganForrest if he will make an XP version of his Different SP notifications script, and he does !
so i think resolved...
My most wanted games...



Griver03

ok it is now resolved !
logan finished the XP version of his script  :naughty:
idk if he posted it allready public but whenyou can probably find it on rmrk.net
its called "LoganForrests' Different SP Notations Script (for RPG Maker XP)"
My most wanted games...