GREATREDSPIRIT'S PROFILE

sherman






o
Mario vs. The Moon Base
Mario must fight his way to Bowser's Moon Base to rescue the Princess!

Search

Filter

Whatchu Workin' On? Tell us!

I'm glad it gets some people going! I just leave snarky comments for my past self, or just scream

Whatchu Workin' On? Tell us!

I cringe at my own game's event structure, iirc a year or two ago somebody was asking for help for a custom encounter system and I thought of posting mine to help. Then I actually looked at it and it's horrible gloop and decided just to post general suggestions instead of my code.

I can try and help but I'm flaky as hell and I haven't touched 2k3 for years now besides little refreshers to try and help small problems. Hopefully I can help but never bet on me *continues to avoid finishing last bit of current game that's been sitting around for ages now*

Please enjoy this video of cute friends hangin out.

they are a cute couple

Whatchu Workin' On? Tell us!

I don't think I'm entirely grasping how you're trying to do it or how it works exactly (it has been a million years since I've done anything in 2k3 much less custom spell effects) but that doesn't mean I can't voice my butt opinion! The math itself can be simplified at least.

So there's five levels of Divine Lottery. I'll assume this is five separate skills. Instead of going into "Does Character X have Skill Y/Z/A/B/C" hell, for this segment of code I'll just use a variable: DivineLotteryLevel. Same with Omikuji+Level. DivineLottery is a value between 1 and 5, Omikuji+ is 0 to 3 since there's no guarantee a character will have that buff.

We'll use two extra variables, one for MaxPower and one for MinPower. MaxPower will be set to 10 at the start of our calculations, MinPower will be set to 0. Now since DivineLotteryLevel is a variable we can take a TempVariable and copy our DLL variable to our TempVar. Multiply our TempVar by 10, then add MaxPower by TempVar. Simple stuff, MaxPower will now be 20, 30, 40, 50, or 60 based on DivineLotteryLevel.

MinPower is just more of the same but with Omikuji+Level variable. Copy in temp var, multiply by 10, the add it to MinPower. It'll be 0, 10, 20, or 30.

Now if we could just do a random value between these two numbers we'd be set. RM2k3 only does random values between two set values but we can cheat this: Take our TempVar again and set it to a random value between 0-99999999 or similarly uselessly huge numbers. Now we can use modulus division to constrain the random value of TempVar within our confines. Our range is MaxPower-MinPower, so we'll just take our MaxPower variable and subtract MinPower from it. Then we'll take our TempVar, Modulus it by our MaxPower variable, and then Add the value of our MinPower variable to it. That'll get us a random number between MinPower and MaxPower without the need of these huge branches or other RM2k3 hell.
(if you do this a lot making it a common event and having designated variables as its inputs and output might be handy to make. Don't forget to check if you're trying to modulus by 0 since that'll cause a Divide by Zero error! If the range is zero then don't do the modulus, just output 0 or post a messagebox so you can try and debug it or something)

From there we have our % power we can apply to the MissingHP and calculate how much healing is applied to a character.


Now applying this ingame becomes the challenge. Like you posted checking individual character stuff sucks*. The entire math part of the event should be separated into it's own common event. The event that is triggered by using Divine Lottery will be responsible for feeding it information. I don't know Touhou so I'll use my sample cast list of Sanae, Sakura, Ralph Wiggum, and Dr. Wily. Actor IDs 1, 2, 3, and 4 respectively. So Sanae uses Divine Lottery which starts an event. This is where I'm least certain of what's going on but I'll assume there's some way to check who started the spell. There's be branch hell here as the DivineLotteryLevel and Omikuji+Level variables are calculated, I know no way I know of to get around this.

Next we need to apply the Divine Lottery skill to our party. Again we'd have to use hard coded branches here to see who is in our party. We'd check Sanae, she's in so we'd call our healing calculation event. This is where we'd introduce another variable: An ActorID variable to see who gets healing. Sanae is #1 so we'd pass that to our math calculation event above, it would calculate the healing amount (so we'd also have to get and pass Sanae's MaxHP and current HP as well), and let that common event take care of the rest. We'd then check if Sakura is in the party, then Ralph, and finally Dr. Wily.

Here's a screenshot of 2k3 code to try and convey what I'm saying:

This bit is where character specific stuff is looked up and put into variables so that...


This part is clean and modular. HERE BE DRAGONS is whatever is necessary to get the Divine Lottery and Omijuki+ level.

There's changes from what I described as I found better ways to event it as I was doing so, like the temp var is dropped as is Variable#23. I don't know if any of this was useful to you but I hope it was in some way! I don't know how to do fancy shit in 2k3 but I can organize shit and try to find workarounds for limitations!


* I had an enemy effect ingame that would "seal" the player's inventory. I did this by having a common event that would iterate through every consumable item the player had, taking the # of that they had and storing it in a variable, and then removing all items from the player's inventory. After the battle all their items would be restored. Giving the items back was about 12 lines of event code, taking them was two entire common events because it took 2k3 several seconds to load every command because I couldn't just say "Set Variable X to be Item Y's # in Inventory. I had to check every, single, item.

What are you thinking about right now?

author=kentona
you really cut the mustard as a wizard, GRS!


Just don't expect any high level magic out of me, I'm known to clutch my Pearls.

What are you thinking about right now?

I'm gonna cast dijon on y'all, get ready!

(I forgot that series existed, I watched it last time until the story trigger broke after the Ant Lion. Thanks!)

What are you thinking about right now?

Neat, I'll have to check it out. Thanks!

What are you thinking about right now?

somebody please make a game where all the text is translated by google and see how incomprehensible it is

also business cat is a hard worker, please be nice to all cats

What are you thinking about right now?

author=Hexatona
how did you get him unarmed?

The thing that gets me with big bang is that... it makes NO SENSE.

He DESTROYS all those planets (several times!?) then, it misses earth, hits the sun, and it's... the heat from the sun expanding that's hurting you? LIKE WHAT!? It's bonkers.


The logic is that it was cool as hell back in 1997 and it blew the minds of kids everywhere until 1998 where they wished for all these stupidly long animations to hurry up and get it over with (lol eden)

For a long time I never knew it was a gravity attack either, deals something like 15/16 damage. Destroys planets but can't even kill you unless you have jack shit HP!

speaking old shit that took forever but was cool as hell once, FF14 made a boss fight out of Knights of the Round, even with a bit where all the knights come out and try to kick you in the face! (via MMORPG mechanics)

Whatchu Workin' On? Tell us!

It got me to look up the phases of the moon chart to make sure I remembered waxing/waning right so it's all cool, TIL a half moon is called first quarter (after a new moon) and third quarter (after a full moon)!