Novam4a1

Veteran
Veteran
Joined
Nov 2, 2020
Messages
35
Reaction score
7
First Language
English
Primarily Uses
RMMZ
Good to see you solved it! :kaojoy:

Just to clarify, your original notetag would be read as:
  • <target filter: return target.hpRate() >
It gets cut short because > closes the tag (because I was lazy when implementing these tags). The result of this is that valid targets must have a "truthy" HP%...but the only not-truthy number in JavaScript is 0. :kaoswt:

For future reference: you can flip expressions and use < instead where necessary. E.g. to target only battlers with more than 20% HP:
  • <target filter: return 0.2 < target.hpRate();>
Awesome! Thank you very much! I'll definitely use that if I need to make a HP > [number] target condition!
 
Joined
Feb 17, 2014
Messages
4
Reaction score
1
First Language
English
Primarily Uses
The OnUseEffects plugin seems to prevent enemies from using escape-based skills? At least when used with Visustella plugins.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
The OnUseEffects plugin seems to prevent enemies from using escape-based skills? At least when used with Visustella plugins.
I just did this test in the VisuStella Sample Project and saw no problem:
  • Import Cae_OnUseEffects via the Plugin Manager.
  • Add skill 15 (Escape) to an enemy with no other skills (Youko).
  • Save the project.
  • Choose the appropriate troop on the Troops tab and start a battle test.
  • Select "Guard" for all actors to ensure the enemy has a chance to act.
  • Enemy uses escape, escape effect applies, victory phase begins, battle ends.
 
Joined
Feb 17, 2014
Messages
4
Reaction score
1
First Language
English
Primarily Uses
I just ran some more tests with a fresh project, and it seems to be a conflict with their Battle AI plugin.

Plugins installed: VS Core Engine, VS Battle Core, VS Battle AI, CaeOnUseEffects

I set up a battle test using the default goblin enemy, but added Escape and removed all other skills. On the goblin turns, they do not perform any action.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
Ah, it's the Battle AI one. You're loading mine after VisuStella's, right? I'm not sure what might be causing the problem, sorry. Even if I had that plugin, I wouldn't be able to simply look through and identify the conflict because VisuStella obfuscates their code. :kaoslp:

Out of interest, what features of OnUseEffects do you want that aren't offered by VisuStella? Maybe you could ask for those features to be added to their plugin(s)?
 
Joined
Feb 17, 2014
Messages
4
Reaction score
1
First Language
English
Primarily Uses
I tried loading it before and after and ended up with the same result (it was also affecting not just Escape, but other skills that targeted User or Allies, weirdly enough). I'm using OnUseEffects for targeting/selection control, which the Visustella team has said they have no plans to do. A bit of a bummer, but I can live without the Battle AI plugin, so this can just be a compatibility PSA!

Thank you for taking the time to check it out :)
 

Jeremyr

Villager
Member
Joined
Jun 13, 2019
Messages
12
Reaction score
5
First Language
English
Primarily Uses
RMMV
With the OnUseEffects plugin, would it be possible to make it so, <target filter: > works for enemies too?

I've tried testing it out and seems like doesn't work for them, lets say the enemy has just 1 target, but the skill they try to use, can't be used on that target, I would figure it would make them use another that was able to, or do nothing at all, idk if its possible or not with how enemies skills might work, instead of player, but if it was would be good addition.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
With the OnUseEffects plugin, would it be possible to make it so, <target filter: > works for enemies too?
I'm not sure what you're seeing, but OnUseEffects should make it so that if a skill has no valid targets, it is not available for use. [Edit: but v1.4 of the plugin does not do this, see follow-up post.] This applies to both actors and enemies. If you give that skill to an actor, do you see the expected target restriction?

