PDA

View Full Version : 1/2 Magic Upgrade Item?



Shazza Dani
12-23-2008, 07:39 PM
Is it possible to use a custom item to give the player the 1/2 Magic Upgrade?

Joe123
12-23-2008, 08:51 PM
Yes

Shazza Dani
12-23-2008, 09:05 PM
Care to expand on that a little bit? ._.

Joe123
12-23-2008, 09:43 PM
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.

Lelouche Vi Britannia
11-19-2015, 01:22 PM
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.


import "std.zh"

item script BookofMidora
{
void run ()
{
Game->Generic[GEN_MAGICDRAINRATE] = 0.5
}

}

Tamamo
11-19-2015, 03:15 PM
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.


const int GEN_MAGICDRAINRATE = 1; // Link's magic usage equals n / 2.

Lelouche Vi Britannia
11-19-2015, 07:06 PM
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.

Tamamo
11-19-2015, 07:28 PM
Game->Generic[GEN_MAGICDRAINRATE ]

const int GEN_MAGICDRAINRATE is already declared and found in std.zh

Lelouche Vi Britannia
11-19-2015, 11:53 PM
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.

SUCCESSOR
11-20-2015, 02:06 AM
Hmmm. Has someone tested fraction with that? Is it confirmed to be truncated?

Tamamo
11-20-2015, 09:35 AM
Yeah ZoriaRPG reported it, I confirmed it.

Anarchy_Balsac
11-20-2015, 10:44 AM
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.

ZoriaRPG
11-20-2015, 01:27 PM
Hmmm. Has someone tested fraction with that? Is it confirmed to be truncated?


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.

Lelouche Vi Britannia
11-20-2015, 04:04 PM
So the other question is with that script will it trigger the appearance of the 1/2 magic symbol or is that another function?

SUCCESSOR
11-20-2015, 05:19 PM
Aye, it's on the heap of things that I'd like to change at some point, to allow different magic usage rates.


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:


So the other question is with that script will it trigger the appearance of the 1/2 magic symbol or is that another function?

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

Anarchy_Balsac
11-20-2015, 06:44 PM
So the other question is with that script will it trigger the appearance of the 1/2 magic symbol or is that another function?

Yes, it shows up.

ZoriaRPG
11-21-2015, 03:50 AM
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.)