SRPG Engine - Plugins for creating Turn Based Strategy game

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
Hi all! I am modifying the SRPG Engine system, but I have a question ... how do I make CPU control an ally? or how can I add allies on the map that I don't have to control them? .. example: suppose I have 8 actors, but I only want to use 4 and the other 4 I want the CPU to do it for me, is it possible? I am looking forward to your response! Sorry for my bad English!.....thanks!
Screenshot_1.png

there is an auto battle flag and an auto battle State for using auto battle on Units
 

Richard John S

Rpg Maker Music Pack Contributor
Veteran
Joined
Jan 31, 2014
Messages
203
Reaction score
750
First Language
English
Primarily Uses
RMMV
@Dopan Great work on updating this plugin. It has come a long way since I last tried it. I just have a question. How do you get the AI Control plugin to work properly? I put in <aiMove: a.hpRate() > 0.5 ? nearestOpponent : mostFriends>, an example from the instructions, into both the actor note box and the event note box, but nothing seems to happen. The actor with auto-battle will always approach the enemy instead of fleeing when lower than 50% hp.
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
852
Reaction score
536
First Language
English
Primarily Uses
RMMV
@onatig Set the actor with the "Auto Battle" trait. It can also be applied via class, equipment, or status effect.


@Richard John S <aiMove> tags are placed on the actor or enemy, not the event, but the AI will always prioritize using a skill over not using a skill. <aiMove> tags only control the unit's movement when it can't use any skills, otherwise it chooses the position that gives it the best shot based on the <aiTarget> tags (this is how it can aim AoEs to maximize the number of targets, or try to use a sniping skill from maximum range, etc).

The one exception is when a skill affects only the user- in that case, it falls back to the <aiMove> to decide where to go, since the position is irrelevant to the skill itself. For that case, you can put <aiMove> tags on a skill to control their movement when that skill is being used, so you could make a "run away / wait" skill with a range of 0 that does nothing except make the unit try to move toward friends, give it a high priority, and make it only use the skill when HP is low.
 
Last edited:

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
@Dopan Great work on updating this plugin. It has come a long way since I last tried it. I just have a question. How do you get the AI Control plugin to work properly? I put in <aiMove: a.hpRate() > 0.5 ? nearestOpponent : mostFriends>, an example from the instructions, into both the actor note box and the event note box, but nothing seems to happen. The actor with auto-battle will always approach the enemy instead of fleeing when lower than 50% hp.
I just want to make Clear that the Most important Updates
on the SRPG_Core Plugin and its extra Plugins were made by
Doktor_Q ( Core updates and most extra Plugins) ,im just answering Questions ,building little Plugins and keeping the Updated demo ,up to date..
(and i added a few Switches to the SRPG Core in my updated demo in order to make it possible to disable Battle Commands)^^
The AI Control Plugin ,is one of Doktor_Qs Plugins aswell^^..
However i hope your Question was allready answered
sufficient.I just wanted to make that Point clear..
 

Richard John S

Rpg Maker Music Pack Contributor
Veteran
Joined
Jan 31, 2014
Messages
203
Reaction score
750
First Language
English
Primarily Uses
RMMV
Thanks for the information @Dopan .

@Doktor_Q Thank you for the explanation on how the plugin works. Would it be possible to implement a feature in where you can set an actor/enemy to prioritize fleeing when their hp reaches a certain level for a future update without having to use the skill method? Also, I love all the new AOE types. It adds a lot more possibilities for skills/spells.

Anyways, keep up the good work guys.
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
Thanks for the information @Dopan .

@Doktor_Q Thank you for the explanation on how the plugin works. Would it be possible to implement a feature in where you can set an actor/enemy to prioritize fleeing when their hp reaches a certain level for a future update without having to use the skill method? Also, I love all the new AOE types. It adds a lot more possibilities for skills/spells.

