The official VisuStella notetag help thread

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,563
Reaction score
7,141
First Language
English
Primarily Uses
RMMZ
That works, thank you. :)

With this out of the way, I was able to test the other code snippet for bonus effects when removing negative states. What I have is this:

<State Negative Category Remove: All>
<JS Pre-Apply>
target.gainTp(target.statesByCount("Negative").length * 5);
</JS Pre-Apply>

Which, unfortunately, doesn't work. Do you have an idea why?

Ideally, the item would only generate TP for each state actually removed, not just counted. To be honest, I don't have any plans of including states of the 'Negative' category that can't be removed with this item, but it's better to have too much design space than too little, right? :) So, should you have an idea how to implement this, that would be even better.
I think you may need to use target.result().removedStateObjects() for this in a post-apply notetag.
 

unregicide

Warper
Member
Joined
Nov 5, 2014
Messages
1
Reaction score
0
Primarily Uses
With my custom resolution (1056x808) I cant seem to figure out how to move the Y position of portraits on the Status screen?
I managed to find where I could move it in the main menu code, but I couldnt figure it out after playing around in the code. Am I just dumb?
rpg.png
 

WilsonE7

Regular
Regular
Joined
Oct 12, 2019
Messages
142
Reaction score
67
First Language
English
Primarily Uses
RMMZ
Hey, is there a way to change the amount of EXP an enemy yields based on a variable? It would be a one-time thing for certain bosses. I know I can do it with eventing after the battle, but I wanted the EXP to show up on the victory screen. I just had the idea of a passive state being temporarily applied, but the trait effects aren't really variable-friendly. Any thoughts?
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,563
Reaction score
7,141
First Language
English
Primarily Uses
RMMZ
Hey, is there a way to change the amount of EXP an enemy yields based on a variable? It would be a one-time thing for certain bosses. I know I can do it with eventing after the battle, but I wanted the EXP to show up on the victory screen. I just had the idea of a passive state being temporarily applied, but the trait effects aren't really variable-friendly. Any thoughts?
If it's for a one-off enemy that you'll never encounter again, you can cheese this by changing the exp data for the enemy json directly:

$gameTroop.members()[0].enemy().exp = $gameVariables.value(1)

So if you had 10 in the variable, that's how much exp the enemy would be worth.

Again, you can only do this for an enemy you'll encounter once and never again, because you're editing the data for every copy of the enemy that's created from it.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,196
Reaction score
9,145
First Language
English
Primarily Uses
RMMV
Hey, is there a way to change the amount of EXP an enemy yields based on a variable? It would be a one-time thing for certain bosses.
The other way to work around this would be to simply create a copy of that enemy in your database, fill in whatever different experience, and use that version of the enemy in your boss troop.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,563
Reaction score
7,141
First Language
English
Primarily Uses
RMMZ
The other way to work around this would be to simply create a copy of that enemy in your database, fill in whatever different experience, and use that version of the enemy in your boss troop.
How would you fill in the exp for a database version of an enemy if the value needs to be changeable, though? Maybe I'm missing something.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,196
Reaction score
9,145
First Language
English
Primarily Uses
RMMV
How would you fill in the exp for a database version of an enemy if the value needs to be changeable, though? Maybe I'm missing something.
Oh, I wasn't thinking changeable in terms of dynamically determining it during play. I was just thinking in terms of it being a different value for one fight than it normally is.

If the OP means a value that's not predetermined, clearly your hack is the way to do it.
 

WilsonE7

Regular
Regular
Joined
Oct 12, 2019
Messages
142
Reaction score
67
First Language
English
Primarily Uses
RMMZ
@Trihan @ATT_Turan
Thank you both for your suggestions. So, my boss's EXP is determined by how "smart" the player was in going through the dungeon. If they were efficient and didn't trigger many traps, they would get a better reward. So, in that sense, yes, the EXP is dynamic based on gameplay.

