1/4 Magic Container --My first ZScript
I need some help getting this thing off the ground. Maybe some insight in to how the 1/4 Heart containers work would be helpful.
In Psudo Code:
Declare var PMC /*Peice of Magic*/
Upon Pickup
PMC = PMC +1
if PMC = 4 {
Increce magic containers by 1
PMC = 0
}
if PMC = 0 {
Display 0 Tile on subscreen at (X,Y)
}
if PMC = 1 {
Display 1 Tile on subscreen at (X,Y)
}
if PMC = 2 {
Display 2 Tile on subscreen at (X,Y)
}
if PMC = 3 {
Display 3 Tile on subscreen at (X,Y)
}
end
Forgive me if this is too sloppy. I Guess what I need to know is what a code that Executes upon item pick up looks like, and any pit falls I should know about placing things on the subscreen (Will the Magic container Icon need to be refreshed on a regular basis?)
Re: 1/4 Magic Container --My first ZScript
Uh, you know that all you have to do is modify the actual containers to get your desired effect, right? You don't really need a script. :p
Edit: By the way, I'm not exactly sure if you can modify things like that yet. No wait... Well, there's a ZScript function called Link->MP. Perhaps you can use that to get what you want. Just declare a variable (using int or float) and tell it to load that. It SHOULD work, but I'm not guaranteeing anything.
Re: 1/4 Magic Container --My first ZScript
No, I think he's talking about making Magic Container Pieces, where once you collect 4 your magic jumps up by 1, instead of having individual Magic Containers which give you 1/4 each. (And you probably want to use Link->MaxMP, not Link->MP)
As far as I know, playing a script upon item pickup isn't implemented yet. If you really wanted to, you could make it a usable item, which when used increased your PMC count by one and then removed itself from your inventory.
I'd just wait though. :D
I have no idea how to draw to the subscreen, though. :(
Re: 1/4 Magic Container --My first ZScript
Quote:
Originally Posted by
Grayswandir
No, I think he's talking about making Magic Container Pieces, where once you collect 4 your magic jumps up by 1, instead of having individual Magic Containers which give you 1/4 each. (And you probably want to use Link->MaxMP, not Link->MP)
That Exactly what I have in mind, Just like the Peices of Heart we currently have. I can't help but think that the "Peice of Heart" Item class should have been a "Peice of Anything" Item Class. Perhaps I should suggest that?