MetalKing11417

Veteran
Veteran
Joined
Jul 7, 2018
Messages
189
Reaction score
112
First Language
english
Primarily Uses
RMMV
Ok, I have been thinking- for a lot of strategy games, knowing your opponents weaknesses and strengths is an important part of the experience. However there are no add-ons that would aid this in a way that is convenient for SRPG gameplay.
So I have a suggestion for a plugin- when the user is using a weapon or skill, a symbol will appear on enemy units that will designate whether they would take more or less damage than usual. These symbols will also appear when moving when the user's basic attack will do more or less than the base damage.
 

darkand

Nomad Robot Artis
Veteran
Joined
Dec 22, 2020
Messages
47
Reaction score
15
First Language
spanish
Primarily Uses
RMMV
i have a question, is posible get the actor ID on a variable like already have the event ID? every time when is a diferent map, the charaters change of event ID soo is very dificult use it
 

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
224
Reaction score
215
First Language
English
Primarily Uses
RMMV
i have a question, is posible get the actor ID on a variable like already have the event ID? every time when is a diferent map, the charaters change of event ID soo is very dificult use it
Do you mean convert actorId to eventId? There is $gameSystem.ActorToEvent(actorId) which spits out the eventId of the actor (or zero if the actor doesn't exist)
Ok, I have been thinking- for a lot of strategy games, knowing your opponents weaknesses and strengths is an important part of the experience. However there are no add-ons that would aid this in a way that is convenient for SRPG gameplay.
So I have a suggestion for a plugin- when the user is using a weapon or skill, a symbol will appear on enemy units that will designate whether they would take more or less damage than usual. These symbols will also appear when moving when the user's basic attack will do more or less than the base damage.
Code:
    var _effectiveDamage = Window_SrpgPrediction.prototype.drawSrpgBattleDamage;
    Window_SrpgPrediction.prototype.drawSrpgBattleDamage = function(damage, x, y) {
        _effectiveDamage.call(this, damage, x, y);
            if($gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[1].elementRate($gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1].currentAction().item().damage.elementId) > 1) {
                this.drawTextEx("\\I[33]", x + 140, y, 100);
            }               
    };

I made a small code for you. It will show icon 33 if enemy has an elementRate of more than 1 (aka weak) for the user's action. If you use yanfly element core to add extra elements then you'll have to add some extra code in. You can just copy the same code and make a "not very effective" message appear too.

You can put this in its own plugin or just slap it on the bottom of srpg_core.js/random plugin
 

MetalKing11417

Veteran
Veteran
Joined
Jul 7, 2018
Messages
189
Reaction score
112
First Language
english
Primarily Uses
RMMV
Do you mean convert actorId to eventId? There is $gameSystem.ActorToEvent(actorId) which spits out the eventId of the actor (or zero if the actor doesn't exist)

Code:
    var _effectiveDamage = Window_SrpgPrediction.prototype.drawSrpgBattleDamage;
    Window_SrpgPrediction.prototype.drawSrpgBattleDamage = function(damage, x, y) {
        _effectiveDamage.call(this, damage, x, y);
            if($gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[1].elementRate($gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1].currentAction().item().damage.elementId) > 1) {
                this.drawTextEx("\\I[33]", x + 140, y, 100);
            }            
    };

I made a small code for you. It will show icon 33 if enemy has an elementRate of more than 1 (aka weak) for the user's action. If you use yanfly element core to add extra elements then you'll have to add some extra code in. You can just copy the same code and make a "not very effective" message appear too.

You can put this in its own plugin or just slap it on the bottom of srpg_core.js/random plugin
Seeing as how I am using Element core, how would it differ?

Edit: while this is good for now, I was suggesting a plug-in so the player could evaluate multiple enemies on the map simultaneously, which is something that cannot be done through just the prediction window.
 
Last edited:

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
224
Reaction score
215
First Language
English
Primarily Uses
RMMV
Seeing as how I am using Element core, how would it differ?

Edit: while this is good for now, I was suggesting a plug-in so the player could evaluate multiple enemies on the map simultaneously, which is something that cannot be done through just the prediction window.
Code:
var _effectiveDamage = Window_SrpgPrediction.prototype.drawSrpgBattleDamage;
Window_SrpgPrediction.prototype.drawSrpgBattleDamage = function (damage, x, y) {
    _effectiveDamage.call(this, damage, x, y);
    if (Imported.YEP_ElementCore) {
        if ($gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1].currentAction().calcElementRate($gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[1]) > 1) {
            this.drawTextEx("\\I[33]", x + 140, y, 100);
        }
    } else {
        if ($gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[1].elementRate($gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1].currentAction().item().damage.elementId) > 1) {
            this.drawTextEx("\\I[33]", x + 140, y, 100);
        }
    }
};
I updated my code to be compatible with element core (lucky I use this script too haha)
Yanfly Element core has multiple elements and 'element modifier rules' so we need to use Yanfly's functions to calculate element rate
Otherwise the default way to calculate element damage is "what element does this skill have in the game database and what is the element rate of the target".

