I was wondering if it was possible to make a statement that checks if a certain equipment slot (such as .equips(1)[]) contains a certain weapon type equipped? Also, what's the script call to forcibly unequip something from a specific slot?
$gameActors.actor(actorId).equips().forEach(function(e){
if(e.isWtypeEquipped(ID OF WEAPON TYPE)){
// do whatever
}
})
If I only want it to check slot 1, would it look like this?...
JavaScript:
$gameActors.actor(actorId).equips()[1]{
if(e.isWtypeEquipped(ID OF WEAPON TYPE)){
// do whatever
}
})
Edit: No wait, that's not right...I need to retain "function(e)" don't I? But I don't want it to check the whole array (aka "forEach"), just a single slot.
In this case it sounds like you just want to check one weapon: you can use something like this in a scripted if or via Conditional Branch > Script, e.g.
JavaScript:
var w = $gameActors.actor(1).weapons()[0]; w ? w.wtypeId === 5 : false
I.e. "let w equal actor 1's first weapon; if the weapon exists, return true iff it is of type 5, else return false". You can reference weapon types via the Types tab in the database.
For changing equipment, note that changeEquip expects item arguments; 0 works here because JavaScript treats it as falsy, but the standard "empty slot object" used in the core scripts is null. An alternative is changeEquipById:
JavaScript:
$gameActors.actor(1).changeEquipById(1, 0);
I.e. "equip item ID 0 (i.e. null) in equip slot 1 (first type, by default a weapon)". You can reference equipment types via the Types tab in the Database.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.