Anyways, keep up the good work guys.
I think thats allready Possible, im not sure where its explained and im not very skilled in using formulas at the moment..
I think you just need the right formula with the AI Control Plugin..
->in order to control the AI movement of Units when they are Low on Hp ..
(or those with Low P-def could flee from those with high P-attack for EG..ect)
Perhaps Doktor_Q can give u an working formula Example for this.. Im sure i could find the info in the Forum here or somewhere in the Plugins help info,but im working on something else right now..
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
852
Reaction score
536
First Language
English
Primarily Uses
RMMV
Thanks for the information @Dopan .

@Doktor_Q Thank you for the explanation on how the plugin works. Would it be possible to implement a feature in where you can set an actor/enemy to prioritize fleeing when their hp reaches a certain level for a future update without having to use the skill method? Also, I love all the new AOE types. It adds a lot more possibilities for skills/spells.

Anyways, keep up the good work guys.
You could use a status effect to prevent them from using any of their attack skills, mess with the <aiTarget> tags so they give negative scores (which prevents targeting) if the user's HP is too low, mess with your AI conditions so all your skills have a minimum HP required to use them...

I'd go for the status effect, probably, since you can use it as a generalized "fear" status, applied automatically at low HP (via passive state?), applied via scripted effects, or directly applicable as a result of certain player skills.
 

Richard John S

Rpg Maker Music Pack Contributor
Veteran
Joined
Jan 31, 2014
Messages
203
Reaction score
750
First Language
English
Primarily Uses
RMMV
You could use a status effect to prevent them from using any of their attack skills, mess with the <aiTarget> tags so they give negative scores (which prevents targeting) if the user's HP is too low, mess with your AI conditions so all your skills have a minimum HP required to use them...

I'd go for the status effect, probably, since you can use it as a generalized "fear" status, applied automatically at low HP (via passive state?), applied via scripted effects, or directly applicable as a result of certain player skills.
Thanks, I got it working. I replaced the default formula in the AI Control plugin with the one I mentioned above, and all is working great. I just have another quick question. Is there a way to hide the parameters for certain enemies (Level = ???, Hp = ???, Mp = ???, etc )? I looked through the tags in the SRPG Core, but I couldn't find anything that would do that.
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
Thanks, I got it working. I replaced the default formula in the AI Control plugin with the one I mentioned above, and all is working great. I just have another quick question. Is there a way to hide the parameters for certain enemies (Level = ???, Hp = ???, Mp = ???, etc )? I looked through the tags in the SRPG Core, but I couldn't find anything that would do that.
im not sure but probably not without an extra Plugin, you would also need a way to identify this Special Unit..
(xtra event-notetag or a State for Example)
..Enemys are more or less Copys from each other.. Actors have Actor ID ..but on Enemys the ID defines if its a Slime or an Orc for Example.

If u want to give a boss unit some advantage .. make him revive a few times or give him a not visible AutoLife State by default .. or give him an Aura; there will be a Xtra plugin for Auras soon,when i finished the edit of my Plugins..
(AutoLife = Reraise.. there is an AutoLife Plugin which i edited to be fully Compatible with SRPG in the updated Demo ..place it on the last place in Your PluginManager )
------------------------------------------------------
------------------------------------------------------
Edit @ All
it took a few days, but i finaly finished editing all of my Plugins..
And edited the Updated-SRPG_Demo to change some Setups for the edited Plugins..

->SRPG_AoE_Dopan EX.js (no changes its allready Final)
->SRPG_ActorUnits.js (NEW! replaces "BattleUnits.js")
->SRPG_EnemyUnits.js (NEW! replaces "BattleUnits.js")
->SRPG_TerrainStates.js (no changes its allready Final)
->SRPG_PhaseSwitches.js (no changes its allready Final)

->SRPG_UnitCall.js (added a ScriptCall now its Final)
->SRPG_UnitGroups.js (NEW! adds 53 Scriptcalls to SRPG & replaces the "PlayAnimation,if State affected" Function of "BattleUnits.js")

->SRPG_Aura.js (NEW! replaces the "Aura" Function of "BattleUnits.js")
->SRPG_Blank.js (edit fixed now its Final)