As for showing multiple enemies on the map simultaneously, that is a harder task. But after a whole day I managed to do it!
I made it into a proper plugin

Example.gif


As shown above, if the enemy is weak a green square appears, if they are strong a cyan square appears. The script is highly customisable. If you don't like the yellow 'flash' then change the plugin parameter in srpg_aoe
 

MetalKing11417

Veteran
Veteran
Joined
Jul 7, 2018
Messages
189
Reaction score
112
First Language
english
Primarily Uses
RMMV
Code:
var _effectiveDamage = Window_SrpgPrediction.prototype.drawSrpgBattleDamage;
Window_SrpgPrediction.prototype.drawSrpgBattleDamage = function (damage, x, y) {
    _effectiveDamage.call(this, damage, x, y);
    if (Imported.YEP_ElementCore) {
        if ($gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1].currentAction().calcElementRate($gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[1]) > 1) {
            this.drawTextEx("\\I[33]", x + 140, y, 100);
        }
    } else {
        if ($gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[1].elementRate($gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1].currentAction().item().damage.elementId) > 1) {
            this.drawTextEx("\\I[33]", x + 140, y, 100);
        }
    }
};
I updated my code to be compatible with element core (lucky I use this script too haha)
Yanfly Element core has multiple elements and 'element modifier rules' so we need to use Yanfly's functions to calculate element rate
Otherwise the default way to calculate element damage is "what element does this skill have in the game database and what is the element rate of the target".

As for showing multiple enemies on the map simultaneously, that is a harder task. But after a whole day I managed to do it!
I made it into a proper plugin

Example.gif


As shown above, if the enemy is weak a green square appears, if they are strong a cyan square appears. The script is highly customisable. If you don't like the yellow 'flash' then change the plugin parameter in srpg_aoe
This is exactly What I meant.

Also, You should make note to have it bellow both SRPG_ShowPath and SRPG_AuraSkill, as I found it to crash if I moved the wrong way when it was above them.
Also, do you plan on fixing the incompatibility with specialRange when used with AOE?
 

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
224
Reaction score
215
First Language
English
Primarily Uses
RMMV
Hmm, I tested it out and specialRange seems to work out of the box. I assumed specialRange wouldn't work because its not referenced in AoE.js but I guess it doesn't matter because specialRange doesn't actually affect AoE.

A nice bonus (or perhaps not) is that it works with yanfly's element amplification; meaning if a unit has 50% element rate to fire (aka takes half damage from fire) but the user has 300% fire elemental amplification, the resulting damage will actually be at 150% damage (so it will show the enemy being 'weak' despite not actually being weak). You could probably circumvent this by changing the javascript eval to incorporate elemental amplification or you could leave it in to show the player that their fire attacks do super effective damage on almost everything.
 

MetalKing11417

Veteran
Veteran
Joined
Jul 7, 2018
Messages
189
Reaction score
112
First Language
english
Primarily Uses
RMMV
Hmm, I tested it out and specialRange seems to work out of the box. I assumed specialRange wouldn't work because its not referenced in AoE.js but I guess it doesn't matter because specialRange doesn't actually affect AoE.

A nice bonus (or perhaps not) is that it works with yanfly's element amplification; meaning if a unit has 50% element rate to fire (aka takes half damage from fire) but the user has 300% fire elemental amplification, the resulting damage will actually be at 150% damage (so it will show the enemy being 'weak' despite not actually being weak). You could probably circumvent this by changing the javascript eval to incorporate elemental amplification or you could leave it in to show the player that their fire attacks do super effective damage on almost everything.
Well, I found it throws an error when you have a weapon/ skill that does AOE damage and uses a special range like that of Rook/Line.
 

Shoukang

Veteran
Veteran
Joined
Jan 28, 2021
Messages
158
Reaction score
170
First Language
Chinese
Primarily Uses
RMMV
i have a glitch on advance interaction when i try to make and open a door the selection window won't close and i can't select units
EDIT:
also how does level on enemies work does it change their stats or just a display/ threat level?
If you can find what condition caused this problem, I can try to repeat and solve it.
The enemy level is just a display.
 

MetalKing11417

