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

I'm using a script by DiamondandPlatinum3 called "Common Event: Menu Option" Is there a way to make duplicate occurrence of it by changing something in the script? It calls a common event. Id like to use Xail's Records Script and also create a world map scene through common eventing. 
Can you please post this in a new thread, provide a link to the scripts, and give more detail about what you want it to do? Since you don't explain any of the scripts and what they do, I'm not really sure what you're asking for ("a duplicate occurrence" of what?), and suspect it might be more detailed than this thread is intended for.
I am trying to determine, in Game_Battler.make_damage_value, if the user and target of an item are of different classes (one Game_Enemy and one Game_Actor).


Normally, I'd use user.class != self.class


but while an enemy's class returns Game_Enemy, an actor's class doesn't return Game_Actor - it returns the RPG::Class object (from the Classes tab in the database) of that actor.


So the long way to do what I want would be this:

if (user.is_a?(Game_Enemy) && self.is_a?(Game_Actor)) || (user.is_a?(Game_Actor) && self.is_a?(Game_Enemy))Now that's just ugly. But I can't find an XOR conditional operator in Ruby.
Is there a nicer way to do this test?


edit: figured it out. I can just do user.actor? != self.actor?
`actor?` returns true if the battler is a Game_Actor


Similarly, `enemy?` returns true if the battler is a Game_Enemy
p>10?=10😛=pResults in an unexpected tINTEGER at "=10:"where it was expecting ":".  I'm confused -- it's expecting ":" but I gave it ":".  What's the issue here?

edit: d'oh.  Didn't see the ":" right after my "?".  I guess it saw three statements where I was supposed to provide two and it got confused.
Shaz, consider using polymorphism. Having the parent know about the children does not sound like the proper position of the code in the described case.
You're right. The alternative would be to put the new method into Game_Enemy and Game_Actor and specifically check in both cases that user is not a Game_Actor or Game_Enemy respectively. It didn't occur to me because of where the method is that I'm trying to change.
Heres a question from a newbie to some of rpg maker vx ace's advanced functions (aka me): As I have been trying out various scripts I notice that the phrase: "use this in a script call" is commonly used. however, I do not know what people mean by script calls. Are script calls something you use in game? how do you access them from the game? do you put notes on a character in the database? what button do i press? Can someone give me a link on the definition of a script call for RPG maker vx ace and how to use it?   
It depends on the script in question, but generally a script call is done using the "Script" event command, which is located in the bottom right corner of the third page of event commands.
How can I make my actors fully heal upon level up?
In Game_Actor, look for the level_up method.


After

Code:
@level += 1
add this:
Code:
@hp = mhp
Anyone know how I can determine the length of a audio file?
Anyone know how I can determine the length of a audio file?
http://www.gdunlimited.net/forums/topic/8593-mci-audio-module-xpvxvxa/

Untested, but presumably you can just say

Audio['myName'].durationhttp://msdn.microsoft.com/en-us/library/ms713277(v=vs.85).aspxI don't know what the return value you'll get is but presumably you'll get either a string that represents the duration (which you will have to manually parse), or an integer which represents something better like milliseconds or something.
What would happen if I did this in a script:

class Game_Actor attr_accessor :myval alias shaz_setup setup def setup(actor_id) shaz_setup(actor_id) @myval = "hello" endendinstead of this:
Code:
class Game_Actor < Game_Battler  attr_accessor :myval  alias shaz_setup setup  def setup(actor_id)    shaz_setup(actor_id)    @myval = "hello"  endend
Would my actors still have the @myval variable? Would I have broken anything by not including < Game_Battler?Edit: just tested - @myval is still created. So the question is, are there any issues with NOT using < Game_Battler?
Inheritance is set up the first time you declare any given class, and it cannot be changed (at least not by any means I'd recommend using), so you can use the shorthand on all subsequent calls. The only time you'd run into an issue is if you declared Game_Actor without a superclass first, as this would create Game_Actor with no superclass, and will throw a superclass mismatch error when attempting to be declared as a subclass of Game_Battler.
Awesome news that such an error is thrown in Ace 😀


In RMXP it seems to delete all methods and copy from the new superclass when you change the inheritance.


Note that in any RGSS version you can do silliness like this: (Don't do this or I will spank you >:E)

Code:
class FooBar < (rand(2) > 0 ? Foo : Bar)
*hugs*
lol! I bet I could find a useful implementation for that!
How would I alias this method?

def hp=(hp)I tried this:
Code:
alias shaz_hp= hp=def hp=(hp)  shaz_hp= hpend
but it doesn't actually change the hp. Doesn't seem to be calling the original method, although it IS calling the aliased one.This is in XP. I tried the same in Ace a few days ago, and I think it actually gave me a method not found error.

Edit: found it. I needed to do this:

Code:
alias shaz_hp= hp=def hp=(hp)  self.shaz_hp= hpend
I definitely feel as this question doesn't deserve it's own thread, but how do I install a script made by another user? Do I copy and paste it into the script editor like in here:

Spoiler
[IMG]http://i1263.photobucket.com/albums/ii634/HeroUltraOmega/Screenshot2013-11-02215111.png[/IMG]
Or do I have to put it under one of the headings, (Modules, Game Objects, Etc)?
ALL scripts written by others have to go under the heading called Materials. It's way down near the bottom of the list, just above Main. It actually says (insert here).

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