I need a script where if you press a button, like L, then a string will appear depending on what screen you are on. i'm using 2.53
Edited by Blackpaintbowser, 21 October 2021 - 05:05 PM.
Posted 21 October 2021 - 05:02 PM
I need a script where if you press a button, like L, then a string will appear depending on what screen you are on. i'm using 2.53
Edited by Blackpaintbowser, 21 October 2021 - 05:05 PM.
Posted 21 October 2021 - 06:00 PM
Here, this will come with some manual set up on your end:
void LocalHelpStrings(){ if(!Link->PressL) return; int DMap[] = { 0, 0, 0 }; int Screens[] = { 0x00, 0x00, 0x00 }; int Strings[] = { 0, 0, 0 }; for(int i = 0; i <= SizeOfArray(DMap); i++){ if(Game->GetCurScreen() == Screens[i] && Game->GetCurDMap() == DMap[i]){ Screen->Message(Strings[i]); } } }
Put this somewhere in your script file, and add:
LocalHelpStrings();
To your global active loop somewhere.
The setup is as following:
When adding a new screen that you want to have a help string when you press the L button, you'll have to fill it into every array (just add more rows at the TOP if you need them.
DMap: Here you put in the DMap number the screen will be on, if the screen shows up on multiple DMaps and you want the same string, you'll need multiple entries (in all arrays)
Screen: The screen number, here you'll want the screen's hexadecimal number, this was the old standard in which they are displayed in. And it goes after the "0x", so if you're trying to use screen 4E, it would look like: 0x4E.
String: This would be the string ID you want to have played. The string editor in Zelda Quest should display the number on the left side, that's the one you want.
Here's an example of what a filled in version might look like:
Edited by Mani Kanina, 21 October 2021 - 06:11 PM.
Posted 21 October 2021 - 07:04 PM
Thanks a lot!
Posted 21 October 2021 - 07:13 PM
Np, let me know if there are any issues.
Posted 30 October 2021 - 11:18 AM
Hiya! I would like to use this script for my game too, however, what would I need to add to make the script check for a certain item before working?
For example, you'd need to currently have the 'Navi' item in your inventory to get hints from Navi.
Thanks! ! !
Posted 30 October 2021 - 02:02 PM
void LocalHelpStrings(){ if(!Link->PressL || !Link->Item[0]) return; int DMap[] = { 0, 0, 0 }; int Screens[] = { 0x00, 0x00, 0x00 }; int Strings[] = { 0, 0, 0 }; for(int i = 0; i <= SizeOfArray(DMap); i++){ if(Game->GetCurScreen() == Screens[i] && Game->GetCurDMap() == DMap[i]){ Screen->Message(Strings[i]); } } }
Posted 30 October 2021 - 04:19 PM
Ah! Awesome! Thank you so much!
0 members, 1 guests, 0 anonymous users