Veteran
Veteran
Joined
Jul 7, 2018
Messages
189
Reaction score
112
First Language
english
Primarily Uses
RMMV
A nice bonus (or perhaps not) is that it works with yanfly's element amplification; meaning if a unit has 50% element rate to fire (aka takes half damage from fire) but the user has 300% fire elemental amplification, the resulting damage will actually be at 150% damage (so it will show the enemy being 'weak' despite not actually being weak). You could probably circumvent this by changing the javascript eval to incorporate elemental amplification or you could leave it in to show the player that their fire attacks do super effective damage on almost everything.
Oh yeah, could you give an example on how to take the element amplification out?
 

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
224
Reaction score
215
First Language
English
Primarily Uses
RMMV
Well, I found it throws an error when you have a weapon/ skill that does AOE damage and uses a special range like that of Rook/Line.
What error are you getting? is it an error regarding currentAction.item (line 73)? If so I fixed that bug (delete plugin and reinstall as it also changes the plugin parameters)
1631757049465.png

The bug i was referring to was to is demonstrated above. Notice the bat on the left isn't blue because its not in the "target range", it is in the AoE range (this also happens to any aoe attacks that apply damage outside the srpgRange zone so it's not just a problem of specialRange). I'll try to fix it. I have the script way on the bottom after everything (though it only changes one function so it shouldn't break anything)

Oh yeah, could you give an example on how to take the element amplification out?
Hmm, I looked at Yanfly's code and how amplifcation rate is calculated is actually pretty complicated
The main issue is if a skill has multiple elements.
I'm going to assume if you use rule 4 for element damage calculation (element Rates are averaged for multi-element attacks) then you want to change the plugin parameter (condition) to the following:


Code:
var amplifyRate = 0; var elements = actor.currentAction().getItemElements(); while (elements.length > 0) { var elementId = elements.shift(); amplifyRate += actor.elementAmplifyRate(elementId); } effectiveAmplifyRate = amplifyRate / Math.max(1, actor.currentAction().getItemElements().length); (actor.currentAction().calcElementRate(enemy) - effectiveAmplifyRate > 1)

I'll briefly explain how it works
1. It grabs actor's skill elements
2. For each element, it checks if there is amplifcation on the element
3. It then divides the 'total amplifcation' by the number of elements. This assumes rule 4 of yanfly's element_core
4. It then calculates the enemy's element rate to the current attack (this is a function that yanfly provides)
5. We then remove the 'amplify' value from the element rate and see if its above or below 1

Edit:
I added aoe compatibility. Note the second bat looks 'green' because srpg_aoe target tiles are yellow and zone_customisation tiles are cyan so blending the two results in green. You can fix this by changing the opacity setting defined in srpg_aoe.js (Sprite_SrpgAoE.prototype.updateAnimation)

Example2.gif
 
Last edited:

NoPiessadface

Veteran
Veteran
Joined
Feb 7, 2019
Messages
190
Reaction score
55
First Language
english
Primarily Uses
RMVXA
If you can find what condition caused this problem, I can try to repeat and solve it.
it only works when the map has only one type of actor unit the softlock glitch happens when it has more than one.

2 or more than units:
Screenshot (150).png

1 unit:
Screenshot (151).png
Screenshot (152).png

what i did on the event:
Screenshot (149).png
 

Shoukang

Veteran
Veteran
Joined
Jan 28, 2021
Messages
158
Reaction score
170
First Language
Chinese
Primarily Uses
RMMV

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
224
Reaction score
215
First Language
English
Primarily Uses
RMMV

NoPiessadface

Veteran
Veteran
Joined
Feb 7, 2019
Messages
190
Reaction score
55
First Language
english
Primarily Uses
RMVXA
Instead of erase event try this script call: $gameMap[this._eventId] = null;
I had a few instances where using eraseEvent caused some glitches though I forgot where and how
nope it didn't work
 

MetalKing11417

Veteran
Veteran
Joined
Jul 7, 2018
Messages
189
Reaction score
112
First Language
english
Primarily Uses
RMMV
OK I am not sure what's happening, but whenever I try to use your Zone customization plug-in I keep getting this sort of error:
Error Zone Customize.png
 

Latest Threads

Latest Profile Posts

My brother makes some inane complaint about one of my stories in the comment section. My mom: if your bro doesn't understand it make it simpler. That prolly means others have questions too.☺️Me: Sorry. I can't do that. I don't speak stupid.
If you are ever looking for your cat among a room full of identical looking cats just find the one that is doing it's best to ignore you.
Isn't "tableau" such a fun word to say? Even better is that our resident artists know what it means without google and probably get to say it regularly.
ScreenShot_3_27_2023_4_30_39.png
one of the benefits of doing almost all the assets myself is being able to add my friend's OC from his comic book into my game as an NPC.
Quick survey: How much of importance is the game UI for your experience, as a player and game designer?

Forum statistics

Threads
129,894
Messages
1,206,023
Members
171,070
Latest member
gbnfg
Top