=> BattleUnits.js is replaced by:
SRPG_ActorUnits.js & SRPG_EnemyUnits.js
->because it was easier to make an "Auto-Insert-eventID-Script" if both Groups and Variables are seperated..

.. and now 200 units are availleble (100actors&100enemys)

=>SRPG_ActorUnits.js & SRPG_EnemyUnits.js :
-> these Plugins store EventIDs and set Switches depending on the Plugin Command or Plugin Scriptcall that is used!

=> there is an Example for how SRPG_EnemyUnits.js works,to auto insert Event Ids of Enemys on Chucks Map 1a "terrainEffect" ..

(choice girl event can Activate the Plugin Scriptcalls and the Plugin Command)
.. other Maps need the "EventNoteTag = <Unit:x>" in order to work with SRPG_EnemyUnits.js and its "Auto insert EventIDs" -Function

=> the new Event Note Tag "<Unit:x>"
is only needed on ENEMY Units in order to tell the Plugin which Enemy Unit ID this Event is .


=>SRPG_EnemyUnits.js uses the "<Unit:x>" EventNoteTag in order to set which Enemy is stored in which Variable..:
(example)
<
Unit:1
> = EnemyEventIDVariable_1 & DisableEnemySwitch_1
ect..


=>SRPG_ActorUnits.js uses the "actorID" in order to set which Actor is stored in which Variable..:
(example)
ActorID
1
= ActorEventIDVariable_1 & DisableActorSwitch_1
ect..


=>SRPG_Aura.js ;Enable Aura Skill for 3 Kind of Unit Groups
(unit=all, actor ,enemy ) .. and there are some Extra what the Aura can do, compared to the old Aura,.. depending on which "aura-mode" u use..


=>SRPG_UnitGroups.js ; this Plugin allows to use function
on Groups (unit=all, actor ,enemy)
-> 3 of its Scriptcalls replace the "play Animation if State affected" Function of "BattleUnits.js"..
.. it uses a code that can be used for other things with a bit of JS Knowlegde,, in order
to affect Groups.

* all of My Current SRPG Plugins,shown above,are suppossed to be Final Versions now..except BugfixUpdates if needed*
Edited the Updated-SRPG_Demo to Version 2.9
if anyone recognizes a Bug or has Questions because anything is not explained well enough.. pls let me know!
(Links in my Signature Spoiler)
 
Last edited:

maliyana

Veteran
Veteran
Joined
Jun 6, 2017
Messages
46
Reaction score
8
First Language
English
Primarily Uses
RMMV
So, I'm completely unable to get the fake death state to work. I've tried what was in the demo, I've tried using passive states, etc. The end result is that the Fake Death State never shows up. If I leave the "fakeDeathUser" state blank, the battler ends up dying anyway. If I make the "fakeDeathUser" state death resistant, the Fake Death State is simply not applied.

Default death:
2020-08-11 11_01_25-Database.png
Fake Death State:
2020-08-11 11_01_58-Database.png
"fakedeathuser":
2020-08-11 11_02_06-Database.png
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
So, I'm completely unable to get the fake death state to work. I've tried what was in the demo, I've tried using passive states, etc. The end result is that the Fake Death State never shows up. If I leave the "fakeDeathUser" state blank, the battler ends up dying anyway. If I make the "fakeDeathUser" state death resistant, the Fake Death State is simply not applied.

Default death:
View attachment 154869
Fake Death State:
View attachment 154870
"fakedeathuser":
View attachment 154871
what exactly is your goal? my Example on Shadows fakedeath State is not really good..
ill try to explain :
-if u use the notetag "custom death" it will be a real death state that makes the Status Red ect
-if u dont use the "custom death" ,it wont be a real death and it can be used to leave the body on map

there is also another example on fakedeath on the Fusion Skill where both units will get freezzed with a custom death but that was also a bit complicated..

when i made the "fusion"-Skill for EG, i couldnt use "revive" because it wasnt in the SRPG_core (older Core Version)
-now there would be a simpler way to make the fusion skill
because we can kill and revive Units with Script..

