Originally Posted by
Lelouche Vi Britannia
Woot! I figured it out on my own! Sadly, I do have to take up 4 counters with this nonsense but hey, 24 counters is a lot of extra counters to work with so might as well put them to good use eh?
const int CR_LIFECUR = 7;//set current life mirror to script 1, can be modified if needed
const int CR_LIFEMIRMAX = 8;//Set max life mirror counter to script 2, can be modified if needed
const int CR_MAGICCUR = 9;//set current magic mirror to script 3, can be modified if needed
const int CR_MAGICMIRMAX = 10;//set current magic max mirror counter to script 4, can be modified if needed
//create 4 counters on passive subscreen using script 1, 2, 3, and 4 (or chosen slots) where desired
global script Active
{
void run()
{
while(true)
{
Game->Counter[CR_LIFECUR]=Link->HP;
Game->Counter[CR_LIFEMIRMAX]=Link->MaxHP;
Game->Counter[CR_MAGICCUR]=Link->MP;
Game->Counter[CR_MAGICMIRMAX]=Link->MaxMP;
//section may also contain other global script stuff as normal
Waitframe();
}
}
}
I'll probably go ahead and post it on PureZC just because
This is to do what? Display HP and MP Current/Max as numbers on the subscreen? if so, then aye, this is one of two options that you have available. The other, is to use draw instructions to draw the values. I essentially do what you did here, in several quests, and since then, I have become more focused on scripted draws for the subscreen elements. Either work perfectly well.
You do have one issue in this script: You want a Waitdraw() instruction, so that these update at the correct time:
Code:
const int CR_LIFECUR = 7;//set current life mirror to script 1, can be modified if needed
const int CR_LIFEMIRMAX = 8;//Set max life mirror counter to script 2, can be modified if needed
const int CR_MAGICCUR = 9;//set current magic mirror to script 3, can be modified if needed
const int CR_MAGICMIRMAX = 10;//set current magic max mirror counter to script 4, can be modified if needed
//create 4 counters on passive subscreen using script 1, 2, 3, and 4 (or chosen slots) where desired
global script Active
{
void run()
{
while(true)
{
//These should occur before Waitdraw. -Z
Game->Counter[CR_LIFECUR]=Link->HP;
Game->Counter[CR_LIFEMIRMAX]=Link->MaxHP;
Game->Counter[CR_MAGICCUR]=Link->MP;
Game->Counter[CR_MAGICMIRMAX]=Link->MaxMP;
//section may also contain other global script stuff as normal
Waitdraw();
//Stuff that should happen *after* Waitdraw(), goes here. -Z
Waitframe();
}
}
}
This is a function inside the global active script in most of my older RPG-esque quest projects:
Code:
//Call before Waitdraw()
void UpdateDisplayCounters(){
Game->Counter[CR_MAX_MP_DISPLAY] = Link->MaxMP;
Game->Counter[CR_MAX_HP_DISPLAY] = Link->MaxHP;
Game->Counter[CR_MP_DISPLAY] = Link->MP;
Game->Counter[CR_HP_DISPLAY] = Link->HP;
}
It might be a tiny bit cleaner to do it that way, and then to call a function prior to Waitdraw().
Also: You also want to use code and /code for your tags for this, not spoiler and /spoiler. You do not need (or want) indent tags. Just paste the code inside code tags, and your indentation is preserved.
As-is, when you copy/paste the code into a text file from the browser, all of your tabbing goes poof. Click the quote button on this post, to see the difference.