MetalKing11417

Regular
Regular
Joined
Jul 7, 2018
Messages
192
Reaction score
114
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
Regular
Joined
Dec 22, 2020
Messages
49
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

Regular
Regular
Joined
Jan 6, 2013
Messages
243
Reaction score
241
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

Regular
Regular
Joined
Jul 7, 2018
Messages
192
Reaction score
114
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

Regular
Regular
Joined
Jan 6, 2013
Messages
243
Reaction score
241
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

Regular
Regular
Joined
Jul 7, 2018
Messages
192
Reaction score
114
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

Regular
Regular
Joined
Jan 6, 2013
Messages
243
Reaction score
241
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

Regular
Regular
Joined
Jul 7, 2018
Messages
192
Reaction score
114
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

Regular
Regular
Joined
Jan 28, 2021
Messages
158
Reaction score
172
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

Regular
Regular
Joined
Jul 7, 2018
Messages
192
Reaction score
114
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

Regular
Regular
Joined
Jan 6, 2013
Messages
243
Reaction score
241
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

Regular
Regular
Joined
Feb 7, 2019
Messages
197
Reaction score
62
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

Regular
Regular
Joined
Jan 28, 2021
Messages
158
Reaction score
172
First Language
Chinese
Primarily Uses
RMMV

boomy

Regular
Regular
Joined
Jan 6, 2013
Messages
243
Reaction score
241
First Language
English
Primarily Uses
RMMV

NoPiessadface

Regular
Regular
Joined
Feb 7, 2019
Messages
197
Reaction score
62
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

Regular
Regular
Joined
Jul 7, 2018
Messages
192
Reaction score
114
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

Huge breakthrough! I finally fixed the dimensions on the WEBM used in the cinematic that ends the demo and introductory segment in MC:RIS, around the one-minute mark:



(There's some audio desync because the capture is an MP4.)
Kudos to everyone making game jam games, because this month has been hell for my development time. I have made a cutscene, 2 sprites, and 1 tile.

I guess I've made conceptual progress in hammering out combat roles and having fixes to be implemented (though I haven't done that yet)
Yeah, it’s a status #3, but it’s just to let y’all know I think I’m gonna have to do a twofer on the Advent compilation tomorrow. I feel like butt. Have a fever. I want to descend into my crypt.
I hope Baldur's Gate 3 wins BIG at TGA tonight. Tales of Arise was the last game to inspire me and BG3 has MASSIVELY surpassed that!
One day someone will build independent items for MZ. ONE DAY!

Forum statistics

Threads
136,818
Messages
1,270,385
Members
180,579
Latest member
AxlCrow1
Top