Thank you Ramza.
Hopefully this will help me fix my issue. :)
JavaScript questions that don't deserve their own thread
● ARCHIVED · READ-ONLY
-
-
Is there a way to have a piece of equipment alter the hit rate for one or more skills alone, or skill types? Like an item that increases the hit rate for physical skills or spells?
-
You'd need a plugin for that.
-
I completely forgot this thread exists.
So, I would like to completely clear out the players inventory. Since you need script calls for this and it seems like I am too stupid, what are the script calls to remove a specific item?
In VX Ace I could use this to remove items/weapons/armors from the players inventory:
Code:$game_party.gain_item($data_items[$game_variables[6]], -150) $game_party.gain_item($data_armors[$game_variables[7]], -150, true) $game_party.gain_item($data_weapons[$game_variables[8]], -150, true)
I assume something like that is still possible, but what does it look like? As far as I understand the script call list, I would do something like this:
$gameParty.gainItem($dataItems[$gameVariables[2]], -150);
...but that doesn't work. Probably because of the $gameVariable, but how do I need to change it so it does work? -
-
Thanks, that works. -
Hey guys.
I want to make an eval, like this:
if Math.floor(actor.elementRate(9) * 100) > 100 {
value = -100
}
else {
}
end
If the state rate 'burning' is higher than 100%, than subtract 100 from the value. -
Hello, I think this is very simple but I'm just back to rpg making and my js scripting skills are non-existant so I gotta ask.
I'm using RMV – Menu Background from Moghunter (to have a image show behind the menu), but I want to use a image with some transparency so the blurry map is shown behind the image, so I'm wondering wich lines of code i have to add to the script. Thanks in advance for anyone that can help me with this. -
I'm trying to make it so that a passive state (using Yanfly's Auto-Passive States script) will increase the length of various status ailments (using Yanfly's Buffs
States Core script). Basically, the actor's passive state is supposed to make their ailments more effective against enemies.
I've tried multiple different ways of getting this to work, but nothing's given me the results I've wanted so far. The code that I feel I've been closest with is:
<Custom State Poison Turn>
if (a.isStateAffected(34) === true) {
turn = 6;
}
else {
turn = 4;
}
</Custom State Poison Turn>
(Note that this is pasted into the "Poison" skill's comment box.)
State 34 is the passive state in question. If it's true, the poison ailment's turn count should become six, while it should become four (the default) if it's false. Am I even close, here? Or am I completely off track? All I want is to make sure I can make this thing work, since it'll help me a lot with the dedicated buffing and debuffing classes. -
So, I would like to completely clear out the players inventory. Since you need script calls for this and it seems like I am too stupid, what are the script calls to remove a specific item?
$gameParty.initAllItems();
will reset items, weapons and armors to empty. You don't have to go through each one individually.
Hey guys.
I want to make an eval, like this:
if Math.floor(actor.elementRate(9) * 100) > 100 {
value = -100
}
else {
}
end
If the state rate 'burning' is higher than 100%, than subtract 100 from the value.
Where are you putting this? Are you using a script? What is 'value'? Assuming it's already been calculated and you only want to change it if the rate is > 100, you can just get rid of the whole else block. You also don't need the end in there because the { } define the start/end. Unless it's required by whatever plugin you're using.
Hello, I think this is very simple but I'm just back to rpg making and my js scripting skills are non-existant so I gotta ask.
I'm using RMV – Menu Background from Moghunter (to have a image show behind the menu), but I want to use a image with some transparency so the blurry map is shown behind the image, so I'm wondering wich lines of code i have to add to the script. Thanks in advance for anyone that can help me with this.
Please put questions about "how do I alter XYZ script" into their own thread, with a link to the script. This thread is for simple script snippets that do not involve modifying plugins. -
$gameParty.initAllItems();
will reset items, weapons and armors to empty. You don't have to go through each one individually.
Where are you putting this? Are you using a script? What is 'value'? Assuming it's already been calculated and you only want to change it if the rate is > 100, you can just get rid of the whole else block. You also don't need the end in there because the { } define the start/end. Unless it's required by whatever plugin you're using.
Please put questions about "how do I alter XYZ script" into their own thread, with a link to the script. This thread is for simple script snippets that do not involve modifying plugins.
I solved my problem at another way.
But many thanks for your great helpfulness!
EDIT:
But i need a script call that change the item limit for some items. I want to change the item maximum in game, if only find solutions to change it in the database. Im using yanfly core etc. -
Alright, I completely overhauled my system, but I'm afraid it's still not working the way I want it to. I put everything into Yanfly's Action Sequences plugins instead of the Buffs States plugin, and there's been an improvement, but there's still a major issue with the scripting.
What I have so far is:
<setup action>
display action
immortal: targets, true
</setup action>
<target action>
move user: forward, 60
wait for movement
motion spell: user
wait for motion
action animation: target
wait for animation
common event: 10
if user.luk + $gameVariables.value(10) > target.luk
if user.isStateAffected(34)
add state 84: target
if target.isStateAffected(4)
remove state 4: target
else
add state 4: target
if target.isStateAffected(84)
add state 84: target
else
action effect
end
</target action>
Common event 10 sets variable 10 to a random number between -10 and 10. That number is then added to the user's Luck score, and -- if the resulting value is greater than the target's Luck -- will inflict the target with poison. This is what it is meant to do, but I don't know if it actually calculates properly.
If the user has the passive state "Saboteur Mastery" (state 34), it will instead inflict a version of poison that lasts for 6 turns instead of the usual 4. If the user does not have that state, the target will be inflicted by the default version. Both conditionals have variations that occur when the target is inflicted by the other kind of poison (Default Poison is overwritten by Variant Poison, and Variant Poison makes it impossible to be inflicted by Default Poison, so its turn count is reset, instead). All of this works as intended, at least as far as I can tell.
The else at the end is where things get tricky. The action effect of this skill is there because the skill has a 0% success rate, meaning that it'll always show that it misses on the else branch (where it's not supposed to inflict either Default Poison or Variant Poison). However, sometimes it'll trigger the action effect, say that it missed, and still inflict the ailment. Does anyone know why it does this? I want to say that it's a problem with my first conditional statement (if user.luk + $gameVariables.value(10) > target.luk), but I don't know for sure if that's the case. -
-
What will I need the plugin for, exactly? The entire thing, or just one piece of it? I'm sorry that I keep asking so many questions; I just want to figure this out as painlessly as I can.
-
I was replying to the post above yours. Unfortunately you made your post at exactly the same time, and got in between the two.
Please post a new thread for your question, as you are not asking a javascript question, but for support for an existing plugin (and include a link to the plugin so people can find it easily/quickly and see how the notes should be set up). -
Ah, I see. I'm sorry about that. Thank you for your time!
-
-
Thank you! -
Is it possible to count all items in the inventory and the equipped ones? So for example, if I have the following:
- 2 Potions in the Inventory
- 1 Dagger equipped
- 1 Leather Armor Equipped
- 1 Ring of Health in the Inventory
Could I count them in a variable somehow? -
Is it possible to count all items in the inventory and the equipped ones? So for example, if I have the following:
- 2 Potions in the Inventory
- 1 Dagger equipped
- 1 Leather Armor Equipped
- 1 Ring of Health in the Inventory
Could I count them in a variable somehow?
Yes you got to 'change variable' than choose your variable and than you click on game data. There you can catch your items and how much the player has in his inventory.
If something is equipped you can check with cond branch, choose actor and than the equipment.
You can also check it with scriptcalls
Spoilerif ($gameActors.actor(actorId).equips()[n]) {
return $gameActors.actor(actorId).equips()[n].id;
};
if ($gameActors.actor(actorId).equips()[n]) {
return $gameActors.actor(actorId).equips()[n].name;
};
More about these scriptcalls you can take up here:
Spoiler
I also can recommend the galv puzzle plugin. There you can check if the player has a specific amout of something and much more.
you can find it here: