Weapon out of Range

Hi,

This is for a commercial project.

I'm trying to find a way to have certain weapons always miss enemies that may be too far to hit, example - flying enemies.

What I've tried so far, is creating a 'ground' element, and applying it to the 'attack' skill for a no weapon situation, and applying the attack 'ground element' to Features for select weapons, and finally, giving the enemies concerned a 'ground' Elemental rate * 0%.

The problem is that, while this works fine, I'm getting 'null' and 'immune' on attacking. Now I can modify the null or immune text to work for this situation, but then I will have to construct my game to work without the original intent of null or immune.

I need a way then, to make an 'out of range' situation independent of null or immune.

Does a script exist to handle this situation?

Thanks.
You know, this is a great idea for attacking them really high mobs XD

For which BS are you talkin about? Would be great if someone can have one for Schala BS as well 😀
I'm using various scripts from Yanfly, but creating a custom battle system using my own rules.
Why not approach it in a reversed way?

Instead of ground, do fly. And instead of doing that for all weapons, do that for bows/long ranged weapons.

Less items/enemies needed to be changed this way.

And if you don't want to do it using immunity(that shows NULL and IMMUNE), you can always try using states instead.

Set up a "Fly" state, with something like dodge rate + 80%, dispelled when hit.(so it only shows MISS)

Give bees/birds enemies a fly state at the beginning of a battle(troop eventing)

And give your long ranged weapons a way to "dispel" fly state, like +Hit rate 200%

So whenever these monsters are hit with a long ranged/ground weapon, they no longer "fly" and all other weapons can harm them as if they have fallen to the ground.

Just an example, you can still config the states to work anyway you like, and further more, there are scripts out there that even allow you to use formulas in states, so you can do a lot of "conditions" setting.
It's a bit confusing to me, as this is the first time I'm looking deeply into the battle system and there are so many options!

Perhaps you can help me step by step?

Specifically, I want a short-ranged weapon to miss a flying enemy, and the player receives some kind of 'out of range!' popup. I don't want the text to be as a 'show text' command, but something like a 'null' or 'immune' popup so the battle would not be paused.
Craze has a script called "elemental boosters" that can be used to replicate this, with it you can set enemies to have adjusted evade rates to specific elements rather than just physical or magical, just have flying enemies have +100% evade to all elements used for short ranged weapons and you're golden, well tested as I use this script in my game for this very purpose already. https://crazescriptasylum.wordpress.com/rmvxa-scripts/

Edit: just realized this was for a commercial project, not certain what the author's position is with regards to his scripts in that regard so be sure to verify that before committing to it's use of course.
There are no terms of use on the script or website, and there does not seem to be a clear way to contact Craze.

Maybe someone knows of a way to set this up without scripts. Because if this can be set up in the database, then, with the flying state/skill is inflicted, I can have the message 'X's weapon is out of range' or 'Enemy X is out of range'.

EDIT:

Actually, I may need a script to set this up, because it seems that Yanfly's script ignores 'Message when an enemy fell in the state' and so I will not be able to use a 'weapon is out of range' notification in this way.

EDIT 2:

Here is an update of what I have so far.

I have a new element called Ground.

For flying enemies, under Features: Element Rate [Ground] * 0%

For limited-range weapons. under Features: Atk Element [Ground]

Change 'NULL!' text to 'Weapon is out of range!'

Change Attack formula to [a.atk*4 - b.def*2, 1].max so an attack will never be null (lowest attack possible is now 1HP damage)

Now I need a script call to change the Element Rate [Ground] of the enemy when it is knocked down to something above 0%.

I also need a way to shift the enemy graphic visually along the y-axis.

EDIT 3:

So, progress!

I'm using Change Enemy Stats Mid-Play.

I've used the script call change_en_feature(enemy id, slot, code, data_id, value)

The variables I've used are: change_en_feature(1, 5, 11, 0, 0)

Now that works, but I don't have a complete understanding of what I've done.

enemy id - I'm testing this with the first enemy, so I've used 1.

Slot - Element Rate [Ground] * 0% is the fifth Feature of Enemy 001, so I've used 5.

In the script, Element Rate is defined by eleven, so I've used 11.

This is where things got quite confusing. I don't know how to change 0% to something higher with these remaining two variables. I've just filled them in both as 0.

For some reason, this worked. After this script call, I'm able to attack flying enemies with short-ranged weapons.

But I need to understand this script call to have better control over what I'm doing, especially since this changes the default values, I need to reset them to the original ones before the next battle by using this code again.

And am I using 'slot' correctly?

Thanks.
bump

Original thread: https://forums.rpgmakerweb.com/threads/weapon-out-of-range.44590/