New account registration is temporarily disabled.

[RM2K3] XENOMIC'S HELP TOPIC

Posts

More like this:


Variable Oper: [2791:Hero Extend Variable] Set, 1
Loop
Comment: @dynparams_add_param 2, V2791
Comment: @dynparams_overwrite_next
Branch if Reimu Extend Condition
Comment: @dynparams_add_param 1, V2791
Comment: @dynparams_overwrite_next
Change Cond: Reimu Extend Remove
Variable Oper: [2792:ConditionNumber] Set, 10
Loop
Comment: @dynparams_add_param 2, V2791
Comment: @dynparams_add_param 4, V2792
Comment: @dynparams_overwrite_next
Branch if Reimu Haste Condition
Comment: @dynparams_add_param 1, V2791
Comment: @dynparams_add_param 4, V2792
Comment: @dynparams_overwrite_next
Change Cond: Reimu Haste Remove
Comment: @dynparams_add_param 1, V2791
Comment: @dynparams_add_param 4, V2792
Comment: @dynparams_overwrite_next
Change Cond: Reimu Haste Inflict
End
Variable Oper: [2792:ConditionNumber] +, 1
Branch if Var [2792:ConditionNumber] is 15
Variable Oper: [2792:ConditionNumber] Set, 16
End
Branch if Var [2792:ConditionNumber] is 17
Variable Oper: [2792:ConditionNumber] Set, 41
End
Branch if Var [2792:ConditionNumber] is 43
Variable Oper: [2792:ConditionNumber] Set, 54
End
.
.
(etc.)
.
.
Branch if Var [2792:ConditionNumber] is 500
Break Loop
End
End Loop
End
Variable Oper: [2791:Hero Extend Variable] +, 1
Branch if Var [2791:Hero Extend Variable] is 55
Break Loop
End
End Loop

The commands dealing with Extend don't need to have parameter 4 modified. Also, make sure the Branch If commands get parameter 2 modified, whereas the Change Cond commands should have parameter 1 modified. To deal with the clusters, you have a bunch of Branch If commands which check whether you just ran off the end of a cluster, and if so skip to the start of the next cluster.

EDIT: Noticed and fixed a mistake in the code.
So then, for instance with #41 and 42 (Bravery and Faith), it'll start right at 41 after it checks for Blink, it'll have...ok, I'm not really sure I'm understanding how this works. Would I just add the Branch If for the conditions underneath the proper Branch If sections checking for the Condition variable? Do I add a check for those variables before the +1 to the Condition variable? Shouldn't the Haste condition be underneath such a Branch??
Not sure what you mean by the "proper" Branch If sections. -.-a But the whole idea is, the commands which are checking for, removing, and re-inflicting "Haste" on "Reimu" aren't actually doing exactly that; they're doing it with whatever status condition is currently represented by ConditionNumber, on whichever hero is currently represented by Hero Extend Variable. DynParams is a hack which replaces key parts of the command that comes right after @dynparams_overwrite_next. In this case, they're replacing the hero and the condition. So that one check for "Reimu" and "Haste" covers all the possible heroes and conditions you might want, as long as you loop over it while putting Hero Extend Variable and ConditionNumber through all the values for those heroes and conditions.

By the way, I spotted and fixed an error I made in the code above: the @dynparams_overwrite_next comment commands for the "Haste" remove and inflict commands were in the wrong place. Also, with that many conditions to check for on that many heroes, I wouldn't be surprised if this would cause some lag. If it does, you might want to check out Kazesui's tutorial on "Good" rm2k3 event coding. It has a section on doing loops using Labels and Jump to Labels, which while not good programming practice in general, weirdly seems to perform significantly faster than RT2K3's default Loop/End Loop command.
Oooooh. So essentially, after it does is inflicted with (in this case, Reimu and Haste) it'll increase the variable afterwards, then whatever it's at next it'll make it go to next one (so in this case, Reimu and Regen) so I don't have to actually do anything after that. I got it now, that's the part that was throwing me off heh. Sometimes my brain doesn't work right.

