Is it possible to use a custom item to give the player the 1/2 Magic Upgrade?
Printable View
Is it possible to use a custom item to give the player the 1/2 Magic Upgrade?
Yes
Care to expand on that a little bit? ._.
Give it a script which alters 'Game->Generic[GEN_MAGICDRAINRATE]' I think.
Not that I've ever done it, but that looks like it should work to me.
Necroposting but... I wanted to tackle this one myself as I'm actually wanting to use this idea in my own quest. So let me know if this is correct.
Code:import "std.zh"
item script BookofMidora
{
void run ()
{
Game->Generic[GEN_MAGICDRAINRATE] = 0.5
}
}
Close, you made a mistake with Game->Generic[] it's an integer not a float.
Here's how it works to give you an idea.
Code:const int GEN_MAGICDRAINRATE = 1; // Link's magic usage equals n / 2.
So by that logic, a value of 2 is normal usage but a value of 1 is half? And I would use "const int" as the declaration rather than just game->generic or was that part okay? Sorry for the stupid questions, just starting to get into this stuff.
Game->Generic[GEN_MAGICDRAINRATE ]
const int GEN_MAGICDRAINRATE is already declared and found in std.zh
Ah! That makes sense. Probably need to glance over std.zh and see what all is in there so I can avoid looking like a total n00b in the future, lol.
Hmmm. Has someone tested fraction with that? Is it confirmed to be truncated?
Yeah @ZoriaRPG reported it, I confirmed it.
HA! By sheer coincidence I actually did this a while ago with Zelda 4. The only problem is that giving yourself the item via cheat menu won't do shit, but for that, they can give themselves 1/2 magic anyway.
Aye, it's on the heap of things that I'd like to change at some point, to allow different magic usage rates.
Usage:
Game->Generic[GEN_MAGICDRAINRATE] = value;
You can change the value by script, at any time. The 1/2 magic upgrade, does that, but you can reverse it, or change it as needed, albeit with somewhat restricted options.
So the other question is with that script will it trigger the appearance of the 1/2 magic symbol or is that another function?
I assume you can already. If you take "1/2 Magic" as the minimum rate you can set up your drain rate to just begin at a higher drain rate and change actual usage through the editor, if needed. Say you start the drain rate value at 8. Then it could be varied starting at 4x, to 3x, to 2x, to 1x, to 1/2x. :shrug:
The half magic icon is a subscreen element and I am not sure how it is triggered but I know how to fake it if you can't figure it out. :P
It's not even something that matters for my use, as I usually set MP cost by script, and parse all those costs through a filter function.
I just want to fix it, so that people can use the (item) editor without needing to muck about too much, by converting the values of that array to floats on the ZQ side. That'll allow decimal values, like 0.5, or .025, for multipliers of editor-abased magic costs. That shouldn't be too hard to change, on the source side, or so I hope. Of course, changing the quest format to reflect the additions that are on my list, and the expanded bytecode, is another matter. (It's pretty bleah.)