If the problem only occurs with OnUseEffects enabled (i.e. it's not something like "Fireball costs 50 MP but this enemy has 0 MP") then you might have an error in your <target filter> notetag.

I did this test with no other plugins:
  • Import Cae_OnUseEffects.
  • Pick an enemy and set their skills to Attack (priority 5) and Petrify (priority 9).
    • This means the enemy will always use Petrify if possible.
    These skills both have Scope: 1 Enemy. Make sure they have 0 cost as well.
  • Add this notetag to the Petrify skill:
    • <target filter: target.index() === 0>
    I.e. "the target must be the leader (index 0) of their unit".
  • Save the project to apply Plugin Manager changes.
  • Start a battle test with an appropriate troop.
  • Every turn, set all party members to guard:
    • Every turn, the enemy uses Petrify on the party leader, as intended.
  • Kill the party leader using this line in the console: $gameParty.leader().addState(1).
  • Every turn, set all party members to guard:
    • Every turn, the enemy uses Attack on any party member, because Petrify no longer has any valid targets.
 
Last edited:

Jeremyr

Villager
Member
Joined
Jun 13, 2019
Messages
12
Reaction score
5
First Language
English
Primarily Uses
RMMV
I'm not sure what you're seeing, but OnUseEffects should make it so that if a skill has no valid targets, it is not available for use. This applies to both actors and enemies. If you give that skill to an actor, do you see the expected target restriction?

If the problem only occurs with OnUseEffects enabled (i.e. it's not something like "Fireball costs 50 MP but this enemy has 0 MP") then you might have an error in your <target filter> notetag.

I did this test with no other plugins:
  • Import Cae_OnUseEffects.
  • Pick an enemy and set their skills to Attack (priority 5) and Petrify (priority 9).
    • This means the enemy will always use Petrify if possible.
    These skills both have Scope: 1 Enemy. Make sure they have 0 cost as well.
  • Add this notetag to the Petrify skill:
    • <target filter: target.index() === 0>
    I.e. "the target must be the leader (index 0) of their unit".
  • Save the project to apply Plugin Manager changes.
  • Start a battle test with an appropriate troop.
  • Every turn, set all party members to guard:
    • Every turn, the enemy uses Petrify on the party leader, as intended.
  • Kill the party leader using this line in the console: $gameParty.leader().addState(1).
  • Every turn, set all party members to guard:
    • Every turn, the enemy uses Attack on any party member, because Petrify no longer has any valid targets.

Hmmm, seems you were right with my code not being right, removing 'return' before the conditions, seems to make them work how I want, which I don't fully understand why, since they work for the player, is it something to do with it being the monster? I noticed you didn't use return in the example you gave, which led me to try that.

After playing around with it more, seems like if you use <target filter: return 'condition'>, when you have more than 1 player in the party, it does not work, but just <target filter: 'condition'> will work. Maybe its just something I don't understand, or another plugin causing it to act up.
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
I investigated more thoroughly and discovered you were correct in your first post. RNG and confirmation bias fooled me the first time around. Sorry for the confusion! :kaoswt2:

The notetag should use return, that was my mistake; e.g.
  • <target filter: return target.index() === 0;>
If the target filter function is defined but doesn't have a return statement, it will always return false, i.e. no targets will be considered valid. I haven't done much with my plugins in a while, but I should have spotted that... :kaoslp:

My plugin alters testApply and itemTargetCandidates, but it turns out that enemies do not check for targets until their action is decided.

As I mentioned, a skill with a target filter should not be usable if there are no targets, for enemies or actors. I'll look into that for the v1.5 update of OnUseEffects, thanks for mentioning it! :kaojoy:
 

Jeremyr

Villager
Member
Joined
Jun 13, 2019
Messages
12
Reaction score
5
First Language
English
Primarily Uses
RMMV
I investigated more thoroughly and discovered you were correct in your first post. RNG and confirmation bias fooled me the first time around. Sorry for the confusion! :kaoswt2:

The notetag should use return, that was my mistake; e.g.
  • <target filter: return target.index() === 0;>
If the target filter function is defined but doesn't have a return statement, it will always return false, i.e. no targets will be considered valid. I haven't done much with my plugins in a while, but I should have spotted that... :kaoslp:

My plugin alters testApply and itemTargetCandidates, but it turns out that enemies do not check for targets until their action is decided.

As I mentioned, a skill with a target filter should not be usable if there are no targets, for enemies or actors. I'll look into that for the v1.5 update of OnUseEffects, thanks for mentioning it! :kaojoy:
No worries, I know the feeling. Like when I just wrote that without the return it was working, i failed to test any further than the first target, so I didn't notice it was only working, because it was false for everyone.

I figured it might of been something to do with, enemies checking differently than a player, since the damage will not apply, but the skill and animation will go off, like it knows it is unusable but can still force it.

Do you think it is possible to do? If so I'll wait for you to update it, rather than trying to figure out a workaround.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
Do you think it is possible to do? If so I'll wait for you to update it, rather than trying to figure out a workaround.
It turned out easier than expected! I've just released v1.5 of the plugin, same link as before: Cae_OnUseEffects. Let me know if you have problems with it! :kaohi:

I forgot that enemies use the random target system: to restrict their targets I hooked into the random target generation methods. You can disable this if you like via the new Filter Random Targets parameter (true/enabled by default). Regardless, enemies should now ignore skills with no available targets when choosing their actions.

I also finally figured out subskills for Attack/Guard, fixed a very situational bug with filtered actor selection, and moved the effect condition evaluation so it happens after the damage formula: now you can reference the action result in effect conditions, e.g. target.result().critical. :kaopride:
 

2DMike

Villager
Member
Joined
Aug 1, 2021
Messages
6
Reaction score
3
First Language
English
Primarily Uses
RMMZ

    • v1.1 Cae_SlopeMove 2020-08-22
      Mark diagonal slopes with regions => left/right moves go diagonally up/down the slope.
      See also: some stair tiles by Avery(remember to check Avery's terms of use)
:kaoluv:
Most important bit: THANK YOU SO MUCH!!! Your plugins are fantastic and I'm enjoying your SlopeMove one in particular.

Unfortunately, I seem to have hit a bit of a snag when opening the Main Menu from within a map where there are a couple of parallel process events that utilise VisuStella's EventMoveCore.

I'm just wondering whether anyone has perhaps come across a similar issue to the one I'm having:


TypeError
Cannot read property '_tilemap' of undefined'

rmmz_managers.js:2030 TypeError: Cannot read property '_tilemap' of undefined
at Object.$.isOverpassTile (Cae_SlopeMove.js:276)
at Game_Event.Game_CharacterBase.slopeCheck (Cae_SlopeMove.js:424)
at Game_Event.Game_CharacterBase.moveStraight (Cae_SlopeMove.js:444)
at Game_Event.Game_CharacterBase.<computed>.<computed> [as executeMoveDir8] (VisuMZ_1_EventsMoveCore.js:6692)
at Game_Event.Game_Character.<computed>.<computed> [as processMoveRouteStepTo] (VisuMZ_1_EventsMoveCore.js:6692)
at Game_Event.Game_Character.<computed>.<computed> [as processMoveRouteMoveTo] (VisuMZ_1_EventsMoveCore.js:6692)
at Game_Event.Game_Character.<computed>.processMoveCommandEventsMoveCore (VisuMZ_1_EventsMoveCore.js:6692)
at Game_Event.Game_Character.<computed>.<computed> [as processMoveCommand] (VisuMZ_1_EventsMoveCore.js:6692)
at Game_Event.Game_Character.updateRoutineMove (rmmz_objects.js:7605)
at Game_Event.Game_Character.updateStop (rmmz_objects.js:7594)


Looks like some sort of clash with VisuStella EventsMoveCore. I've tried moving the plugins about and tried using the plugin on a per-map basis, then removing the effect at the end of the map. Still coming across this error.

No worries if not, I'll just have to have a bit of a redesign :)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
Unfortunately, I seem to have hit a bit of a snag when opening the Main Menu from within a map where there are a couple of parallel process events that utilise VisuStella's EventMoveCore.

I'm just wondering whether anyone has perhaps come across a similar issue to the one I'm having:


TypeError
Cannot read property '_tilemap' of undefined'

rmmz_managers.js:2030 TypeError: Cannot read property '_tilemap' of undefined
at Object.$.isOverpassTile (Cae_SlopeMove.js:276)
It happens when opening the pause menu? Strange! It looks like the map is updating (even if only for 1 frame) while on the menu. :kaoswt:

I just uploaded v1.2 of SlopeMove, same link: Cae_SlopeMove. It's almost the same as before, I just rewrote my isOverpassTile method in a slightly "safer" way. Now if that happens, instead of crashing the game, it will just assume the tile is not an overpass. :kaohi:
 

Jeremyr

Villager
Member
Joined
Jun 13, 2019
Messages
12
Reaction score
5
First Language
English
Primarily Uses
RMMV
It turned out easier than expected! I've just released v1.5 of the plugin, same link as before: Cae_OnUseEffects. Let me know if you have problems with it! :kaohi:

I forgot that enemies use the random target system: to restrict their targets I hooked into the random target generation methods. You can disable this if you like via the new Filter Random Targets parameter (true/enabled by default). Regardless, enemies should now ignore skills with no available targets when choosing their actions.

I also finally figured out subskills for Attack/Guard, fixed a very situational bug with filtered actor selection, and moved the effect condition evaluation so it happens after the damage formula: now you can reference the action result in effect conditions, e.g. target.result().critical. :kaopride:
It seems to work, but also creates a new problem, like if you are using VisuMz_AggroControl or anything else like it, they will still be able to use the abilities on targets they are forced to. But I guess since the target filter, only removes the target from a list, then you are forcing that target as the target it is only natural.

I guess it would maybe have to be more of a skill enabled thing? One thing to note, is like I've mentioned before, if the filter is on a target that it shouldn't be able to target, but is forced too, it will do the animation but not the damage. So I don't know if there is anything that can be done with this, or just need to work around the fact it it will not do damage at least.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
It seems to work, but also creates a new problem, like if you are using VisuMz_AggroControl or anything else like it, they will still be able to use the abilities on targets they are forced to.
Ah yep, that makes sense. Maybe try loading OnUseEffects before VisuStella Aggro Control (click+drag to rearrange plugins) to see if that helps? Save your project to apply Plugin Manager changes before testing~

Otherwise there might be some script function you can use to manually check VisuStella's Aggro system in my target filter? Unfortunately I can't do much about conflicts with obfuscated plugins like this, so you may need a workaround here. :kaoslp:

(I have considered/partially designed a complete overhaul of my RMMZ plugins, including some additions like taunts. However, if I ever do release something like that, it certainly won't be any time soon.)
 

2DMike

Villager
Member
Joined
Aug 1, 2021
Messages
6
Reaction score
3
First Language
English
Primarily Uses
RMMZ
It happens when opening the pause menu? Strange! It looks like the map is updating (even if only for 1 frame) while on the menu. :kaoswt:

I just uploaded v1.2 of SlopeMove, same link: Cae_SlopeMove. It's almost the same as before, I just rewrote my isOverpassTile method in a slightly "safer" way. Now if that happens, instead of crashing the game, it will just assume the tile is not an overpass. :kaohi:
Thank you so much! v1.2 works perfectly :)
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,528
Reaction score
16,003
First Language
Filipino
Primarily Uses
RMMZ
Thanks very much for Slope Movement. I didn't want to figure out how to code this on top of my other work. :kaoluv:
 

Hidemitsu

Warper
Member
Joined
Sep 19, 2021
Messages
2
Reaction score
1
First Language
Portuguese BR
Primarily Uses
RMMZ
Hi. Im new in RPGMaker MZ.

I tried use your PictureTouch plugin but doesn't work.

The prints:

1631999885294.png

1631999987002.png
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,986
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
@Hidemitsu: Cae_PictureTouch works OK for me in a project with no other plugins. :kaoslp:

From what information you have given, your setup seems OK. If that event has an Autorun trigger, then make sure to disable it afterwards so that it only runs once, e.g. add an Erase Event command at the end. Erased map events will come back after you leave and return to that map.

If you just need the click trigger, maybe check out ButtonPicture.js instead. It comes with RPG Maker MZ, in new projects by default. :kaohi:
 

Latest Threads

Latest Posts

Latest Profile Posts

aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v
Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)

Forum statistics

Threads
117,277
Messages
1,106,068
Members
153,452
Latest member
moe334
Top