Ruby/RGSSx questions that don't deserve their own thread

Okay, thanks for this. its a big help.  BD
Okay now I've looked this up, but can't seem to find anything on this, or perhaps I'm just not looking hard enough?

Anyway, I'm trying to re-position Battle Status gauges.  I've checked Window_BattleStatus and I get the basic understanding of it, however when I check other scripts, this kinda flys over my head.  First off, how is x,y of a gauge determined (or better way to put it, how is it read to be positioned in a certain place), along with width and height?

To better help me through this, I'm using Yanfly's Battle script with Syvkal's Menu Bars.  The way the gauges are showing in battle is totally wrong and I'd like to fix them.  I'm not looking for someone to do it for me, I'd like some direction on what to look for and how this is all determined and figured out so I can make a mini-script, I suppose.

Script links:

http://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/

http://forums.rpgmakerweb.com/index.php?/topic/840-syvkals-menu-bars-vxace/

Anyway, thanks for any insight I can get on this.  I'm learning Ruby (slowly) by actually looking at scripts and determining what everything does and how it's all linked together, not just user scripts, but also plain RGSS3 and looking at the manual.
Looking for a way to add additional weapon type requirements to a skill.

I assumed that I could use wtype_equipped?(x) to define more but I got an error in battle when I did this.

The code block below comes from Game_Actor

Code:
  def skill_wtype_ok?(skill)    wtype_id1 = skill.required_wtype_id1    wtype_id2 = skill.required_wtype_id2    return true if wtype_id1 == 0 && wtype_id2 == 0    return true if wtype_id1 > 0 && wtype_equipped?(wtype_id1)    return true if wtype_id2 > 0 && wtype_equipped?(wtype_id2)    return false  end
What was the code you used, and what error did you get?
I was using Yanfly's Skill Restriction script that has a section for small script snippets

<restrict eval>

wtype_equipped?(2)

</restrict eval>

The error was...

Script 'Skill Restrictions YF' line 762: NoMethodError occurred.

undefined method `wtype_equipped?' for #<Game_Enemy:0x8ce1b7c>

 

Going on a limb here but I'm assuming I need more than that small snippet to pull out the proper method to restrict weapon types this way.
Game enemies don't have weapons.
say I add a script and get an error 

ddddd10.png


which is the line for script eval.

Does that mean it's having problems reading a script or what? Could someone please explain some for me.

#Note

I am trying to add MogHunter's BattleBack_Ex to my Modified Symphony Engine for reference.
The line number just means it crashed inside a script box within an event. Those are run in an eval on line 1411, so that's where the error happens. It doesn't tell you where specifically in the calls it broke, just at the root of it. If you want it to give you a line number for your error, then you'll probably have to call it through a script from the script editor. As in, make a script in the editor that calls what's in the script box. For exameple:

module Input if trigger?🙂Z) ~scriptbox contents go here~ endendThat should work better for you and give you an actual error with a line number.

What the error means, though, is that whatever object is calling '.clear'(probably a bitmap, that will clear anything off of it) isn't assigned. It's nil, ruby's 'nothing' variable. If something is nil, it doesn't exist. The scripts are trying to call 'clear' on something that doesn't exist, so it can't do that. It gives you an error about trying.
So where do I put that in at? Do i put the script i need to test in the script box area??

edit- So I found two lines that read

$game_system.bb2.clear 

that is the only place clear is used. Would clear need to be deined?
Trying to set the Initial MP of all actors to a variable set in <initial mp: x> but it crashes in battle due to...

Note: The RegExp works fine, I'm guessing I don't have the latter half of the script written up right

---------------------------

Script 'Initial MP' line 20: NoMethodError occurred.

 

undefined method `*' for nil:NilClass

---------------------------

 

Code:
module RPG  class Actor < BaseItem    def initial_mp      return @initial_mp unless @initial_mp.nil?      get_initial_mp      return @initial_mp    end        def get_initial_mp      regex_initial_mp = /<initial[-_ ]?mp:\s*(\d+)\s*>/i      #Default Initial MP should be 28%      @initial_mp = self.note =~ regex_initial_mp ? $1.downcase : "28"     end  end  endclass Game_Battler < Game_BattlerBase  #  def init_mp    self.mp = self.mmp * (@initial_mp * 0.01)  end  #  alias_method :mp_battle_start, :on_battle_start  def on_battle_start    for actor in $game_party.members      #Take the actors MP and sets it to x * Max MP      #where x is <initial mp: x> * 0.01      self.mp = init_mp    end  endend
I got it to work!!! The clear was errored out due to the fact that the note tags were using 

bb1(nil)bb2(1,0,10)$game_system.transition_ex = 1as the opening for the script call transition to the battleback_ex effects

