Hello,
I'm using the ABS part of the Chrono Engine plugin https://atelierrgss.wordpress.com/rmv-chrono-engine/
I'd like to know how to get the currently equipped Tool Item ID, like the hookshot or bomb.
I'd like to put it into a variable with a script call but as a JavaScript noob I'm having a rough time following the plugin code.
any help greatly appreciated!
EDIT and SOLVED:
After poking code variables in the developer console (F8) i found the currently equipped
Tool Item ID tucked under _toolItemId in the $gameActors
I then just needed the party leader ID so my solution is:
$gameActors.actor($gameParty.leader()._actorId)._toolItemId
JavaScript questions that don't deserve their own thread
● ARCHIVED · READ-ONLY
-
-
Hi folks,
I was wondering if anyone could help me out with Yanfly's Actor Variables. I got it working like it's supposed to like a charm, but I want to change something and I have no idea how to do it. I opened up the js to see if I could find any clues myself, but that script looks like a mess to my untrained eyes.
What I'm wondering is, is there any way I can change, add, or delete something to make it so that only specific actors (i.e., main characters, and not temporary party members) show a "variables" slot in the status menu? Obviously I could just not put any variables in for temporary members, but then they'd still have a "variables" slot under their status with nothing there. What I want to do is remove that slot entirely for any actor who's not a "main" actor. Can anyone help me out?
EDIT: Now that I'm thinking about it, this may be something that has to be changed in Yanfly's Status Menu Core, which the Actor Variables plugin is dependent on. Either way, I've got no idea how to do it. -
Hello everyone!
I want to do a storage gold event. I'm using Input Number and two variables: first to the storage amount of gold in a chest,
and second temporary to do math operations(This variable is attached to Input Number). And I need a script call (or solution) for a conditional branch which checks a player's amount of gold. If a player has less money than the second variable then an event is stopping. E.g player has 100 gold, but he wanted to put 200 gold and the game says to the player about lack of money.
Can anyone help me out? -
@xXEm41lXx
There's no need for Javascript, you can save the party's current gold amount to a variable and compare it to any other variable using Event Commands.
Event CommandSample Event -
Thanks for the help @Aloe Guvner!
-
_
-
Hello. Can someone help me on Enemy Thieves? http://yanfly.moe/2016/12/28/tips-tricks-enemy-thieves-remade-rpg-maker-mv/
Plugin (in case): http://yanfly.moe/2016/02/05/yep-66-steal-snatch/
I've used it for the sake of having enemies steal from players, but the script provided only makes it where they only steal random items.
I want the enemies to also steal random weapons, random armor, and a user-desired set of gold (e.g. 1000 gold, 2000 gold, etc), but I've had no luck in doing so in the code.
Here's the script I have based on Yanfly's guide:
Code:<After Eval> if (user.isEnemy()) { var successRate = 0.50; if (Math.random() < successRate) { var items = []; var total = $gameParty.items().length; for (var i = 0; i < total; ++i) { var item = $gameParty.items()[i]; if (item.itypeId !== 2) { items.push(item); } } if (items.length > 0) { var random = Math.floor(Math.random() * items.length); var item = items[random]; $gameParty.loseItem(item, 1); var text = user.name() + ' pilfered ' + item.name + ' from ' + target.name() + '!'; obj = { name: "FE_WeaponBreak", pan: 0, pitch: 120, volume: 100 }; AudioManager.playSe(obj); var stealableItem = { type: 'item', id: item.id, rate: 0.50, isStolen: false, isDrop: false } user._stealableItems.push(stealableItem); } } else { var text = user.name() + ' failed to pilfer an item from ' + target.name() + '!'; obj = { name: "FE_Buzzer", pan: 0, pitch: 100, volume: 100 }; AudioManager.playSe(obj); } var wait = 60; text = '<CENTER>' + text; BattleManager.addText(text, wait); } </After Eval>
==================================================================
Edit
==================================================================
Okay, never mind the previous one. Here's this script I got regarding weapons, armor, gold, and items.
Code:<After Eval> if (user.isEnemy()) { var successRate = 0.50; if (Math.random() < successRate) { var items = []; var weapons = []; var armors = []; var gold = 0; var kind = Math.randomInt(4); if (kind === 0) { var total = $gameParty.items().length; for (var i = 0; i < total; ++i) { var item = $gameParty.items()[i]; if (item.itypeId !== 2) { items.push(item); } } } else if (kind === 1) { var total = $gameParty.weapons().length; for (var i = 0; i < total; ++i) { var weapon = $gameParty.weapons()[i]; var isEquipped = false; for (var j = 0; j < $gameParty.members().length; j++) { if ($gameParty.members()[j].isEquipped(weapon)) { isEquipped = true; break; } } if (!isEquipped) weapons.push(weapon); } } else if (kind === 2) { var total = $gameParty.armors().length; for (var i = 0; i < total; ++i) { var armor = $gameParty.armors()[i]; var isEquipped = false; for (var j = 0; j < $gameParty.members().length; j++) { if ($gameParty.members()[j].isEquipped(armor)) { isEquipped = true; break; } } if (!isEquipped) armors.push(armor); } } else if (kind === 3) { gold = $gameParty.gold(); } if (items.length > 0) { var random = Math.floor(Math.random() * items.length); var item = items[random]; $gameParty.loseItem(item, 1); var text = user.name() + ' pilfered ' + item.name + ' from ' + target.name() + '!'; obj = { name: "FE_WeaponBreak", pan: 0, pitch: 120, volume: 100 }; AudioManager.playSe(obj); var stealableItem = { type: 'item', id: item.id, rate: 0.50, isStolen: false, isDrop: false } user._stealableItems.push(stealableItem); } else if (weapons.length > 0) { var random = Math.floor(Math.random() * weapons.length); var weapon = weapons[random]; $gameParty.loseItem(weapon, 1); var text = user.name() + ' pilfered ' + weapon.name + ' from ' + target.name() + '!'; obj = { name: "FE_WeaponBreak", pan: 0, pitch: 120, volume: 100 }; AudioManager.playSe(obj); var stealableItem = { type: 'weapon', id: weapon.id, rate: 0.50, isStolen: false, isDrop: false } user._stealableItems.push(stealableItem); } else if (armors.length > 0) { var random = Math.floor(Math.random() * armors.length); var armor = armors[random]; $gameParty.loseItem(armor, 1); var text = user.name() + ' pilfered ' + armor.name + ' from ' + target.name() + '!'; obj = { name: "FE_WeaponBreak", pan: 0, pitch: 120, volume: 100 }; AudioManager.playSe(obj); var stealableItem = { type: 'armor', id: armor.id, rate: 0.50, isStolen: false, isDrop: false } user._stealableItems.push(stealableItem); } else if (gold > 0) { var stolengold = Math.min(gold, Math.floor(user.atk * Math.random())); $gameParty.loseGold(stolengold); var text = user.name() + ' pilfered ' + stolengold + ' ' + TextManager.currencyUnit + ' from ' + target.name() + '!'; obj = { name: "FE_WeaponBreak", pan: 0, pitch: 120, volume: 100 }; AudioManager.playSe(obj); var stealableItem = { type: 'armor', id: stolengold, rate: Yanfly.Param.StealGoldRate * 100, isStolen: false, isDrop: false } user._stealableItems.push(stealableItem); } } else { var text = user.name() + ' failed to pilfer an item from ' + target.name() + '!'; obj = { name: "FE_Buzzer", pan: 0, pitch: 100, volume: 100 }; AudioManager.playSe(obj); } var wait = 60; text = '<CENTER>' + text; BattleManager.addText(text, wait); } </After Eval>
But see, when enemies try to steal weapons, armor, and gold, it will say undefined for some reason and they don't even have the weapon, armor, or gold. However, items still work.
Can someone please help me on what I'm doing wrong? I still need them to successfully get weapons, armor, and set gold from the player group. -
Hey there,
I'm using Yanfly's Row Formation plugin http://yanfly.moe/2016/01/02/yep-54-row-formation/ with two rows. I want to have a skill that makes the actors change row, but, as I don't know how to code, I don't know how to script a conditional branch in the notetag...
Basically, I want the skill to change the actor to row 2 if s/he is in row 1, and to row 1 if s/he is in row 2. I'm sure I've seen how to do this somewhere on the forum, but can't find it anymore...
And sorry I can't be of any help for @RK DracoRoy 's pending question.
Edit: And thanks! :)
Second edit: Oh, and I'm using RPG Maker MV, just in case... -
@Anarcho-paladin
I'm not totally sure this will work, but it will get you in the right direction.
I think you can use a notetag on the skill like this:
Code:<Custom Target Row> if (target.row() === 1) { row = 2; } else if (target.row() === 2) { row = 1; } </Custom Target Row>
That would make the target of the skill change rows - if you want the user of the skill to change then switch "target" with "user". -
@Anarcho-paladin
I'm not totally sure this will work, but it will get you in the right direction.
I think you can use a notetag on the skill like this:
Code:<Custom Target Row> if (target.row() === 1) { row = 2; } else if (target.row() === 2) { row = 1; } </Custom Target Row>
That would make the target of the skill change rows - if you want the user of the skill to change then switch "target" with "user".
Works perfectly fine, thanks! Moreover, I can now compare this to the "empty" example given in the help file and, maybe, understand a bit how to "fill" such a template. Many thanks, @Aloe Guvner ! -
Me again...
I'm using Yanfly's Row Formation http://yanfly.moe/2016/01/02/yep-54-row-formation/ and Battle AI Core http://yanfly.moe/2015/10/19/yep-16-battle-a-i-core/ plugins.
I set my project as to have two rows with their respective defined state. I also use the "gazer" SV battler to create an enemy based on the old and classic DnD monster, the Roper. The roper can attack with the default attack skill, but as I'm using the Row Formation plugin, then can only target actors standing in the first row; it can use a skill to capture an actor from the second row in order to bring him/her to the first; and it can "rope" an actor from the first row, adding him or her a paralyzed kind of state.
I'm trying to use the conditions provided by the Battle AI Core plugin in order for the roper not to rope an already paralyzed actor, but to no avail. From the plugin's help file:
STATE !== state x STATE !== state name
This will detect if the target scope does not have state x (or state name if you use that instead). If the target doesn’t, that target is added into the pool of valid targets. Any targets affected by the state will be ignored.
Example:
State !== State 12: Haste, Random
State !== Courage: Cowardice, Highest ATK
Here's what I made from this: State !== State 30: Enlacement, Random, where 30 is the state number for being paralyzed by the roper, Enlacement the skill name for paralyzing the actor. Am I correct here, or did I make any mistake?
If this syntax is correct, where/how do I have to write the condition in? In the enemy's notebox, in the skill's notebox? Do I have to put something like <Conditions> before and </Conditions> after? If not, what do I need to do in order to make this work?
Thanks! -
Bump?
Edit: Well dah, this is a sticky thread... Still, anybody who could help? Thanks. -
How do I call currently selected actors name and hp in battle?
-
I am just starting using Yanfly's plugin. I was watching the video YEP.43 - Skill Cost Items - RPG Maker MV
Yanfly used a 'chemistry' battle command in the battle manu to demonstate how to use this plugin. B-U-T, I didn't understand how he could change the battle command in the battle manu. If we can freely change it, that would be greatly ultra fun. I checked back to the previous videos many times but didn't see how to change the battle manu.
Did I miss anything in his tutorial? Anyone could help me with this? Thanks in advance:kaocry:. -
@AutoBlaze , did you read the plugin's help file? Yanfly's video tutorial often give a general impression of what you can do with his/her/their plugins, but the precise how-to lies in the file.
Moreover, it is possible you have to combine different plugins' functions in order to do so (I can't check right now). For instance, if you're using Yanfly's Row Formation plugin and want to reserve certain actions (for exemple, melee attacks) to certain rows (for exemple, front row), you also have to use Yanfly's Target Core plugin. -
Hi @Anarcho-paladin , Thank you for your reply.
I am gonna check the plug-in again specificly. But if still no idea, I propably start a thread to propose this question. Thanks again. -
@AutoBlaze
1.) Open the database and navigate to "Types"
2.) Under skill types, add a new item, name it Chemistry
3.) In the Class/Actors tab, add the Skill Type Chemistry to whoever you want access to.
4.) When you create a skill, in the drop down for skill type, select Chemistry.
Chemistry will now appear as a separate battle command option for all Actors who have access to it. -
Hello.
Do you guys know if there's a way to get an item price in a variable?
I'm trying to achieve something a bit like this:
Variable 1 = Item 1
Variable 2 = Price of Variable 1
But any other way would make it for me.
Cheers. -
-
I would allow myself to put my unanswered question to your attention... Thanks.
Me again...
I'm using Yanfly's Row Formation http://yanfly.moe/2016/01/02/yep-54-row-formation/ and Battle AI Core http://yanfly.moe/2015/10/19/yep-16-battle-a-i-core/ plugins.
I set my project as to have two rows with their respective defined state. I also use the "gazer" SV battler to create an enemy based on the old and classic DnD monster, the Roper. The roper can attack with the default attack skill, but as I'm using the Row Formation plugin, then can only target actors standing in the first row; it can use a skill to capture an actor from the second row in order to bring him/her to the first; and it can "rope" an actor from the first row, adding him or her a paralyzed kind of state.
I'm trying to use the conditions provided by the Battle AI Core plugin in order for the roper not to rope an already paralyzed actor, but to no avail. From the plugin's help file:
Here's what I made from this: State !== State 30: Enlacement, Random, where 30 is the state number for being paralyzed by the roper, Enlacement the skill name for paralyzing the actor. Am I correct here, or did I make any mistake?
If this syntax is correct, where/how do I have to write the condition in? In the enemy's notebox, in the skill's notebox? Do I have to put something like <Conditions> before and </Conditions> after? If not, what do I need to do in order to make this work?
Thanks!