Well, there's already a big lag in the system as it is from my Weapon/Armor Bless coding (if you have my game and actually looked in the database at those, you can see why. The coding is ridiculously huge, but that was before I knew about this, and before the ResistCondition plugin existed. I would LIKE to update that so that it will hopefully reduce the lag from it AND make the coding more fluid and better). I'll just have to see how it is with this with testing is all! ^^




So if I'm not mistaken, it would be exactly like this, yes? I'm pretty sure I understood this correctly. Forgive me if I'm an idiot. ^^;;
That looks good, although it looks like you have a duplicate check for ConditionNumber being 400. That won't hurt the logic flow any, but you might as well delete it for efficiency's sake. X)
Nah, that's just where I took the second screenshot at (if you look at the first image where 400 is, the <> at the bottom is cut off, much like at the bottom of the 2nd image). ^^;

I thought of using DynParams for Weapon Bless, but not sure HOW that would work with that coding at all. The Armor Blesses it MIGHT work, but that'll be tricky to do in conjunction with all of the coding that'd need to be done...>_<
You know, since DynParams helped so much with Extend (I actually haven't tested the Extend spell itself yet, mostly due to other things. I need to get some status icons made for these statuses so I can see which ones are on and how long they're on and all that. Haven't messed with the plugin for that...), I'm assuming this can also be done for things like Auto-Med (if a character is inflicted with a status effect, automatically uses the correct status healing item to remove it. If a character is inflicted with 3 or more statuses at once, will use a Faith (Remedy) on that character instead. I am still debating on the exact schematics for this one) and Auto-Phoenix (if a character is KO'd, automatically uses lowest level revival item. AoE revives will not be used if only 1 character is KO'd, but will be used if 2 or 3 are KO'd)? Both of these would be battle passives for Reisen (Auto-Med her default, Auto-Phoenix being an upgrade to that when equipped with specific armor).
Prrrrrobably? I could see it being useful for checking for and counting up status effects. It would probably get a little complicated if you're trying to rig up a system that decides what the highest-priority item to use is and on which hero, but it could be done.
It would be something more like:

If Player has at least 1 or more Antidote
If Reimu has Poison
Remove Poison
Remove Antidote x1
End
End

Rinse and repeat for each status, although I'm not sure how I'd handle doing the coding for 3 or more statuses on the same character to use Faith (Remedy) on them. I don't know, maybe it's not worth doing it this way since maybe the player doesn't want to just automatically use items like that too. Hmm...but what would work best as a battle passive for Reisen then (her current one is SUPPOSED to halve the status levels of all characters, but it's bugged and doesn't work right obviously. Or it just works on level 10 statuses and never any other level statuses).

Ah, here it is:

*Disinfectant: If a party member is inflicted with a negative status, status level is halved. Only works if Reisen is not KO'd.

Like, you can clearly tell the theme I was aiming for with Reisen, but this just doesn't work right. It's the same reason I removed her secondary command and gave her Suwako's Armor Status Bless. For the record, this is what her original secondary command was:

SECONDARY COMMAND:

Insanity: Absorbs all negative statuses except Death from allies and gives them to Reisen.


SECONDARY COMMAND UPGRADES:

*Insanity Level 2: Absorbs all negative statuses except Death from allies and gives them to Reisen, then halves the levels of the statuses on Reisen. Only usable while equipped with the Bunny Outfit.
*Insanity Level 3: Absorbs all negative statuses except Death from allies and gives them to Reisen, then halves the levels of the statuses on Reisen as well as removing any statuses that prevents actions. Only usable while equipped with the Lunar Jacket.

(The coding on those btw are nightmarish as you can imagine ehehehe...).



EDIT - It seems like the coding for Extend doesn't work at all. I tried it during this boss fight, and it didn't reset the statuses at all like it should have. Is there something that's not right in the coding???
I don't see anything wrong with it. I tried testing the basic theory just now by setting up a battle in my DynBattleDisplay project that removes and inflicts Blind on the whole party every turn. It seems to hold the number of turns remaining at 3 in general, but occasionally it dips lower, maybe due to multiple battler actions happening "at once". That could be problematic for you.
Hmm...I do have it set as a Common Event that's called in a Turns Elapsed x1 event that has a lot going on. Actually, could it be that it's not looping itself properly at all (since Reimu's not in this part, it cannot be tested that way unless I go to the debug room which I probably should to test this)?
Reimu being there or not shouldn't really make a difference. All the references to Reimu in the code above get overwritten by the Hero Extend Variable's value, which should cycle through the database reference numbers of all the heroes in turn. You could have any hero listed in those commands and it should work exactly the same.

Have you tried adding Message commands in the code to help you trace its behavior? You could, for example, add a Message that says,

"Extend detected on \n[\v[2791]]"

right after the Conditional Branch which checks for Extend. That would tell you whether the detection of Extend is working properly.
No, I was referring to in my current save file I can't use Reimu for testing lol.

That's something I'm thinking of doing, whenever I remember to get around to testing it (I just got done spending 2-4 hours fixing up a cutscene because argh cutscenes).
Still haven't gotten around to testing the Extend coding, as I've another issue.

So, normally HP/MP+ accessories work as intended. Except when leveling up/down, I realized.

For instance, let's take Marisa here as an example:

Level 6

231 > 369
63 > 100

The left are her stats before equipping the Iron Duke, which gives +60% Max HP/MP. This is without leveling up.

Level 7

265 > 424 (403 when equipped with Iron Duke)
70 > 112 (107 when equipped with Iron Duke)

This is testing leveling up from level 7 with the Iron Duke on and with it off. First number is without (which is her base stats), 2nd is with. So apparently, there's some weird scaling that happens with leveling up, and probably elsewhere.

The coding, if you're inclined to see:




This is how it is on all of the accessories that increase stats by % amounts (weapons also do this with stats too, but nothing else except accessories right now does it with HP/MP). Is there a better way of handling this? Or am I just...kinda screwed with it doing things like this? The Common Event is a Call event that's called by another Parallel Process common event (that calls all of the map events, such as HP +10%, HP +20%, Equipment Abilities, etc.)
Still need to do something about those HP/MP+% accessories, if anyone can help. Meanwhile, here's something new! I've decided to make the Curse status inflict "No Healing". That's simple enough to do, since it'd be similar to the Zombie coding:




However, since I have 10 levels of Curse status (level 1 lasts 5 turns, level 10 lasts until death or cured), this makes it a bit cumbersome to code, especially when I have to make sure that Zombie doesn't interfere with it. So...the question is, what's the most efficient way of coding this?

Of note, 0014 is the Cure attribute (which is used for all character abilities and most items. % healing doesn't fall into this at all), and 0018 is Enemy Cure (used for enemy abilities that affect the player. This was due to how when enemies used the Cure attribute on the player it hurt them instead of healed them which...I don't know WHY that happened, but it did. Same reason that when they used it on themselves, it hurt them instead of healed them).

(Also thinking of making a Virus status for the "No EXP" effect, but that's for another time)

What would be SUPER cool is if there was a plugin, now that I think about it, that would allow to add/subtract from the duration of statuses, or set them to a specified value when inflicted (of course, that might be harder to do than it sounds...).
I'm not going to be of any help with the DynRPG questions, but here are some plain old rm2k3 responses:

The problem though is this: I found out that Switch skills will NOT appear in Skill Subsets, but only in Skills. Meaning I have to turn any skillset that is a Subset into a Skill so that it appears. However, in doing so, things that are SUPPOSED to be in another Skill Subset will also appear in that Skill set too.

The best trick I've encountered for this is to track MP consumption. Check if a character has used the skill sub-set, and then check how much their MP decreased. Assuming you make that MP amount unique (so that only one of their available abilities cost that much MP), you now can check which ability was used and run scripts appropriately.

Setting current MP amount for the character can be done on-turn (such as, Character has taken 1x turns), since that triggers prior to MP reduction. Then you can check for how much MP they have after using an ability in a "Hero HP between 0-100" trigger, since that occurs after MP has been reduced. I'd further suggest you place the condition "Hero has used x command" to prevent it from triggering constantly (as the Hero HP trigger is run after every action from monster or ally). You can't use the "Hero has used x command" trigger since that occurs before the MP is reduced. You must use the condition check within another trigger/event.

If you use the "halve MP cost for spells" as an item, you can simply also check for half of the original MP consumption, assuming that it is also unique.

It's worth noting that I've actually given up using sub-sets due to this problem, but in a singular case it's not too bad to create the extra triggers and events to handle it.

Another option is quite a bit more risky but very doable, which is to track monster HP or MP. You can set your skill to do 1 damage and ignore defense, meaning it will always do exactly 1 damage. Then you just check if a monster has lost one HP. The problem is that there's a small chance for a false positive. But remember that the condition "Hero used x command" is available in all triggers, so you should only get a false positive if the hero in question has another ability that could accidentally do a single point of damage. All damage formulas are known, so you can actually check this and be 100% certain on it.

Alternatively, if you want to remove the MP stat for all monsters and make all of their skills free (not exactly recommended, but totally doable), you can make skills that damage MP an exact amount, and then check if their MP is reduced by that amount to call special events.

**Good Omen: Absorbs all damage equal to target's Max HP, then disappears. Will not work on damage that exceeds target's current HP or any effect that instantly kills target. Each level increases HP threshold by 20%, up to 200% Max HP.

I think I'm missing something here, but in case I'm not, here's what I would do:

In the "Turns Elapsed 1x" trigger, set the character's current HP to an unused variable.
In the "Hero HP between 0-100" trigger or the "Party Exhaustion between 0-100" trigger (as either of these occur after damage is dealt), set the character's current HP to another variable, and then calculate the difference to find the damage dealt.
Then check which is larger: the remaining shield (another variable) or the damage dealt. If it's the damage, add the amount of the remaining shield to the character HP. If it's the shield, subtract the damage from the shield amount and add the damage amount back to the character HP.

Reimu Extend Ability

Sadly there is no easy way to check if a character has a condition. So even though there's an easy way to inflict or remove conditions from characters, there's no easy rm2k3 method to solve your issue.

One thing I do want to ask is how often the script runs. Changing conditions in rm2k3 is extremely laggy, so doing it multiple times in the same script can be a serious problem. But the most series it when it runs when it doesn't have to. There is no way to avoid the lag to my knowledge, and the only way to reset the duration of a condition is to remove it and reapply it, as you are doing. Sorry I can't be of more help here.

Iron Duke
This is how it is on all of the accessories that increase stats by % amounts (weapons also do this with stats too, but nothing else except accessories right now does it with HP/MP). Is there a better way of handling this? Or am I just...kinda screwed with it doing things like this? The Common Event is a Call event that's called by another Parallel Process common event (that calls all of the map events, such as HP +10%, HP +20%, Equipment Abilities, etc.)

My recommendation here is to keep track of character's max HP and MP in variables and then always reset the actual HP and MP to match those variables when making adjustments for equipment and what-not. That way when you equip something that has an adjustment, such as +60% max HP, you can do something like follows:

Set maximum HP to the value of the variable
Set a new variable equal to 60% of the variable
Add the new variable to the maximum HP

You can then also add in new lines for whatever extra equipment may need to be adjusted.

As for tracking levels, a new level simply adds to the maximum HP, so you can check what the maximum HP was before and after a level, know how much the level added, and adjust the base HP variable appropriately (hopefully that made sense).

You don't necessarily need to do it that way, but the variables for the characters stats (I like to include not only HP and MP but also attack, defense, etc) can be used for a lot of other custom code as well.
*For monsters, that issue isn't too big of a problem. For playable characters, it is since I have MP Regen and MP Sap as statuses, so those can mess with those easily, as well as some skills that take a % of Max MP to use. ^^;

*I never had that problem with lag with checking character conditions since I have it relegated to Common Events (and the ResistControl plugin is SUPPOSED to work with this, as well as the thingie that Audrey told me about. Unless...I'm not usin it somehow? But it looks like it's there so...). The only time I have lag right now, AFAIK, is from my Weapons/Armor Bless coding (because there's a loooooot of coding being ran at once for those. Wish there was an easier way of dealing with those. Probably is with Armor Bless now, but Weapon Bless is stuck as it is).

*Aye, I have one variable per stat per character, so that's good to go at the very least. Although I'm not 100% sure on the coding (even though it should be simple enough). So it would be something like


Branch if Marisa Iron Duke Equipped
Branch if Var [0908: Var. Marisa Access] is 0
Var [0402: Marisa Max HP] Set, Marisa Max HP
Var [0403: Marisa HP] Set, Var [402]
Var [0403], x60
Var [0403], /100
Var [0402], + Var [0403]
Var [0908] Set, 13
End
Else Handler
Branch if Var [0908] is 13
Var [0402] Set, Marisa Max HP
End



...I gave up on the Else Handler because wouldn't that just keep increasing/decreasing the stat indefinitely? Or am I just being a dumb butt? @_@;
author=Xenomic
*FFor playable characters, it is since I have MP Regen and MP Sap as statuses, so those can mess with those easily, as well as some skills that take a % of Max MP to use. ^^;
Technically you can add extra code to account for conditions, but the % MP would break it, yes. Certainly eliminating skill sub-sets is the safer (and easier) option.

Iron Duke
The key is that you never set your HP variable to your current HP. Instead you're setting your current HP to your HP variable. So more like this:

(I don't know what "Marisa Access" means, so I didn't include it.


Comment: store Marisa's current HP so that it can be reset back to that amount later
Var [0403: Marisa HP] Set, Marisa HP

Comment: reset Marisa's max HP to that of her max HP variable
Var [0001: Temp Variable] Set, Marisa Max HP
Branch if Var [0402: Marisa Max HP] is [0001: Temp Variable] Greater
Var [0002: Temp 2] Set, Var [0402: Marisa Max HP]'s Value
Var [0002: Temp 2] - [0001: Temp Variable]
Change Statistics: Marisa Max HP V[0002] Up
Else Handler
Var [0001: Temp Variable] - [0402: Marisa Max HP]
Change Statistics: Marisa Max HP V[0001] Down
End

Comment: now check for equipment, conditions, and whatever else and adjust as necessary
Comment: note how I'm using the variable rather than actual HP values here
Branch if Marisa Iron Duke Equipped
Var [0001: Temp Variable] Set, Var [0402: Marisa Max HP]
Var [0001] x 60
Var [0001] / 100
Change Statistics: Marisa Max HP V[0001] Up
End
Branch if Marisa Cursed Sword Equipped
Change Statistics: Marisa Max HP 100 Down
End
Branch if Marisa Bubble Condition
Change Statistics: Marisa Max HP V[0402] Up
End

Comment: now that we have the correct max HP, set the correct current HP
Change HP: Marisa HP 9999 Remove
Var [0403: Marisa HP] - 1
Change HP: Marisa HP V[0403] Recovered

We first begin by recording the current HP of Marisa. This is necessary because we may be decreasing Marisa's Max HP value below her current HP value, and we don't want her to lose HP before every battle or after every equipment screen. This step has to be coded for each character who's HP you're tracking.

Next we reset Marisa's max HP to the value of a stored variable that holds her base HP amount. This should be a simple Set command, but rm2k3 lacks such a basic option. My backup plan was to decrease max HP by 9999 and then increase it by one less than the amount needed. That's simple, but amazingly rm2k3 actually tracks NEGATIVE max HP values. Seriously. It'll display a 1 for your max HP, but it'll remember you're actually -5000, for example, and if you increase max HP by say 2000 afterward it will have no effect.

As a result we're stuck with a somewhat convoluted setup where I must identify first if the stored variable max HP is higher or lower than Marisa's Max HP. If it's higher, I add the difference to Marisa's Max HP. If it's lower (the more likely case), I subtract the difference. This step, like the prior one, must be done individually for each character.

The third step is to check equipment and any other status that a character may have that affects maximum HP. If you use only equipment in this step you can actually process this in a big loop, meaning you only need to code it once and then loop it for each character, rather than individually set it for each character. Just set a variable to the character's equipment value, run the loop, and then repeat. Conditions, however, need to be individually programmed.

Whether you loop it or not, however, the step is relatively straight forward. Just check for the equipment and then adjust the maximum HP value accordingly. The advantage of this method is that it's now really easy to layer multiple pieces of equipment or effects on top of each other without significant extra coding.

The last step is to set Marisa's current HP value to what it was before we changed everything. This is fortunately a lot easier than adjusting the max HP value because rm2k3 does not record negative current HP values. Therefore we can just subtract 9999 to set the current HP to 1, and then add in one less than our originally stored current HP value to get back to the correct current HP value.

Note that we do not alter the variable that holds Marisa's base max HP anywhere in the above code. That variable should only be touched upon level up, or any other time when the base value needs changing.

To handle level ups, you can either custom code your level ups or track how much Marisa's max HP changes from the beginning to end of battle (as that would be from her level up). A single variable for Marisa's pre-battle HP would be all you'd need to add in addition to the script to track and make changes.

You would run the level up check after each battle first, then the code I wrote above.

---

Option 2:
After writing out all of the above I got to thinking that maybe there's a way that might be easier for you. The concept here is that you should track the CHANGE in maximum HP from equipment, etc. rather than the actual maximum. The advantage of this method is that there's less scripting and you don't have to worry about level ups. The downside to this is that you'll have less freedom in changing maximum HP values because there isn't a backup variable that you can rely on. Still, this might be the better way to go.


Comment: store Marisa's current HP so that it can be reset back to that amount later
Var [0403: Marisa HP] Set, Marisa HP

Comment: undo any prior alterations to Marisa's maximum HP from equipment, etc.
Change Statistics: Marisa Max HP Var [9002: Marisa Max HP Decrease] Up
Change Statistics: Marisa Max HP Var [9001: Marisa Max HP Increase] Down

Comment: set the change variables to zero (there's no change now as you've undone them)
Var [9001: Marisa Max HP Increase] Set 0
Var [9002: Marisa Max HP Decrease] Set 0

Comment: store Marisa's Max HP (which is now her base) to make future calculations easier
Var [0402: Marisa Max HP] Set, Marisa Maximum HP

Comment: now check for equipment, conditions, and whatever else and adjust as necessary
Comment: note how I adjust both Marisa's max HP value and a Change variable now
Branch if Marisa Iron Duke Equipped
Var [0001: Temp Variable] Set, Var [0402: Marisa Max HP]
Var [0001] x 60
Var [0001] / 100
Change Statistics: Marisa Max HP V[0001] Up
Var [9001: Marisa Max HP Increase] + Var[0001]
End
Branch if Marisa Cursed Sword Equipped
Change Statistics: Marisa Max HP 100 Down
Var [9002: Marisa Max HP Decrease] + 100
End
Branch if Marisa Bubble Condition
Change Statistics: Marisa Max HP V[0402] Up
Var [9001: Marisa Max HP Increase] + Var[0402]
End

Comment: now that we have the correct max HP, set the correct current HP
Change HP: Marisa HP 9999 Remove
Var [0403: Marisa HP] - 1
Change HP: Marisa HP V[0403] Recovered

EDIT: Corrected some formulas.
"Marisa Access" is just short for "Marisa Accessory. It's the variable I use to control stat boosters on accessories, since I was thinking of having armor have its own variable (Weapons have their own variable as well right now, though none of those increase HP/MP and only other stats).

I will look into trying both of those methods to see which one will work best for me. They'll require testing one way or another regardless, but hey, if it helps, that'd be great. Plus if this works, that means I can probably bring back the Bubble status that I omitted (if I so desired. I don't know if the game REALLY needs it or not though ha...) and maybe try Disease again (ok, maybe I shouldn't add either of those statuses. ^^; ).

EDIT - I'm assuming that there should be a temp variable for each individual character, correct? I don't think using one temp variable for all characters is going to cut it??

EDIT #2 - Thinking on this, but what do people think of stat boosting equipment? Do you think it should be fixed % (HP +10%, HP +20%, etc.), or fixed values (HP +200, HP +400, etc.)? Which do you guys normally prefer?

EDIT #3 - I'm trying to figure out what all exactly would be limited by option #2. Care to explain compared to #1? Because if #2 is better than #1 (without having to deal with level up coding since that's a massive pain in the butt atm), and also includes stat boosters, then I may go with that over #1 since I cannot tell what's different between the two.