And im allready tryin to rework parts of the demo to be Simpler and less complicated.. one the 1 side i didnt know so much about SRPG when i made things to complicated and on the
other hand some Changes came later that made it possible to use other solutions which are less complicated..
What im Tryin to say is.. If i know what exactly the Fakedeath is supposed to be used for than i could probably give an better Example on how to make it work simple.. Atleast i hope so..
EDIT
However after looking at your First-IMG again, im pretty sure you made a copy paste mistake.. look here

YOUR IMG2020-08-11 11_01_25-Database.png

---
IMG FROM DEMO how it is supposed to look like
Screenshot_1.png
This way(your first IMG) Himes PlaceholderStates wont work..
 
Last edited:

maliyana

Veteran
Veteran
Joined
Jun 6, 2017
Messages
46
Reaction score
8
First Language
English
Primarily Uses
RMMV
@Dopan Whoops, it appears that it was a copy mistake. That fixed it. I also removed <custom death> from the state. Now my questions are
A: How do I specify the dead body image?
B: How do I make it so that "If Existing Enemy = 0" refers to the new death state?
and C: Do you know of a method to display 0 HP as red even without the <custom death>?
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
@Dopan Whoops, it appears that it was a copy mistake. That fixed it. I also removed <custom death> from the state. Now my questions are
A: How do I specify the dead body image?
B: How do I make it so that "If Existing Enemy = 0" refers to the new death state?
and C: Do you know of a method to display 0 HP as red even without the <custom death>?
A.- With DrQs Plugins(MapBattleMotion & DrQEventMotions).. Your Second Image Show how the NoteTag Setup looks like "idle motion" i gave 2 example what motion could be used Screenshot_3.png(nothing or sleeping char)
--this is made with the Char Images--
->and these Plugins work for All Battle Units which are State Affected


B.-without an extra YeP plugin which is not "free" and which i didnt test (i only read the plugin info).. that is not possible ,,
atleast not for me aslong i dont have more JS knowlegde..
#-> thats why fusion Skill freezes the units in a death state and disable the event in order to make them Dissappear..& in order to give the right data to the "If Existing Enemy/Actor Variable"
-> u could change the winning condition ..but that can make things more complicated..

C.-No...
-> RED = realDeath
..without more JS Knowledge and probably making things more complicated..

(Sry i had to edit a few times)
 
Last edited:

maliyana

Veteran
Veteran
Joined
Jun 6, 2017
Messages
46
Reaction score
8
First Language
English
Primarily Uses
RMMV
@Dopan Alright, so the KO sprites worked.

I am, however at a loss with point B. Are the fake death states completely incompatible with ending the match? If all allies are KO'd, the match continues. If all enemies are KO'd the match continues.

Also, I've probably just missed something, but it doesn't look like experience is given when the enemies are defeated (and given the fake death state.)

EDIT: I misread your post. I see that adding "<custom death state>" to the custom state does enable it to function, but only the actors remain. Although I would like the option to resurrect enemies, this basically solves both of my problems.
 
Last edited:

maliyana

Veteran
Veteran
Joined
Jun 6, 2017
Messages
46
Reaction score
8
First Language
English
Primarily Uses
RMMV
*sorry for the doublepost*
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
@Dopan Alright, so the KO sprites worked.

(..)

EDIT: I misread your post. I see that adding "<custom death state>" to the custom state does enable it to function, but only the actors remain. Although I would like the option to resurrect enemies, this basically solves both of my problems.
Im not sure if your problem is solved now or not..
However revive Units (Actor or Enemy) works if the UNIT is real death & than using the revive script from SRPG Core

Code:
this.unitRevive(EventID);
Event ID can also be inserted with "VariableValue" when the Variable has a Event ID stored..
However this will revive the UNIT at the MapPosition where it Died..and im not sure what happens if another Unit stands there at that time.
Thats why the Actor revive Skill works with "set event position to cursor".. but i didnt made any Revive Skill which can be used from AI Units..
i was allready thinking of how to make this work in different ways (revive 1 Unit or Revive All death Units).. but im not sure how the AI would set any position or even decide "which dead Unit" is to be revived.. if there are multiple dead Units ect..

