MetalKing11417

Veteran
Veteran
Joined
Jul 7, 2018
Messages
129
Reaction score
85
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
Member
Joined
Dec 22, 2020
Messages
13
Reaction score
8
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
180
Reaction score
153
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
129
Reaction score
85
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
180
Reaction score
153
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
129
Reaction score
85
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
180
Reaction score
153
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
129
Reaction score
85
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
68
Reaction score
82
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
129
Reaction score
85
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
180
Reaction score
153
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
128
Reaction score
34
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
68
Reaction score
82
First Language
Chinese
Primarily Uses
RMMV

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
180
Reaction score
153
First Language
English
Primarily Uses
RMMV

NoPiessadface

Veteran
Veteran
Joined
Feb 7, 2019
Messages
128
Reaction score
34
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
129
Reaction score
85
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 home state baseball team is going back to the World Series for the first time since 1999. I remember when they went in 1995 and won, that was like the best day of my life. (I'm a huge baseball fan and yes I'm talking about the Braves).
FL Studio is a huge step up from LMMS but I'm having such a tough time with it D:<
The new Dune movie reminds me of the game Dune 2 made by Westwood. A quality product on its own, but extremely disloyal to its source of inspiration.
Terrible Writing Advice, you've done it again.
1635026211997.png

Forum statistics

Threads
116,041
Messages
1,095,232
Members
151,386
Latest member
sheyzo
Top