Should be...
$game_actors[X].equips[Y].wtype_id unless $game_actors[X].equips[Y] == nil
Or (I'm doing this without any scripts in front of me, so I'm assuming Selchar's syntax is correct):
$game_actors[x].equips[y].wtype_id if $game_actors[x].equips[y]if xxx
is the same as
unless xxx == nil
I tried that at first too, but it just gave me NoMethodErrors.
After tinkering around, I figured it out:
$game_actors[A].equips[Z].params[Y]
-or-
$data_weapons[X].params[Y]
A = Actor ID
X = Weapon ID
Y = Accepts value from 0 to 7, which are representative of the parameters themselves.
MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK, in that order.
ie ATK would be [2], AGI would be [6].
Z = Equip slot.
Unfortunately for me, a script is interfering with me pulling the ID of the character's equipped item, so I need to figure that out next.
EDIT: Forgot to add the previous call, which just checks the slot, thank goodness that's avoided.
I am looking for the Script equivalent of this conditional event command:
@> Conditional Branch [Player] is [skill Name] Learned
@>
Else
@>
End Branch
I require it to be in script so I can identify the Actor by Actor_Id, where the event command you have to choose a specific actor.
Example:
@> Conditional Branch $game_actors[X] is [skill Name] Learned
@>
Else
@>
End Branch
Where X is the actor's ID.
Searched the forums and google and found nothing, any help would be awesome and save a ton of repeat events Thanks!
I have moved your post into the Script Call Equivalent of Events thread.
You'd be after something like this:
$game_actors[actorid].skill_learn?($data_skills[skillid])where actorid and skillid are the ids from the database of the actor and skill you're interested in.
It will return true if they have that skill, and false if they don't.
Derpish question here:
What's the call to add wait frames in Eventing scripts, if there is one? (like the "Wait: 'x' frame(s)" event command, but scripted instead of a command)
I swear I saw it before but can't seem to find it now ~.~
.....
I totally knew that! Or should have, anyhow :dizzy:
Thank you ^^;
Hmmm... I don't think anybody asked this, so is there any script call or maybe a short combination of codes that would determine the region at X:Y coordinates?
Is there a script call that can change a region on X:Y coordinates of the map?
Edit: Thanks FiXato 🙂
You would be able to make a script call to change the region on a map tile, but it would only stick until you left the map. When you reloaded it, it would revert to the original region. You would have to have a script written that would give you an easy way to change regions, save them with the player's save data, and then load them again on loading a map.
Hi,
Is there a script call to be able to load a specific save, please ?
DataManager.load_game(index)
where index is the save file number you're after. I'm not sure if index=0 means save1 or save0, but it wouldn't take much to test.
How would you check the ID of equipment in slot Y equipped to character X, then store it in a variable?
I'm guessing it would be something similar to what was mentioned on page 13.
Also, is there a way to draw the name of said equipment in a dialogue box?
$game_variables[3] = @actor.equips[4].idwould store the id of whatever is in slot 4 into variable 3.Remember though, that could be either a weapon OR armor - especially if it's in slot 2.
If you go to Window_Base and find the convert_escape_characters method, you can add a few lines that will then let you print out the name of equipment:
def convert_escape_characters(text) result = text.to_s.clone result.gsub!(/\\/) { "\e" } result.gsub!(/\e\e/) { "\\" } result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] } result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] } # added lines below result.gsub!(/\eA\[(\d+)\]/i) { $data_armors[$1.to_i].name } result.gsub!(/\eW\[(\d+)\]/i) { $data_weapons[$1.to_i].name } # added lines above result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) } result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) } result.gsub!(/\eG/i) { Vocab::currency_unit } result endYou can then put this sort of thing in your message boxes:
\A[5] - to display the name of armor 5
\W[8] - to display the name of weapon 8
\W[\V[15]] - to display the name of the weapon whose id is in variable 15
Thanks, Shaz, however...
$game_variables[x] = @actor.equips[y].id
Is giving me an error. Apparently "equips" is an undefined method.
Also, how would I get the ID of equipment from other actors?
When you report an error, you really need to give the EXACT error message. Is it equips that's undefined (I know it's not, because equips IS a method on an actor), or is @actor undefined? Are you writing it in the script call EXACTLY as it is above? You're not meant to - you're meant to put in the variable number instead of x, the slot number instead of y, and whatever it is you're using to define what actor you're talking about instead of @actor.