@Leaferson Kenraise Conditional Branch doesn't know what a or user are.
Try BattleManager._subject.isStateAffected()
The official VisuStella notetag help thread
● ARCHIVED · READ-ONLY
-
-
@Leaferson Kenraise Try:
Code:in the script section of the conditional branch.$subject.isStateAffected(29) -
Ah, subject! I was trying things to replace BattleManager._target.isStateAffected but wasn't sure what to change it. This worked perfectly! Thank you very much!@Leaferson Kenraise Conditional Branch doesn't know what a or user are.
Try BattleManager._subject.isStateAffected() -
Not really a notetag problem (maybe?) but since it's related to Visustella, I wanted to ask if I'm doing something wrong here.
In the Main Menu core there's the Variable window which would show the variable amount on the menu screen. I set it up so it tracks how much of an item is, or at least it should. It doesn't make any difference however. Can anyone tell me what I can do to fix this? Thanks!
Spoiler -
i have no familiarity with the plugin at all, but just to make sure. the variable value is being updated, right? you have some event somewhere running that control variable command at some point to update the variable to the current item count?
-
Oh uh... no. Other than the initial event that sets the variable as = Monster Coins, no.
Huh :eek:
Any idea on how to constantly keep that variable updated? -
it might not be meant for it, but try sticking in a new line in that JS parameter at the end that saysCode:I dont know if thats called every time the menu is opened, but if it is, it should update it every time
$gameVariables.setValue(41, $gameParty.numitems($dataItems[52])); -
I actually found a quick way from what you said before.
It's not constantly refreshing it, but I added the control variable command again on the shops I where it mattered, checking before and after the shop processing and it works!
I guess it works for my case cause I can only increase/decrease the variable via the shops, not sure how it would work for anyone else that have it increase over time.
I suppose if someone picks up a variable, they can also add in the control variable command to the same +1 variable event. Not the smoothest solution, but it works.
I'm sure someone can think of a better way to do it, possibly via common events but this method works well enough for me.
Spoiler -
Is there a way to have a passive ability on the player character that buffs themselves as well as the rest of the party, depending on the race of the character?
I want my player character to give off a party aura that buffs the defence of human characters and buffs the offence of beastkin characters. -
@Emperor3D VisuStella doesn't have any kind of aura plugin, as far as I know.
You would have to give each actor the passive state with the appropriate traits, then give those passives the notetag
Code:where 42 is the ID of the actor who needs to be in the party.<JS Passive Condition> condition = $gameParty.members().includes($gameActors.actor(42)); </JS Passive Condition> -
Oh yeah I have another question.
So I bought the One Time Purchase plugin and wanted to ask how would I be able to track if the shop got bought out?
Is there a way to check it's sold out, because I want some stores to restock once emptied with maybe new items, or restock after a certain period of time.
The page doesn't say too much about it, but the video shows the store knew it was emptied out so it's possible...?
Spoiler -
Is there any way for Visustella Battle Grid to limit the available targets to certain nodes around the user of that skill?
So if I wanted a skill that adds a defensive state to one friendly target that has to be within 1 node of the user istead of beeing in a specific flank/rank? -
I'm trying to create a skill that copies the buffs each party member has, and then adds them all to each party member. These is a lower level version of this skill that select one party member only and spreads their buffs among the party.
That works fine:
JavaScript:<JS Post-Apply> let states = target.states(); const category = "buff"; while (states.length > 0) { const state = states.shift(); if (state.categories.contains(category.toUpperCase())) { $gameParty.members().forEach(member => member.addState(state.id)); } } </JS Post-Apply>
However I'm not sure how to get the buffs of all party members at once, for the upgraded version of the skill.
One thing I did try was to change the scope of the skill to the entire party, and while this worked, it had the weird effect of cause the state to be added to each party members 3 times in a loop. Furthermore, in the battle log, it didn't display every state that was added to the party even though it did add each state.
ExampleIn this example, Rock has Offense Up, Defense Up and Tronica has Mobility Up. After using the skill, each party member has all three buffs, as you can see the log doesn't display that.
also the pop ups proc three times. Twice with Offense Up and Defense Up added, and once with Offense Up, Defense Up and Mobility Up
What do I have to change the bolded line to to capture the entire party? I think if I keep the skill scope to the user and run this code, it might solve this issue. I've tried $gameParty.aliveMembers() and some other variations of gameparty and they didn't work.
<JS Post-Apply>
let states = $gameActors.actor(1).states();
const category = "buff";
while (states.length > 0) {
const state = states.shift();
if (state.categories.contains(category.toUpperCase())) {
$gameParty.members().forEach(member => member.addState(state.id));
}
}
</JS Post-Apply> -
im guessing you mean states the entire time, only mean states, and that you never meant buffs as the engine calls it.
it makes sense that it would. the code is ran every time the skill hits a target, so each time it does, it executes a loop to apply the target's states to the entire party. any state that is on a target other than the final one is applied multiple times as every later battler would have been given the state and would have it be spread off of them to everyone again (including themself). in a party of 4, any state the leader has gets applied to everyone 4 timesOne thing I did try was to change the scope of the skill to the entire party, and while this worked, it had the weird effect of cause the state to be added to each party members 3 times in a loop.
i dont use the battle log, but i assume that it doesnt show state changes made on any battlers other than the the immediate target and subject of the current skill. the third state that got applied to everyone and didnt show up in the log would have been applied to everyone else after theyve been targeted.Furthermore, in the battle log, it didn't display every state that was added to the party even though it did add each state.
thats one way to avoid the multiple looping problem while keeping the loop as isI think if I keep the skill scope to the user and run this code, it might solve this issue
aliveMembers() returns an array of battlers, so you cant use functions for battlers on it. i dont know what other variations of $gameParty could mean.I've tried $gameParty.aliveMembers() and some other variations of gameparty and they didn't work.
try this and then apply the states to each party memberWhat do I have to change the bolded line to to capture the entire party?
Code:you wont need to worry about duplicates, and you no longer need to look at the categories cause they only enter the array if theyre a "buff". just apply each state in there to each battler.let states = []; user.friendsUnit().aliveMembers().forEach(member => member.states().forEach(state => { if (state.categories.contains("BUFF") && !states.contains(state.id)) states.push(state.id); }) )
you do know about forEach() though. you dont need to start a while loop when you can run a nested forEach(), but would work the same regardless -
try this and then apply the states to each party member
Code:you wont need to worry about duplicates, and you no longer need to look at the categories cause they only enter the array if theyre a "buff". just apply each state in there to each battler.let states = []; user.friendsUnit().aliveMembers().forEach(member => member.states().forEach(state => { if (state.categories.contains("BUFF") && !states.contains(state.id)) states.push(state.id); }) )
you do know about forEach() though. you dont need to start a while loop when you can run a nested forEach(), but would work the same regardless
I tried this and it added all the states to each party member, not just the ones tagged "buff"/
EDIT: I was able to fix it by combining parts of your code with mine.
Thanks. -
Hello! I would like to create a passive state that when a character has it, it will cause slip damage to every other member of the party. I suppose it is possible with a script but I can't get it right. Can someone help?
-
Does anyone know the JS code/snippet that adds Full turns or Half Turns in Visutella PTB?
I want to add Press Turns under certain conditions, but there are no specific note tags for it.
If I can find the code that adds them though, I can just use JS to get the conditions to trigger?
Maybe if there is a way I can get the console to push the code when Press turns are added? Idk. -
Hello! I would like to create a passive state that when a character has it, it will cause slip damage to every other member of the party. I suppose it is possible with a script but I can't get it right. Can someone help?Code:
<JS Post-Regenerate> $gameParty.aliveMembers().forEach(actor => { if (actor != user) { actor.gainHp(-10); actor.startDamagePopup(); if (actor.hp <= 0) actor.performCollapse(); } }); </JS Post-Regenerate>
Should deal 10 damage to every party member who isn't the actor with the state. -
Thank you very much!Code:
<JS Post-Regenerate> $gameParty.aliveMembers.forEach(actor => { if (actor != user) { actor.gainHp(-10); actor.startDamagePopup(); if (actor.hp <= 0) actor.performCollapse(); } }); </JS Post-Regenerate>
Should deal 10 damage to every party member who isn't the actor with the state. -
Thank you very much!Well I inserted the code to the notetag of the state but it doesn't seem to work. Is there something that i am missing or is there a typo in th code (that I obviously can't tell ).Code:
<JS Post-Regenerate> $gameParty.aliveMembers.forEach(actor => { if (actor != user) { actor.gainHp(-10); actor.startDamagePopup(); if (actor.hp <= 0) actor.performCollapse(); } }); </JS Post-Regenerate>
Should deal 10 damage to every party member who isn't the actor with the state.