[RM2K3] [PLUGIN] LOCAL SWITCHES + TURN-BASED BATTLE
Posts
1. Local switches.
Version: 1.0.1.
Features:
- 1, 2, 4, or 8 local switches per event (configurable);
- setting local switches by event command;
- for checking they are copied into fixed global switch, whose number can be changed in configuration.
Plans:
- forks on local switches without using global ones;
- more stability;
- removing or changing the graphic of non-automatic event, based on his local switches.
(Automatic event can be removed by its local switch even now - check the demo project below)
Changes in 1.0.0->1.0.1:
- removed unnecessary debug code.
2. Turn-based battle system, analog of the Cherry's TTB.
Version: 0.5.
Warning: doesn't yet support the inactive conditions other than death! The game would almost always freese, when the command is changed after such a condition was used.
Plans:
- add this support;
- add several configurable features, such as:
first turn doesn't depend on Agility;
active characters are changed as in the ATB;
a "Wait" command, which set ATB position at 50%;
- remove obsolete "Wait|No wait" option in menu and ATB gauge as HUD element in battle.
Demo project: download local_switches.zip
Version: 1.0.1.
Features:
- 1, 2, 4, or 8 local switches per event (configurable);
- setting local switches by event command;
- for checking they are copied into fixed global switch, whose number can be changed in configuration.
Plans:
- forks on local switches without using global ones;
- more stability;
- removing or changing the graphic of non-automatic event, based on his local switches.
(Automatic event can be removed by its local switch even now - check the demo project below)
Changes in 1.0.0->1.0.1:
- removed unnecessary debug code.
2. Turn-based battle system, analog of the Cherry's TTB.
Version: 0.5.
Warning: doesn't yet support the inactive conditions other than death! The game would almost always freese, when the command is changed after such a condition was used.
Plans:
- add this support;
- add several configurable features, such as:
first turn doesn't depend on Agility;
active characters are changed as in the ATB;
a "Wait" command, which set ATB position at 50%;
- remove obsolete "Wait|No wait" option in menu and ATB gauge as HUD element in battle.
Demo project: download local_switches.zip
@Hosting: http://share.cherrytree.at - if you contact me, you can also get your own webspace and everything.
This will most certainly crash if you put your plugin into a game for the first time and then try to load a savefile. You should check if data != NULL and also if length > 2 (in your case) before trying to access data{0} and data{1}!
Are all these variable assignments intentional? Looks like debug code.
And in the demo there is "SwitchesPErEvent" in the INI file ("PEr" instead of "Per") so it probably won't read it correctly.
if ((data[0]!=1) || (data[1]!=0))
RPG::variables[6]=tmp;
And in the demo there is "SwitchesPErEvent" in the INI file ("PEr" instead of "Per") so it probably won't read it correctly.
author=CherryThanks for information! I'll update first post soon.
@Hosting: http://share.cherrytree.at - if you contact me, you can also get your own webspace and everything.
author=CherryI didn't keep in mind that someone can add this plugin to game which was played for a while... In the next version I should fix this, yes. (Next version - because it seems to be a lot of new code in this case)This will most certainly crash if you put your plugin into a game for the first time and then try to load a savefile. You should check if data != NULL and also if length > 2 (in your case) before trying to access data and data!if ((data[0]!=1) || (data[1]!=0))
author=CherryI didn't use variables intentionally, thanks, forgot about it.Are all these variable assignments intentional? Looks like debug code.RPG::variables[6]=tmp;
author=CherryA misprint, thanks again.
And in the demo there is "SwitchesPErEvent" in the INI file ("PEr" instead of "Per") so it probably won't read it correctly.
upd: First post updated.
Also if this helps, this is how I got Turn based to work without a script.
First I set all the monsters I wanted to Do Nothing, TurnWait ON, 100. Then I made two Tun 1x conditions (one with just a common event, one with another common event after any party member command such as Ambrosia uses Fight)
Turn-based code is...
Turn 1x
CommonEvent: Enemy Turn
(Inside Common Event: Enemy Turn)
If Turn Wait OFF
If Turns is >= Monster Number
Turns Set, PartySize (I discovered I needed it when one character attacked five times)
Turn Wait ON
Else
Turns +1
End Event Processing
Then you set to each party action under another Turn 1x (tedious...) such as
Hero1 uses Attack. You don't need fifty pages, just one page with a very long list.
Turn 1x
If Ambrosia Attack (etc...)
CommonEvent: Your Turn
(Inside Common Event: Your Turn)
If Turn Wait ON
If Turns is <= 0
Turn Wait ON
Else
Turns -1
End Event Processing
What you can do instead of handling the event wholly is monitor the current number of monsters/heroes (so other events can adjust them, like party members entering or monsters unhiding stuff), and somehow adjust the code to run the variables and switches automatically. All you should need if you want this active instead of inactive, is set the variables (Turns, MonsterNumber, PartySize) and switch (TurnWait) on config, and have the process run simply by adding Do Nothing, TurnWait ON, 100 to the monsters you want to be turn-based. It's not a true turn based (monsters wait, but you still have ATB, though you can hide this by making all characters and enemies have 255 Agi and hiding the ATB bar), but it's glitch safe, which is a start.
In the mean time, can you make a Lite version with just the local switches? Oh nvm, it's a package with two separate files. Thanks, Mr. Three-Headed-Dog, I can definitely use this.
First I set all the monsters I wanted to Do Nothing, TurnWait ON, 100. Then I made two Tun 1x conditions (one with just a common event, one with another common event after any party member command such as Ambrosia uses Fight)
Turn-based code is...
Turn 1x
CommonEvent: Enemy Turn
(Inside Common Event: Enemy Turn)
If Turn Wait OFF
If Turns is >= Monster Number
Turns Set, PartySize (I discovered I needed it when one character attacked five times)
Turn Wait ON
Else
Turns +1
End Event Processing
Then you set to each party action under another Turn 1x (tedious...) such as
Hero1 uses Attack. You don't need fifty pages, just one page with a very long list.
Turn 1x
If Ambrosia Attack (etc...)
CommonEvent: Your Turn
(Inside Common Event: Your Turn)
If Turn Wait ON
If Turns is <= 0
Turn Wait ON
Else
Turns -1
End Event Processing
What you can do instead of handling the event wholly is monitor the current number of monsters/heroes (so other events can adjust them, like party members entering or monsters unhiding stuff), and somehow adjust the code to run the variables and switches automatically. All you should need if you want this active instead of inactive, is set the variables (Turns, MonsterNumber, PartySize) and switch (TurnWait) on config, and have the process run simply by adding Do Nothing, TurnWait ON, 100 to the monsters you want to be turn-based. It's not a true turn based (monsters wait, but you still have ATB, though you can hide this by making all characters and enemies have 255 Agi and hiding the ATB bar), but it's glitch safe, which is a start.
In the mean time, can you make a Lite version with just the local switches? Oh nvm, it's a package with two separate files. Thanks, Mr. Three-Headed-Dog, I can definitely use this.
Im interested in any battle system plugins, a definitive turn based system without see the "atb" moving on will be nice, atleast in my lufia sdk the other patching ways of the rpg_rt for disable the atb dont work
bulmabriefs144, thanks you too for that idea. I tried once write an role system (just damage calculating, for start) on events, but faced the same difficulty - extremly large code with lots of duplications - and several large restrictions, such as disability of making Berserk condition (random attack is done easily, but how to do forced random attack, when you have the "Change" command always?) So it's interesting that someone else tried to work with this.
Well, actually, it's a coincidence of sorts, I am working on this very project right now after finding out that Turn Based patch crashes when loaded with DynRPG (it's in Cherry Tree, meaning I get the whole "nice job testing" impression). I managed to get it into just three things to copy.
My system has all the custom weirdness I want, like differences for day/night or rogue aggressive enemies that don't respect the turns system and attack on their own time while the others are waiting for you to act.
My system has all the custom weirdness I want, like differences for day/night or rogue aggressive enemies that don't respect the turns system and attack on their own time while the others are waiting for you to act.
I know I found this out a long time ago, but it's been a while...The ATB wait function is basically broken in RM2k3, right?
No, it works. For all the good it does. The wait happens inside skill/item menus. Or when selecting targets. You cancel that and sometimes immediately get whammed by a magic or physical attack.
author=bulmabriefs144
Well, actually, it's a coincidence of sorts, I am working on this very project right now after finding out that Turn Based patch crashes when loaded with DynRPG (it's in Cherry Tree, meaning I get the whole "nice job testing" impression).
You might notice that the turn-based battle patch (which is actually a demo for the community) is not on Cherry Tree but only posted in some threads in forums here and there.
author=bulmabriefs144
No, it works. For all the good it does. The wait happens inside skill/item menus. Or when selecting targets. You cancel that and sometimes immediately get whammed by a magic or physical attack.
Yeah, I've noticed that even when the ATB is set on active. However, I am wondering what happens if the ATB gets set to "Wait". Also, I thought I read somewhere that having the ATB set on "Wait" can be detrimental somehow (can't remember). Perhaps it had something to do with retroactive events, which is what I'm using to get some spells to work.
author=Cherryauthor=bulmabriefs144You might notice that the turn-based battle patch (which is actually a demo for the community) is not on Cherry Tree but only posted in some threads in forums here and there.
Well, actually, it's a coincidence of sorts, I am working on this very project right now after finding out that Turn Based patch crashes when loaded with DynRPG (it's in Cherry Tree, meaning I get the whole "nice job testing" impression).
It was on Cherry Share. http://share.cherrytree.at/showfile-1900/tbbpatch_demo.rar
But that's splitting hairs. Anyway...
The ATB system is kinda wonky. You speed yourself up, and monsters forget to attack, you slow things down and monsters are challenging again, but ATB slows to a crawl (hence the need for stuff like faster ATB, which sorta half-fixes the problem, but creates a new problem of monsters rushing your decisions if they move at 800 or faster).
Unfortunately, there is a bug:
http://rpgmaker.net/forums/topics/12736/?post=445088#post445088
It sometimes causes teleports not to be executed, because you are returning "false" from "onEventCommand".
Documentation says:
http://rpgmaker.net/forums/topics/12736/?post=445088#post445088
It sometimes causes teleports not to be executed, because you are returning "false" from "onEventCommand".
Documentation says:
false will prevent the event script line from being executed and other plugins from receiving this notification, use true otherwise
author=Cherry
Unfortunately, there is a bug:
http://rpgmaker.net/forums/topics/12736/?post=445088#post445088
It sometimes causes teleports not to be executed, because you are returning "false" from "onEventCommand".
I don't know why this can appear, because I return false when and only when the next command is looped to this one (so the teleport would be called again). Anyway, in next version I would remake the map control system, so this bug won't be able to appear.
Maybe I should test this more, just for understanding :)
Why does it crash for status other than death? I only saw a check for whether or not characters exist.
Anyway, since the RTP was missing, leading to a bunch of strange problems, I basically made a (very) simple copy with an RTP included.
Right here.
Don't do it by atb, it causes trouble with freezing if things don't work. Use an atoi-based variable (let's call it Turns) and then do something like
and
1. If it fails due to a glitch, unlike the ATB, it shouldn't freeze, just not turn off/on for the switch (I may be wrong)
2. Simply by omitting the switch from the monster commands (as above, it should say Precondition Turns ON, Do Nothing forcing the monster to wait out its turn) you can create "aggressive" monsters that don't wait their turn, or customize it a bit.
Also, how do you access the monster and actors present in battle? Cerberus and I both had trouble pinning this down. I had to improvise with a preset number, but it went all screwy when monsters died (skipped turns), and his didn't have an exact for actors.
Anyway, since the RTP was missing, leading to a bunch of strange problems, I basically made a (very) simple copy with an RTP included.
Right here.
Don't do it by atb, it causes trouble with freezing if things don't work. Use an atoi-based variable (let's call it Turns) and then do something like
RPG::switches[Turns] = true
and
RPG::switches[Turns] = false
1. If it fails due to a glitch, unlike the ATB, it shouldn't freeze, just not turn off/on for the switch (I may be wrong)
2. Simply by omitting the switch from the monster commands (as above, it should say Precondition Turns ON, Do Nothing forcing the monster to wait out its turn) you can create "aggressive" monsters that don't wait their turn, or customize it a bit.
Also, how do you access the monster and actors present in battle? Cerberus and I both had trouble pinning this down. I had to improvise with a preset number, but it went all screwy when monsters died (skipped turns), and his didn't have an exact for actors.
author=bulmabriefs144
Don't do it by atb, it causes trouble with freezing if things don't work.
I thought that in the final version I should take into account all possible causes. Maybe it's the wrong way...
author=bulmabriefs144
Also, how do you access the monster and actors present in battle? Cerberus and I both had trouble pinning this down.
Didn't understand the question, sorry :(
I ran into another bug, that causes the battle to freeze if a character dies. It doesn't happen every time, but still fairly frequently. I can make a video if it helps.
author=bulmabriefs144Didn't understand the question, sorry :(
Also, how do you access the monster and actors present in battle? Cerberus and I both had trouble pinning this down.
It was to Cherry or someone else. You wrote in your code
if character != NULL
Yea, Milennin, that's part of what we're trying to figure out (it happens more often if they are stopped movement to something like Paralyze).
















