I've been killing myself with this and I've been searching the net for the entire afternoon and I can't get it to work. I'm trying to get a script call that will store the number of the armor equipped in a speciffic inventory slot (number under which the item is created in the editor). The problem is that I am using Yanfly's Equip Menu and there are 40-ish custom slots there.
This works
$game_variables[10] = $game_actors[11].equips[0]
but the result is not the equipment number but some strange code.
So, can anyone help me by revealing me the script call for checking this?
Also if I'm posting in the wrong topic please excuse me.
It should work if you add .id to the end of what you have.
Thank you for the reply, Boom!. Unfortunately, I have already tried that but I get an error
Script 'Game_Interpreter' line 1409: NoMethodError occured.
undefined method `id' for nil:NilClass.
It's probably trying to check the id of someone who does not have a weapon. Try tacking on unless $game_actors[11].equips[0] == nil
Oh my God... I'm such an idiot! 😮 THANK YOU, BOOM!, THANKS SOOO MUCH!
Hey, I missed it at first too. And it's Racheal, not Boom! Boom! is an (outdated) user title.
Hahahaha! I see, didn't even notice the text... guess I'm just bound to miss things today... My appologies, Racheal. 🙂
Skimmed through the thread and didn't notice this being asked:
What's the call that returns the current number of actors in the party? I was thinking $game_party.members, but that's not it.
$game_party.members.size
You can also just do this via Control Variables - it's in Game Data > Other > Party Members.
Both will return a different value depending on whether you're in battle or not. When in battle, it'll give you the number of battlers in your party. When on the map, it'll give you the total size of your party.
If you're in battle but you WANT the total size of your party (not just battlers), use $game_party.all_members.size instead.
Ok, since I've been helped here I feel like contributing to the community myself. I don't know which of these have been posted but I think most still haven't, so I'm just gonna sum them up for people.
CHECKING AVAILABILITY
$game_actors[X].equips.include?($data_weapons[Y]) - Checks if the actor #X has weapon #Y equipped
$game_actors[X].equips.include?($data_armors[Y]) - Checks if the actor #X has equipment (shield, armor, helmet or accessory) #Y equipped
$game_actors[X].skills.include?($data_skills[Y]) - Checks if the actor #X has learned skill #Y
$game_actors[X].states.include?($data_states[Y]) - Checks if the actor #X is afflicted by status effect #Y
CHECKING FOR NAME/ID OF EQUIPMENT
$game_actors[X].equips[Y].id unless $game_actors[X].equips[Y] == nil - Returns the ID of the equipment on actor #X, equipped in slot #Y
$game_actors[X].equips[Y].name unless $game_actors[X].equips[Y] == nil - Returns the name of the equipment on actor #X equipped in slot #Y
NOTE: If using any scripts that give or take equipment slots, the #Y is the number of the character's slot, not the slot's number in the script. I.E. using Yanfly Equip Menu script - if your character has equipment slots 6,7,8,15,15,32,75 available then $game_actors[1].equips[0].id would return the ID of the item equipped in the slot defined as slot 6 in Yanfly script because it's the 1st equipment slot for the specific character.
CHECKING ACTORS
$game_actors[X].name - Returns the name of the actor #X
$game_actors[X].nickname - Returns the nickname of the actor #X
$game_actors[X].class.id - Returns the ID of the actor #X class
$game_actors[X].class.name - Returns the name of the actor #X class
USING SCRIPT CALLS TO CALL SCRIPT FUNCTIONS
If you're having problem with low event script call space you can use event script call to call your own script function.
Create a new script below ▼ Materials/素材 but above ▼ Main and in the script put:
class Game_Interpreter
def custom_script()
YOUR SCRIPT
end
end
Then you just need to call the script by typing the name of the function (the bold red text) inside the event script call. So in this case I'd just type custom_script into the event script call.
This also saves you time of repeatedly typing many long script lines into event scripts and calling them by one simple line instead.
_____________________
I'm probably gonna edit and add more stuff to this post later...
That's right. The battlers are the first 4, by default, unless you have a script or have changed the party script to use a different number of battlers.
Wouldn't that be
draw_text(0, 0, 12, line_height, $Tsav0)???
Where are you that you want to display the play time - IN the save/load menu? On the map?
I said in my previous post, if it didn't like line_height, to just put in 24 instead 😉