Edit
probably it would be possible to leave an spawned Event Placeholder with a "Dead Unit Char Img/ or a Grave" at every place where a Unit dies in order to keep this place "reserved"..this Event could be deleted if the Unit is revived ..
(that would solve the "set position issue")
But thats just an Idea which i did not tested and where i have no example or Plugin what i can provide to make it easier..
-Atleast not Now...
 
Last edited:

maliyana

Veteran
Veteran
Joined
Jun 6, 2017
Messages
46
Reaction score
8
First Language
English
Primarily Uses
RMMV
Okay, I was mistaken, again. <custom death state> does remove the bodies, which isn't what I want. All I want, while using the "body on map" death state, is:

-> Game Over when all player units die

-> Events to trigger whenever a specific enemy (boss) is defeated.

-> Give experience when enemy is put in fake death state
 
Last edited:

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
Okay, I was mistaken, again. <custom death state> does remove the bodies, which isn't what I want. All I want, while using the "body on map" death state, is:

-> Game Over when all player units die

-> Events to trigger whenever a specific enemy (boss) is defeated.
like i mentioned, i think the best way to do this, is to use an eventspawmner Plugin and to Spawn an Event(Placeholder= Body or Grave Img) at every place where a Unit dies.. that requires a lot of " if Unit X is Death set SpawnedEvent X at that Map-positionXY(=position From UnitX).."-Conditions
(that is something i will probably build a plugin function for, to avoid so much eventing)

However as another walkaround u could change the Winning and losing Conditions to :
- if all Actor Units are State affected with "fakedeath"-State
=> lose
-if all Enemy Units are State affected with "fakedeath"-State
=>win
-If Boss Unit X is State affected with "fakedeath"-State
=> win

Edit .
Sry the Plugin Script wont help here..
(from the text which was here)

but you can still check Enemys State with the event id Stored in Variables.. if u adress the event Ids from any enemy directly..
Code:
$gameSystem.EventToUnit(eventID)[1].isStateAffected(stateID)
-> put this in a "if Condition" when Eventing
this works only on Event Units ( =actors and Enemys)
->i think this works only for real States NOT AUTOPassive States


=> and on the EXP issue if Units dont really die.. thats a problem i cant solve .,
=> but u can set in The SRPG Core to get EXP on any action..
i disabled that in the demo..(plugin parram Setup)

-> and i dont know when or if i make a "revive Plugin" with "spawn event graves or bodys at death Unit Positions"..
edit.
( i couldnt use galv spawn command inside of my plugin ,so this has to be made with eventing ill probably put a Example in a future update of the demo)


edit. @ all
i fixed 2 little copy paste bugs on Aura Plugin and on UnitCall Plugin.. DopansPlugins.zip-Link is updated.. Updated-SRPG_Demo2.9 Link is ReUploaded (with the fixed plugins)
 
Last edited:

maliyana

Veteran
Veteran
Joined
Jun 6, 2017
Messages
46
Reaction score
8
First Language
English
Primarily Uses
RMMV
Thanks to your unit groups script, I found a solution for getting game overs when all party members get the custom death state, and it doesn't require specifying event ID's. This script can be added to the Post-Action event, and will compare living units with dead units:

Code:
liv_actors = 0; // Creates global variable that will be used for all available actors; sets it to 0
ded_actors = 0; // Creates global variable that will be used for all defeated actors; sets it to 0
for (var i = 1; i <= $gameMap.events().length; i++) { //Counts all events on map
    var battleunit = $gameSystem.EventToUnit([i]); //var that references events that are turned to units through script call
    var eventunit = $gameMap.event([i]); //var that references events that are turned to units via notetag
    if (battleunit && eventunit && (battleunit[0] === 'actor')) { //actor specific units
        liv_actors += 1; //counts total actor units
        if (battleunit[1].isStateAffected(51)) { //checks actors affected with death state
            ded_actors += 1;};};}; //counts actors affected with death state