Where exactly would I put that script? I have no experience editing the JSON files directly, sorry if it's obvious. You just said "the enemy JSON," but Enemies.json doesn't seem to reference $gameTroop.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,563
Reaction score
7,141
First Language
English
Primarily Uses
RMMZ
@Trihan @ATT_Turan
Thank you both for your suggestions. So, my boss's EXP is determined by how "smart" the player was in going through the dungeon. If they were efficient and didn't trigger many traps, they would get a better reward. So, in that sense, yes, the EXP is dynamic based on gameplay.

Where exactly would I put that script? I have no experience editing the JSON files directly, sorry if it's obvious. You just said "the enemy JSON," but Enemies.json doesn't seem to reference $gameTroop.
Okay, so it's a bit of a hierarchy. enemies.json contains the core enemy data. Game_Enemy is a class that creates its members from the data in enemies.json. Game_Troop is a class that's a collection of Game_Enemy instances, among other things.

So $gameTroop.members()[x] gives you the Game_Enemy, calling its .enemy() function gives you the actual data object the json represents, and .exp is the experience value derived from the json data.

If you put the line I gave you in a turn 0 troop event, it'll modify that value, which is what will be used to calculate exp gain when you beat the boss. Ordinarily this would be a temporary measure as the exp value would revert to what it is in the data after you close the game and rerun it, but because it's for a boss this limitation doesn't matter, since you won't fight it again after you beat it.
 

WilsonE7

Regular
Regular
Joined
Oct 12, 2019
Messages
142
Reaction score
67
First Language
English
Primarily Uses
RMMZ
Okay, so it's a bit of a hierarchy. enemies.json contains the core enemy data. Game_Enemy is a class that creates its members from the data in enemies.json. Game_Troop is a class that's a collection of Game_Enemy instances, among other things.

So $gameTroop.members()[x] gives you the Game_Enemy, calling its .enemy() function gives you the actual data object the json represents, and .exp is the experience value derived from the json data.

If you put the line I gave you in a turn 0 troop event, it'll modify that value, which is what will be used to calculate exp gain when you beat the boss. Ordinarily this would be a temporary measure as the exp value would revert to what it is in the data after you close the game and rerun it, but because it's for a boss this limitation doesn't matter, since you won't fight it again after you beat it.
So that's what you meant by editing the JSON. That's a lot simpler than I was thinking. Thanks a lot!
 

Willibab

The Lord of Whackery
Regular
Joined
Jun 22, 2017
Messages
723
Reaction score
2,062
First Language
Norwegian
Primarily Uses
RMMZ
I'm terrible at this stuff, anyone able to help with any of these?:p

When user removes a state from self or ally they gain 4% of max MP.

User's MAT is increased or decreased based on user's MP%.
Something like 10% bonus for each 10% of mana. 50% being 0% bonus.

0% MP = -50% MAT (Not that it matters at this point xD)
-
40% MP = -10% MAT
50% MP = No bonus
60% MP = +10% MAT
-
100% MP = +50% MAT

Would also prefer for each stage to show an icon.

Using an elemental spell grants the user 2 separate buffs.
Buff 1: Increases the damage of two different elements by 33%.
Buff 2: Decreases the damage of two different elements by 33%.

If it helps, the elemental ids are 2,3,4,5,8 and 9.
 

Gurkengelee

Villager
Member
Joined
Jul 31, 2013
Messages
12
Reaction score
4
First Language
German
Primarily Uses
Hello!

Can someone please explain to me, how I use the Item Accessibilty Notetag to check if a user has learned a specific skill in order to be able to use the item?

I figured its something like
if user.hasSkill(X) {
enable == true }

but since I have no clue about JS I can't get it right :(

EDIT: Ok found the solution!

It's just:

<JS Item Enable>
enabled = (user.isLearnedSkill(X)
</JS Item Enable>

Wasn't that hard after all :)
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,196
Reaction score
9,145
First Language
English
Primarily Uses
RMMV
When user removes a state from self or ally they gain 4% of max MP.
This doesn't need anything to do with notetags. You can put it directly in the effects for the skill, under the Remove State effect you put a Recover MP 4% effect.
User's MAT is increased or decreased based on user's MP%.
You could put a bunch of passive states on the actor and have the appropriate conditions on them, e.g.:
Code:
<JS Passive Condition>
condition=user.mpRate()>=.8 && user.mpRate()<.9;
</JS Passive Condition>
would be active when the user's mp is within the 80% range, and you give that state the according Trait to modify MAT. This would also allow you to have different icons for each state.
Using an elemental spell grants the user 2 separate buffs.
I don't understand why this has anything to do with notetags or plugins. If it's a damage-dealing spell, you'd put a.addState(2); or whatever in the damage formula.
 

Willibab

The Lord of Whackery
Regular
Joined
Jun 22, 2017
Messages
723
Reaction score
2,062
First Language
Norwegian
Primarily Uses
RMMZ
This doesn't need anything to do with notetags. You can put it directly in the effects for the skill, under the Remove State effect you put a Recover MP 4% effect.

I wrote that badly.

Cleric has an skill called Bless. It removes all negative states. (I also want this skill to not be useable unless the target has one of these negative states, but that is another issue^^)

I want a passive state that makes it so when the cleric removes a negative state with Bless, the cleric gets +4% MP (not the target).

You could put a bunch of passive states on the actor and have the appropriate conditions on them, e.g.:
Code:
<JS Passive Condition>
condition=user.mpRate()>=.8 && user.mpRate()<.9;
</JS Passive Condition>
would be active when the user's mp is within the 80% range, and you give that state the according Trait to modify MAT. This would also allow you to have different icons for each state.

I did something similar but didn't know what code to make it so the stacks didn't....stack :p Will try this.


I don't understand why this has anything to do with notetags or plugins. If it's a damage-dealing spell, you'd put a.addState(2); or whatever in the damage formula.

I was thinking more of a passive, all classes share or can learn the same spells. So I'd like a passive for only 1 class that changes how it interacts with those same spells.

So every time Elementalist (who has this passive) uses a spell with the element id of 2,3,4,5,8 or 9. It gains these buffs.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,563
Reaction score
7,141
First Language
English
Primarily Uses
RMMZ
I'll sort that out later willibab if you still haven't had a solution.
 

Willibab

The Lord of Whackery
Regular
Joined
Jun 22, 2017
Messages
723
Reaction score
2,062
First Language
Norwegian
Primarily Uses
RMMZ
I'll sort that out later willibab if you still haven't had a solution.

Cheers!

The Mana Mastery one seem to work :p

Feel free to ask if something is unclear, I seem to be poor at conveying what I have in my head sometimes ^^
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,196
Reaction score
9,145
First Language
English
Primarily Uses
RMMV
Cleric has an skill called Bless. It removes all negative states. (I also want this skill to not be useable unless the target has one of these negative states, but that is another issue^^)
Code:
<JS Targets>
var states=[1, 3, 4, 8];
targets=$gameParty.aliveMembers().filter(member => states().forEach(state => member.states().indexOf(state)>=0));
</JS Targets>

That should make Bless only target actors who have a negative state (which you listed between the brackets after "states").
I want a passive state that makes it so when the cleric removes a negative state with Bless, the cleric gets +4% MP (not the target).
I still don't see a need for a separate passive state, just put in Bless:
Code:
<JS Post-Apply>
user.gainMp(user.mmp*.04);
</JS Post-Apply>

Unless the passive state is an add-on? Like, your cleric can learn Bless, then later they learn, like, Improved Bless that gives the MP regen? You still wouldn't need a passive state, just add to the code above if (user.isLearnedSkill(X)) where X is the ID of the Improved Bless.
I was thinking more of a passive, all classes share or can learn the same spells. So I'd like a passive for only 1 class that changes how it interacts with those same spells.

So every time Elementalist (who has this passive) uses a spell with the element id of 2,3,4,5,8 or 9. It gains these buffs.
I'm presuming these are damage spells. So you'd do:
Code:
<JS Post-Damage As User>
var state1=0, state2=0;
switch (this.item().damage.elementId)
{
    case 2:
        state1 = 16;
        state2 = 5;
        break;
    case 3:
        state1 = 18;
        state2 = 3;
        break;
}
if (state1>0)
{
    user.addState(state1);
    user.addState(state2);
}
</JS Post-Damage As User>

You use the format above and fill in all of your numbers. The number after case is the ID of the element. Then you set state1 and state2 equal to the two buffs you want to get from casting that element. Each element is going to have the case, two states, and break.
 
Last edited:

Willibab

The Lord of Whackery
Regular
Joined
Jun 22, 2017
Messages
723
Reaction score
2,062
First Language
Norwegian
Primarily Uses
RMMZ
Code:
<JS Targets>
var states=[1, 3, 4, 8];
targets=$gameParty.aliveMembers().filter(member => states().forEach(state => member.states().indexOf(state)>=0));
</JS Targets>

That should make Bless only target actors who have a negative state (which you listed between the brackets after "states").

The bless skill seems to be useable regardless of if the state is on a target or not. (I did mean for it to be an add-on but testing without it first.)

<JS Targets>
var states=[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 18, 19, 20, 22, 23, 26, 27, 28, 29, 30];
targets=$gameParty.aliveMembers().filter(member => states.forEach()(state => member.states().indexOf(state)>=0));
</JS Targets>

(I assumed this should be in the skill notetag? I tried it as a passive state too just incase.)

<JS Post-Apply>
user.gainMp(user.mmp*.04);
</JS Post-Apply>

dfs.PNG

I use the skill as a replacement command for guard but it didn't change when I tried it as a regular skill either.

The volatile elements works great, thanks :p
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,196
Reaction score
9,145
First Language
English
Primarily Uses
RMMV
The bless skill seems to be useable regardless of if the state is on a target or not.
I probably borked something up trying to be super efficient with the JavaScript array functions. This is more basic and should definitely work...if not, something is screwy.
Code:
<JS Targets>
var debuffs=[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 18, 19, 20, 22, 23, 26, 27, 28, 29, 30], i, j;
targets=undefined;

if (user.isLearnedSkill(X))
{
    for (i=0; i<$gameParty.aliveMembers().length; i++)
    {
        for (j=0; j<debuffs.length; j++)
        {
            if ($gameParty.aliveMembers()[j].states().includes(debuffs[j]))
                break;
        }
        if (j==debuffs.length)
            targets.push($gameParty.aliveMembers()[i]);
    }
}
</JS Targets>
where X is the ID of your improved bless add-on (or if you want to test without that, you can remove that if check and the top and bottom brace).:p
 

Willibab

The Lord of Whackery
Regular
Joined
Jun 22, 2017
Messages
723
Reaction score
2,062
First Language
Norwegian
Primarily Uses
RMMZ
Hmm, it's somehow worse now. You can target and use it on anyone still but it doesn't do anything nor does the MP gain trigger. Strange o_O

Tested it with minimum plugins too.
 

Latest Threads

Latest Posts

Latest Profile Posts

Ringing in Halloween Month by watching a new-to-me movie! Yay! 'Tis the season!
Skill Tutor Scene is all but done!


1696133612827.png
HawkZombie wrote on Slaughty's profile.
SLAUGHTY!
I remember hearing some guy playing Warhammer Fantasy Battle and getting his butt kicked by a girl who painted all her dwarves pink. She kept calling them her 'Little Gimli's.
Every JRPG needs a mandatory cliff scene.

Forum statistics

Threads
134,954
Messages
1,252,310
Members
177,806
Latest member
Breakfall
Top