I changed it to 

bb1(0,0,0)bb2(1,0,10)$game_system.transition_ex = 1to use zero values for the variables instead of the nil.

(I was using MogHunters Battleback_Ex 1.3 and his Battle Transitions Scripts for future members who use these scripts and encounter a similar issue)

damn I just ran into the 

undefined method `*' for nil:NilClasserror.

Thought that was the multiply symbol??
Trying to set the Initial MP of all actors to a variable set in <initial mp: x> but it crashes in battle due to...

Note: The RegExp works fine, I'm guessing I don't have the latter half of the script written up right

---------------------------

Script 'Initial MP' line 20: NoMethodError occurred.

undefined method `*' for nil:NilClass

---------------------------

module RPG class Actor < BaseItem def initial_mp return @initial_mp unless @initial_mp.nil? get_initial_mp return @initial_mp end def get_initial_mp regex_initial_mp = /<initial[-_ ]?mp:\s*(\d+)\s*>/i #Default Initial MP should be 28% @initial_mp = self.note =~ regex_initial_mp ? $1.downcase : "28" end end endclass Game_Battler < Game_BattlerBase # def init_mp self.mp = self.mmp * (@initial_mp * 0.01) end # alias_method :mp_battle_start, 😮n_battle_start def on_battle_start for actor in $game_party.members #Take the actors MP and sets it to x * Max MP #where x is <initial mp: x> * 0.01 self.mp = init_mp end endend
initial_mp is a method, not a variable, so you should use initial_mp, not @initial_mp. I would also question where you should just use @mmp instead of self.mmp
What the heck is a type error?

wtc10.png
A type error means you're trying to do something with two operands that are of a different type. One of them is an integer, and the other is nil. Since it's nil, the problem probably occurred a bit further back - either the method is being called at the wrong time, or whatever the non-integer operand is, it's not being initialized properly.


May I suggest, since you seem to be having so many problems with these scripts, that you actually start a thread to request help to get the script working?
I have two events with an Autorun trigger, and both have their conditions met for starting. Both Events do the same thing: Print out a unique message ("Message 1" and "Message 2"), and nothing else.

What I'm currently seeing is that the first Autorun event to execute loops forever.

How could I set the Events up so that the first autorun event yields to the next one after completion, which in turn yields back to the first, and so on?

I grafted the following functions onto Game_Interpreter and Game_Event, and it's doing what I wanted, but I don't think this is the best approach. More questions after the code.

class Game_Interpreter def run wait_for_message while @list[@index] do execute_command @index += 1 end Fiber.yield @fiber = nil get_character(@event_id).yield_event_trigger_auto endendclass Game_Event def yield_event_trigger_auto clear_starting_flag if @trigger == 3 endendSo right, forcing the starting property off in the Interpreter is causing the behavior that I want; however, I've only had this since Thursday and I'm not really sure how the update loop is structured. I'm under the impression that the Game_map object is what ultimately loops through its event lists and causes them to execute, and it looks like it does this by associating them with its internal Interpreter object and then running THAT. 

If this is the case, the process used for grabbing events that need run should be setting the starting flag to off after it feeds them to the Interpreter, so my modification shouldn't be necessary (unless Autorun events have their starting flag set to ON somewhere else, or preempting the event selection process in Game_map).
This is not a Ruby/RGSSx question. Please post your question in the appropriate forum.


They are doing exactly what they're meant to be doing. Read the latest blog article on setting up cutscenes (which is what you're doing).
Sorry, I didn't ask that clearly. I'm not asking about how Autorun events work, I was asking about whether the Interpreter class was the appropriate class to modify if I wanted to alter the default Autorun event processing, or if I wanted to change something in either the Game_map or Game_event classes (and, by extension, why calling clear_starting_flag from the interpreter causes the Autorun event to yield execution, while calling it from Game_map does not). 
How an event should run should be determined by the event itself. The interpreter simply executes instructions.
How can I split the actors  and the commands into there own separate windows in the window_battlestatus?

Examples:

Go from this:

to this

You can ignore the details and everything else 

I just mean the concept of splitting the windows up

where each actor has its own window

and each command has its own window

I have no clue where I would post this I didnt think it deserved its own thread though. 

If anyone would be kind enough to help that would be great!

p.s a semi - newbie

I can write out the values and all for the text and faces but again how do I turn the dbs

into its own windows for everything.

sorry for repeating my question 3 times

Thanks for reading this and/or responding! 🙂
This question does not belong here - it's an entire rewrite of several scripts, not a "question that does not deserve its own thread". You have also asked this question elsewhere. Please do not post the same question in multiple locations. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/