SRPG Engine - Plugins for creating Turn Based Strategy game

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
341
Reaction score
104
First Language
German
Primarily Uses
RMMV
Do you mean like this:


Code:
<target action>
MOTION MISSILE: user

  WAIT: 4
  create object: 1, sv_arrow, user, 0, -15
  SE: Wind7
  MOVE object 1: target, CENTER, 30
  WAIT: 30
  DELETE object: 1

ACTION EFFECT: target
if !target.result().missed && !target.result().evaded
  ATTACK ANIMATION: target
  WAIT FOR ANIMATION
else
  WAIT: 24
end
</target action>
I adjusted the WAIT from 25 to 4 (so the arrow appears during the missile action). I forced the unit to use the missile action; by default the bow weapon has an arrow appear on the last frame.

===================

I also achieved pathfinding in the game. It has some bugs which I have pasted below but works alright. I will release the script once I fix the bugs up (or give up on fixing bugs):



The nymph hero is under attraction (confusion with self-target friendlies) and the enemy has a short ranged attack. Harold is on the same team as the nymph but is paralyzed.

Errors:


@boomy
about the "bow-solution":
I think that wont solve it ..
(Actors have no proplem using bows and dont need this^^). This has to work with Enemy Units like the "Naughty Fairy" (enemyID_4) .. That is the point on this issue.Like MetalKing11417 explained(#935) our problem is that Enemies don't have attack animations by default ,so we try to recreate it with the Action Sequence..
Sidenote for other readers who dont know the context:
After MetalKing showed how to build the arrow object and let it fly to target..,only the Motion "show bow before shoot" is missing.. thats what boomy tried to solve here..

Edit
after thinking and testing more ,Im pretty sure that this Motion "show bow before shoot" cant work for enemys,because they dont use a "Chibi character Image" and these "Attack Motions", where the actors hold the weapons are made for the "Chibi character Image" by default..
(so it would need more edited Art to improve this part, and thats probably a lot of work)


But i thank you for trying(the bow solution),..

about the Pathfinding Bug:
I got no idea what you did and without more infos about that and some Console F8 Screenshots, i cant say why the "-property of event id" is missing..

Pls give us more info about your Pathfinding solution and its bugs,perhaps we can figure it out^^

Also i forgot to mention that earlier:
..on the first Example(#933) you used 2 "Nymphe Actors" (same Actor 2 times).This would make conflicts doing this in a real game.Enemys can be used as often you want ,but Actors should be used only 1 time (no actor clone) ,to avoid Conflicts that can and will happen later,..
-----
@MetalKing11417
about "fun little ideas"(#939):

Thx i like it and will proably try editing some arrow Images ,to create "ice & fire & thunder" Arrows for Example..
Thats just the first idea i got in Mind,but you are also right that this can also be used for magic skills with using completly other images^^ ..thx for the help!
 
Last edited:

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
869
Reaction score
553
First Language
English
Primarily Uses
RMMV
@boomy I made a small update to SRPG_AIControl on the GitHubg that might fix the errors you're seeing. Try running it again with the update- if there's still errors, I want to dig into what's going on a bit more- it seems to be something to do with trying to target an AoE skill that has no selectable targets within range.
 

boomy

Veteran
Veteran
Joined
Jan 6, 2013
Messages
120
Reaction score
90
First Language
English
@boomy I made a small update to SRPG_AIControl on the GitHubg that might fix the errors you're seeing. Try running it again with the update- if there's still errors, I want to dig into what's going on a bit more- it seems to be something to do with trying to target an AoE skill that has no selectable targets within range.
Heads up, you added in :
!$gameTemp.areaTargets().isEmpty()

isEmpty() is not a javascript function and thus it pops up an error when this function is called

An easy fix I found was to use: if $gameTemp.areaTargets().length > 0

Works at treat now! And yes you are correct, it was somethign to do with an AoE skill (Dopan's demo has the orc use an AoE skill as its main attack)

===========================

I have released my first RMMV script!

SRPG Pathfinding

 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
869
Reaction score
553
First Language
English
Primarily Uses
RMMV
@boomy Wow, that's a dumb mistake to miss. Applied the fix.
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
341
Reaction score
104
First Language
German
Primarily Uses
RMMV
(..)

Works at treat now! And yes you are correct, it was somethign to do with an AoE skill (Dopan's demo has the orc use an AoE skill as its main attack)

===========================

I have released my first RMMV script!

SRPG Pathfinding
First of all ,Congratz to your first RMMV (and SRPG) Plugin!

I will add it to the next demo update,but you got enough time to finish your "Upcoming fixes",because this update will have to wait till i finished another Issue in one of my Plugins.. (SRPG_MapForceAction.js)
Of course i will also add the new Version of SRPG_AIControl.js ..

about this part
.. Ähm no, atleast not by default , i didnt gave any Orc an AOE Skill as main attack..
(its nothing important,but i was a bit confused about that part..)
 
Last edited:

NatePlays

Veteran
Veteran
Joined
Dec 12, 2018
Messages
39
Reaction score
7
First Language
English
Primarily Uses
RMMV
I got a Friendship/Support system running in my game, I'll try to resume it:
Required: Moogle's Actor Friendship System plugin and Himeworks's Common Event Queue plugin.

First of all, for the frienship system to work, you'll need to setup the AFS plugin. Games like FE have multiple support pairs, so we'll set AFS to have all actors as leaders. When adding a new actor to the team, make sure to set them to show as Leader with "AFS Show Leader [actor]" and set the friends with "AFS Show Friend [actor] Leader [actor]" (I did it twice for each pair, so the level ups are reciprocated).

At the start of each turn, call a common event, that will handle the interactions. I'll call it Support Turn.
In that event, you want to make a condicional branch for each actor pair, then set some variable to their actor distance with "this.ActorDistance(var, actor, actor);" before each branch. As for the condition itself, test if it's not 0 (happens if actors aren't in combat or are dead), then test for the distance (I use <4). If conditions are met, use command "AFS Gain [amount] Friend [actor] Leader [actor]" to increase the Friendship points (I, again, do it twice, changing leader and friend positions).

If you want to give a special state if actors with friendship/support levels are near each other, while in that condition, use "AFS Var [var] Level Friend [actor] Leader [actor]" to set a variable to the two actors' friend level. Then check that, still inside the condition, and add the special state to the actor pair.

If you want cutscenes like FE's support dialogue, use the AFS feature of calling common events at level up, by setting notetags inside the actor notetags (don't do it twice per pair or you'll have duplicate scenes). Dopan's UnitGroups plugin lets you call ballons on actors with support state using "this.allAxBalloon(state , baloon);".
 

NatePlays

Veteran
Veteran
Joined
Dec 12, 2018
Messages
39
Reaction score
7
First Language
English
Primarily Uses
RMMV
I'm still struggling with some functions though. Like, I was thinking of using YEP_PartySystem to set ally formation in the field, double-digit ally troops, and lock main characters, but if make my team smaller than the amount of events in the map, some benched allies will still appear for the battle.

How can I solve this? Can I test for the number of actors in the party and then spawn that same amount of <id:0> events? Or maybe make the SRPG system not add actors that are not in the YEP party...
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
869
Reaction score
553
First Language
English
Primarily Uses
RMMV
I'm still struggling with some functions though. Like, I was thinking of using YEP_PartySystem to set ally formation in the field, double-digit ally troops, and lock main characters, but if make my team smaller than the amount of events in the map, some benched allies will still appear for the battle.

How can I solve this? Can I test for the number of actors in the party and then spawn that same amount of <id:0> events? Or maybe make the SRPG system not add actors that are not in the YEP party...
The SRPG plugins don't look at the battle party to determine who gets fielded, it just pulls in characters from the party until all of the events have an actor. You should be able to work around this by utilizing the maxActorVarID plugin paramter on SRPG_core- whatever variable you pick will now determine the maximum number of party members it will use for the <id:0> events- the extra events get cleaned up automatically.

To check the number of actors in the party, use the following script call: $gameParty.battleMembers().length

So, at the start of each battle, you can assign the variable specified by maxActorVarID equal to the script that checks the size of the battle party. You should do this right before the command to actually start the battle, to make sure it initializes correctly.
 
Last edited:

NatePlays

Veteran
Veteran
Joined
Dec 12, 2018
Messages
39
Reaction score
7
First Language
English
Primarily Uses
RMMV
That's great, but I searched a bit and seen that doesn't work how it is supposed to with YEP Party System, so I found this (bookmarked in my account I think):

$gameVariables.setValue(29, 0);
for (var i=1; i < 100; i++){
if($gameActors.actor(i).isBattleMember() == true){
$gameVariables.setValue(29, $gameVariables.value(29)+1);
}
};


The code goes to every actor to see if they're in the main party (sizes vary from 1 to 13) and sets it to var29. Then I set var 30, the MaxActor thing in SRPG core to the var29 value. All other allies are spawned after the battle starts, because I generalized the Battle Start event and that goes first
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
869
Reaction score
553
First Language
English
Primarily Uses
RMMV
That's great, but I searched a bit and seen that doesn't work how it is supposed to with YEP Party System, so I found this (bookmarked in my account I think):

$gameVariables.setValue(29, 0);
for (var i=1; i < 100; i++){
if($gameActors.actor(i).isBattleMember() == true){
$gameVariables.setValue(29, $gameVariables.value(29)+1);
}
};


The code goes to every actor to see if they're in the main party (sizes vary from 1 to 13) and sets it to var29. Then I set var 30, the MaxActor thing in SRPG core to the var29 value. All other allies are spawned after the battle starts, because I generalized the Battle Start event and that goes first
There's cleaner ways to do it, but your code should at least work. One thing I'd suggest is doing your math directly on var30 to save yourself a step- no reason not to.
 

theredglove

Villager
Member
Joined
Oct 23, 2016
Messages
12
Reaction score
5
First Language
English
Primarily Uses
Does anyone know how to adjust settings for the SRPG_DispHPOnMap plugin? The HP bars appear on top of my characters rather than below them.
 
Last edited:

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
341
Reaction score
104
First Language
German
Primarily Uses
RMMV
Does anyone know how to adjust settings for the SRPG_DispHPOnMap plugin? The HP bars appear on top of my characters rather than below them.
in the Updated-SRPG_Demo is a edited Version of the Plugin..
I have to admit that this Plugin is really strange i tried a lot and the edit i made for the demo was the best way i could change it..(i cant explain what to do,it was a lot of trial and error..)

If you want to know, if you got the edited Version you have to look into the code.. i left a edit info here: (spoiler info)

The other Edits "//" where
there by default,probably for some reason to edit it for the Yep plugin if u use the Yep Plugin..
(i also tried to do that, but could not make it work, i just dont understand how the Code of this plugin works,sry)

Screenshot_1.png
Thats how it looks in this edited Version:
Screenshot_2.png

i attached the edited version here in this post..
And i cant edit it better..


Edit
@NatePlays
about
: (#946 & #947 & #949)
interresting how u used the "Yep Party sytem" and the "mog friendship system", but i didnt had the time to try this out and even if do this later (what i want to do) ,than i can only add and support Plugins to the demo which are Free..(for legal reasons)
(thats why i wont add the "Yep Party sytem",but i think the "Mog Plugin" is free..)
 

Attachments

Last edited:

theredglove

Villager
Member
Joined
Oct 23, 2016
Messages
12
Reaction score
5
First Language
English
Primarily Uses
@Dopan

Thanks! I was driving myself crazy comparing your Demo and mine. I could find no discernible differences in plugin settings. Glad to know it's just been edited.
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
341
Reaction score
104
First Language
German
Primarily Uses
RMMV
@Doktor_Q
while working on rebuilding SRPG_MapForceAction.js i think i figured out why mapbattle"True" triggers the PreAction phase after the effect of the action already happened..
(this happens in both Plugin the same way SRPG_Mapbattle.js & SRPG_MapForceAction.js)
its Because "this.eventBeforeBattle();" has to be the last thing that happens in a "Scene_Map.prototype" without any other function in chain..
(similar to how "$gameTemp.reserveCommonEvent(ID)" waits for the end of the current working event or action chain to finish)
The SRPG_Core solves this with using a "if condition" in the "Scene_Map.prototype.update = function() {" of the SRPG_Core,
in order to trigger the final Battle trigger..
(and the "this.eventBeforeBattle();" happens before that because its part of the Action chain that prepares the battle,..)
So i think it should be possible to immitate what the SRPG_Core does in order set the Pre Action Phase before the Action effect happens .. like it does in the SRPG_Core and in its SV battles..

long story short:
=> the point is that the SRPG_Mapbattle.js uses "this.srpgAddMapSkill" (2 times) in the "Scene_Map.prototype.srpgBattleStart"- function.
=> If we use something like "this._callSrpgBattle = true;" instead,.. lets call it "this._callSrpgMapBattle = true;" . than this should work!
("_callSrpgBattle" is triggered separately with the help of "Scene_Map.prototype.update = function() {" and "this._callSrpgMapBattle = true;" should be made the exact same way..)

This Edit wont solve my problem with Re-building SRPG_MapForceAction.js.. but it would be an improvement of SRPG_Mapbattle.js.
Im not sure if I am able to correctly make this edit myself, so i wanted to ask you first what you think about this idea?
=> in my Example the last Mapbattle trigger code which is put into the "Scene_Map.prototype.update = function() {"
would look like this:
JavaScript:
        if (this._callSrpgMapBattle == true ) {
            this._callSrpgMapBattle = false;
            this.srpgAddMapSkill(action, user, target);
            return;
        };
=> the only Problem is.. "this.srpgAddMapSkill(action, user, target);"

..the data which is stored in the "()". perhaps this needs another "Scene_Map.prototype."Function, in order to have a
"this.isMapSkillTrigger();" which works with an empty array..
or to edit the "srpgAddMapSkill"-Fuction in order to only get triggered from the "Scene_Map.prototype.update = function() {" ?

=> or did i missunderstood something and that is not posssible to do at all ??

here some Images for better understanding :
Screenshot_1.png
Screenshot_3.png
Screenshot_2.png
Screenshot_4.png

SideNote: the other Function which i wanted to add is "mapAction Text" which is basicly just a "Instant Common Event" or a "$gameTemp.reserveCommonEvent(ID)" ,depending on what is needed ..
The TextBox will be put in the Common Event.There will be a Setup for this Common Event in the Next demo update.. it will work for all Skills.
(This CE is Part of the mapForceAction Plugin which im working on and could be put in Mapbattle.Js instead aswell..)
Instant Common Event: (example)
JavaScript:
        // "this.isInstantCE(ceID);" // InstantCE
        Game_Interpreter.prototype.isInstantCE = function(id) {
            var commonEvent = $dataCommonEvents[id];
            if (commonEvent) {
                var eventId = this.isOnCurrentMap() ? this._eventId : 0;
                this.setupChild(commonEvent.list, eventId);
            }

        };
At the moment i have connected "MapActionText" to the SRPG_Mapbattle.js with this small edit:
(the code shown is only part of mapForceAction Plugin atm)
=> the "for" and "if" part is not needed with the right timing..

JavaScript:
        // "this.srpgMapActionText();" // made to connect the Mapbattle plugin to this Function
        var _srpgMapActionText = Scene_Map.prototype.srpgMapActionText;
        Scene_Map.prototype.srpgMapActionText = function() {
             for (_usedSkill = 1; _usedSkill <= $dataSkills.length; _usedSkill++) {
                  if (_usedSkill === $gameSystem.EventToUnit( $gameTemp.activeEvent().eventId() )[1]._actions[0]._item._itemId) {
                      $gameTemp.reserveCommonEvent(_usedCE);
                  }

             }

        };
Screenshot_6.png
And thats the mini edit in the Mapbattle Plugin:
Screenshot_5.png
=> if the SRPG_Mapbattle.js gets edited for the "preActionPhase".. than the "mapActionText" has to be placed somewhere else ,but thats the smallest problem here^^

EDIT
i found a easier way to solve this, ..
(pre action phase will happen betwen User Animation & the Target Animation & before the Dmg effect triggers .And the "mapActionText"-CommonEvent will be put into the pre action phase)
I used the "this.srpgMapActionText();" in order to Trigger a CommonEvent ..
That CE uses Script:
"Scene_Map.prototype.eventBeforeBattle.call(this);"
to trigger the Pre Action Phase. And the Pre Action Phase gets a "this.isInstantCE(ceID);" for the "MapActionText":
(this should work in both plugins the same way, ill put a proper Setup in the next demo update)

I will Rename the used Functions for more logic and better understanding in the demo update..:

->"this.srpgMapActionText();" will be Re-named to
=> "this.srpgBeforeMapBattleCE();"
Scene_Map.prototype.srpgBeforeMapBattleCE = function() {
--
->"this.isInstantCE(ceID);" will be Re-named to
=> "this.isMapActionTextCE(ceID);"
Game_Interpreter.prototype.isMapActionTextCE(ceID) = function(id) {
 
Last edited:

NatePlays

Veteran
Veteran
Joined
Dec 12, 2018
Messages
39
Reaction score
7
First Language
English
Primarily Uses
RMMV
There's cleaner ways to do it, but your code should at least work. One thing I'd suggest is doing your math directly on var30 to save yourself a step- no reason not to.
Funny story, I used to spawn the Actor events but they would teleport back to their initial spawn, so I just used that to limit the Max Actor amount and set all the events already on the map, it is working nicely. I have a Formation screen before every map, like a Preparations scene. I have a question though: If I wanted to recruit an ally (set event as Actor with command) but the party size is full, do I have to increase the size (like var = var+1) before\after recruiting him?
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
869
Reaction score
553
First Language
English
Primarily Uses
RMMV
Funny story, I used to spawn the Actor events but they would teleport back to their initial spawn, so I just used that to limit the Max Actor amount and set all the events already on the map, it is working nicely. I have a Formation screen before every map, like a Preparations scene. I have a question though: If I wanted to recruit an ally (set event as Actor with command) but the party size is full, do I have to increase the size (like var = var+1) before\after recruiting him?
No, the max size variable only controls the automatic, start-of-round creating of actors on <id:0> events, if I remember correctly. It shouldn't affect an event that spawns a fixed actor, like <id:1>, and it definitely won't effect manually adding actors to the events via script calls or plugin commands or the like.
 

Yew Bowman

Veteran
Veteran
Joined
Sep 7, 2017
Messages
49
Reaction score
5
First Language
Spanish
Primarily Uses
RMMV
sorry that I disturb again, but I need to know if you know YEP AI Core...
because after I installed that I got this message
1601265291919.png
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
341
Reaction score
104
First Language
German
Primarily Uses
RMMV
sorry that I disturb again, but I need to know if you know YEP AI Core...
because after I installed that I got this message
View attachment 162086
Yes im using it in my main project:
Screenshot_1.png
Thats where i placed it in the PluginManager..
(just incase that you placed it somewhere else and that makes the error.)
at the moment im not sure why you get the error..
 

Yew Bowman

Veteran
Veteran
Joined
Sep 7, 2017
Messages
49
Reaction score
5
First Language
Spanish
Primarily Uses
RMMV
Yes im using it in my main project:
View attachment 162087
Thats where i placed it in the PluginManager..
(just incase that you placed it somewhere else and that makes the error.)
at the moment im not sure why you get the error..
1601267078989.png
I placed it on more or less the same place, do I need to update srpg plugin maybe?
also I might give you some context, I gave one of my Enemies a buff AOE skill that he can give to his allies, but the problem is that he never uses it.
There, that's the thing I am trying to do.
 
Last edited:

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
341
Reaction score
104
First Language
German
Primarily Uses
RMMV
View attachment 162093
I placed it on more or less the same place, do I need to update srpg plugin maybe?
also I might give you some context, I gave one of my Enemies a buff AOE skill that he can give to his allies, but the problem is that he never uses it.
There, that's the thing I am trying to do.
The Plugin manager position looks OK!
Try to Disable the "buff AOE skill"-Setup and look if you still get the Error..
This way you know if the Error comes from your "buff AOE skill"-Setup or not..
I did not had any problems with that plugin ,thats why i got no idea what went wrong in your project :/
( if you use one of the latest SRPG Core = from DrQs GitHub OR from the Current Updated demo ,then i see no reason to update the srpg plugin )

---
About the SRPG_Mapbattle.js Issue with "Pre Action Phase" and "MapActionTextCE" :
i think i solved it
(edited the old posting #954 for more INFO,That will be part of the next demo update)
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Okay, vacuuming fruit flies out of the air is surprisingly effective.
Finally finished my menu redesign after like a month of coding! I hate designing menus... Good news though - I thought of a complete redesign for it now, so yay...
Still no scam calls all day... also I got a quick gig designing a mascot drawing for a small business, so I might actually make some green of my own after all. That would be a perfect job for me, since I love art and digital design.
Job concerns. Love where I work, but I have severe anxiety while I'm outside at night.
It's nice to see the evolution of my game: Here is a video with the first WIP:

Forum statistics

Threads
104,386
Messages
1,006,000
Members
135,911
Latest member
Lightstaroflightclan
Top