my plugin SRPG_UnitGroups.js ..
adapted a script which i found in the srpg core, with different variations, including this minimum variation for own edit usage: (img is from UnitGroups-plugin)
.. this is able to trigger a group of units, in this case its all alive units ,actors and enemys..
(your method should work aswell, this is just another method)
View attachment 253609
--> i used a game-interpreter function , so that the script can be triggered via scriptcall
...
i also made a little github tutorial, where i show this script and other basic srpg scripts..
( i used github in order to better show the js code )
Srpg-plugins/$ScriptCallList_SRPG.js at main · DopanPlugins/Srpg-plugins ---
script for unit groups ect is already explained a few times in this thread^^
---
edit
- SRPG_UnitGroups.js is in my demo & i reuploaded it to my github mainpage ..
adapted a script which i found in the srpg core, with different variations, including this minimum variation for own edit usage: (img is from UnitGroups-plugin)
.. this is able to trigger a group of units, in this case its all alive units ,actors and enemys..
(your method should work aswell, this is just another method)
View attachment 253609
--> i used a game-interpreter function , so that the script can be triggered via scriptcall
...
i also made a little github tutorial, where i show this script and other basic srpg scripts..
( i used github in order to better show the js code )
Srpg-plugins/$ScriptCallList_SRPG.js at main · DopanPlugins/Srpg-plugins ---
script for unit groups ect is already explained a few times in this thread^^
---
edit
- SRPG_UnitGroups.js is in my demo & i reuploaded it to my github mainpage ..
I finish make this
MV/SRPGgearMV_JP/js/plugins/SRPG_Custom.js · main · G. Wibisono / Rpgmaker · GitLab
how to use
var id mp is for variable you use to recover mp (default on variable id 7). Insert the number first before execute recover MP
on Battle start put Plugin command
since MP must recover during turn.. added number on your variable (default 7) then use plugin command
if you want to recover all character use
on Battle start put Plugin command
Code:
to make all character and enemy MP = 0. This is include AISRPGStartNoMPsince MP must recover during turn.. added number on your variable (default 7) then use plugin command
Code:
SRPGGainMPif you want to recover all character use
Code:
SRPGRecoverAllJavaScript:
this is the code you can make mp turn 0.. fyi.. I make sure all character is heal then make mp turn 0 Game_System.prototype.SRPG_recoverAll = function() {
console.log($dataSystem );
$dataSystem.partyMembers.forEach(function(actorId) {
var actor = $gameActors.actor( actorId);
if (actor) {
actor.recoverAll();
//console.log("recover all battler");console.log(actor, actorId );
}
});
}
Game_System.prototype.SRPG_startMP0 = function() {
//recoverAll friend
this.SRPG_recoverAll();
$dataSystem.partyMembers.forEach(function(actorId) {
var actor = $gameActors.actor(actorId);
if (actor) {
actor.gainMp( -actor.mmp );
//console.log("decrease mp");console.log(actor, actorId);
}
});
//only enemies and AI
$gameMap.events().forEach(function(event) {
var eventId=event.eventId();
var battlerArray = $gameSystem.EventToUnit(eventId);
//----------------
if (battlerArray && (battlerArray[0] === 'actor' || battlerArray[0] === 'enemy')) {
var mpUnit = battlerArray[1].mmp;//max mp
if (battlerArray[1].isAlive()) battlerArray[1].gainMp( -mpUnit);
}
//----------------
});
}since you make mp 0. you need function to recover the mp
JavaScript:
hope this help you Game_System.prototype.SRPG_gainMP = function() {
//only enemies and AI
$gameMap.events().forEach(function(event) {
var eventId=event.eventId();
var battlerArray = $gameSystem.EventToUnit(eventId);
//----------------
if (battlerArray && (battlerArray[0] === 'actor' || battlerArray[0] === 'enemy')) {
var mpUnit = $gameVariables.value( SRPG_Custom.varIdMP );
if (battlerArray[1].isAlive()) battlerArray[1].gainMp( mpUnit );
}
//----------------
});
};
This works. After playing with it though, it seems like the increase method won't work either. So like, when all MP is 0'd, per turn both sides have a MP regen of +10 per passing turn. Such an example: player phase, everyone gets a +10 on MP. Enemy phase, same thing. That way, either side can use magic one the appropriate amount is available to use.
Edit: Figuring an alternative (Something I want to remove eventually) I made a state called MP Regen and force it under the actor and enemies. This works after turn 1, for it does not work right away on the same turn. What I can do if there's no solution is after SRPG Battles, I can remove the state from the actor so that it doesn't apply in the dtb mode (seeing this game will be dtb/srpg based.) and MP can be used normally when in dtb.
Update on edit: Find out enemies MP won't regen, and state doesn't exist.
Final Update: For adding the id, I created the script that Dopan provided and explained to me. For right now, maybe it is best for me to use the state MP Regen. Added the solution in pics.
View attachment 253647
Edit: Figuring an alternative (Something I want to remove eventually) I made a state called MP Regen and force it under the actor and enemies. This works after turn 1, for it does not work right away on the same turn. What I can do if there's no solution is after SRPG Battles, I can remove the state from the actor so that it doesn't apply in the dtb mode (seeing this game will be dtb/srpg based.) and MP can be used normally when in dtb.
Update on edit: Find out enemies MP won't regen, and state doesn't exist.
Final Update: For adding the id, I created the script that Dopan provided and explained to me. For right now, maybe it is best for me to use the state MP Regen. Added the solution in pics.
View attachment 253647
hope the plugins works
* added new quote (not added new reply)
* I forgot about the state.. sory