if (liv_actors <= ded_actors){ //checks if living actors are less than or equal to dead actors
    $gameSwitches.setValue(75, true);; //flip a switch
    }; //This processed is checked at the end of every action

Code:
liv_actors = 0;
ded_actors = 0;
for (var i = 1; i <= $gameMap.events().length; i++) {
var battleunit = $gameSystem.EventToUnit([i]);
var eventunit = $gameMap.event([i]);
if (battleunit && eventunit && (battleunit[0] === 'actor')) {
liv_actors += 1;
if (battleunit[1].isStateAffected(51)) {
ded_actors += 1;};};};
if (liv_actors <= ded_actors){
$gameScreen.changeWeather("rain", 2, 60);
};
 
Last edited:

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
259
Reaction score
73
First Language
German
Primarily Uses
RMMV
Thanks to your unit groups script, I found a solution for getting game overs when all party members get the custom death state, and it doesn't require specifying event ID's. This script can be added to the Post-Action event, and will compare living units with dead units:

(...)
Im happy that u solved the problem,Congratz!,..
well to stay at the truth, i took this part of code from the SRPG_Core after i figured out what it does and how..:
Code:
for (var i = 1; i <= $gameMap.events().length; i++) {

var battleunit = $gameSystem.EventToUnit([i]);

var eventunit = $gameMap.event([i]);

if (battleunit && eventunit && (battleunit[0] === 'actor')) {
the best thing is that this way we can use both kind of functions.. the functions for "$game.Map.event(x)" and the functions for "$gameSystem.EventToUnit(x)[1]",
because at the end, thanks to the event ID which they share.. every BattleEventUnit is both at the same time ( eventUnit and battleUnit) and can use both codes..(thats what SRPG_UnitGroups.js does..)
(for example "requestAnimation(Id)" is a "$game.Map.event(x)"- function,.. while "addState(Id)" for example is a "$gameSystem.EventToUnit(x)[1]"-function..
if u look into the JS code of SRPG_UnitGroups.js the first Function-part is marked with: //0U_Add Test: THIS IF FOR TESTING NEW FUNCTIONS "this.allUxTest();"
-> there u find a function that can be edited to build new functions or to experiment with this part of JS code

----
----
Edit @ ALL
I recognized a Bug in the Revive skill Setup and fixed it..
(= edited 2 Common Events)
.. and i deleted 1 Scriptcall from "SRPG_UnitCall.js"..
-> probably all plugins and the demo are bug free now.. and i plan to make the 3.0 Update ,to be the Final Update.

planed for 3,0: (this could take a bit more time)
=> Example for "Eventing-UnitGraves" in Common Events..
=> improoving the existing Functions in order to make Setups Simpler if possible..(in cases where i can do that)

=> checking everything for Bugs, again.. (also on my Plugins)
=> of course ill still update the links, if any Plugin gets an Update,
but i dont want to implement more new Plugins & Functions into the Updated-SRPG_Demo,after Version 3,.0 in order to not make the Demo even more complex and in order to put more time into my Main Project ..
(and of course ill still try to help if there are any Questions)

=> Links in the Signature Spoiler are Updated
("Version 2.9 Bugfixed" & "Dopan Plugins.zip")
 
Last edited:

Users Who Are Viewing This Thread (Users: 1, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

I'm making MAGIC!
aww I am sad but happy for brackeys to decide to pursue something new but seing brackeys ending is so sad ;w;
Now RPG Maker has brought him here. He will never be rid of his need for it. He hates and loves the RPG Maker, just as he hates and loves himself. Featherbrain's life is a sad story. Yes, Featherbrain, he was called. Before the RPG Maker found him. Before it drove him mad.
Really struggling with XP animations but my game deserves my best.
I think the characters are really too short. Should at least add a little more
Just the legs should be longer.

Forum statistics

Threads
102,926
Messages
996,020
Members
134,380
Latest member
Marcussss
Top