Question about the map
#1
Posted 11 May 2013 - 10:38 AM
The issue I'm having is that the space bar map is either activated or not by default in the dmap. Is there a way to disable it, yet enable it once the player has the map item? With a script, maybe?
#2
Posted 11 May 2013 - 10:49 AM
But it's extremely easy to do with scripting:
import "std.zh"
const int customMapItem = 123; //set this to the item ID of your map item
global script active{
void run(){
while(true){
if ( !Link->Item[customMapItem] ) {
Link->InputMap = false; Link->PressMap = false;
}
Waitframe();
}
}
}
(this script disables the map button for the entire game until Link has the item. it is not scripted to work for individual dungeons and places yet, lol)
Edit: by scripting, you could even display a message that says that you're in need of a map, when you press the map button without having the map. Just an idea..
If you're going to do it by DMap warping, then be sure to use Screen State Carryovers, to turn the entrance combo of the dungeon on the overworld into another warp (B for example) that warps you to the second DMap.
Edited by Avataro, 11 May 2013 - 10:57 AM.
- Bagu likes this
#3
Posted 11 May 2013 - 10:59 AM
Perhaps it would be possible to have a different map item for each dungeon, and edit the script so it tells ZC:
- If Link has map item X, and is currently in dmap X -> enable the spacebar map
- Otherwise -> disable it
?
#4
Posted 11 May 2013 - 11:17 AM
if (Game->LItems[Game->GetCurLevel()] & LI_MAP) {
Of course, this makes you need a map for the overworld too.
Edited by grayswandir, 11 May 2013 - 11:19 AM.
#5
Posted 11 May 2013 - 11:35 AM
if (Game->LItems[Game->GetCurLevel()] & LI_MAP) {
Link->InputMap = true; Link->PressMap = true;
}
else{
Link->InputMap = false; Link->PressMap = false;
}
but no luck, the map works no matter what.
#6
Posted 11 May 2013 - 11:45 AM
if (!(Game->LItems[Game->GetCurLevel()] & LI_MAP)) {
Link->InputMap = false; Link->PressMap = false;}
Setting them both to true every frame means it's acting like you're always holding down the map button.
Edit: I confirmed it working:
import "std.zh"
global script Active {
void run() {
while (true) {
if (!(Game->LItems[Game->GetCurLevel()] & LI_MAP)) {
Link->InputMap = false;
Link->PressMap = false;}
Waitframe();}}}
Edited by grayswandir, 11 May 2013 - 11:48 AM.
#7
Posted 11 May 2013 - 11:56 AM
#9
Posted 11 May 2013 - 12:18 PM
Here is my full global script, if that helps:
global script active
{
void run()
{
//Autoghost init
StartClock();
InitializeGhostZHData();
while(true)
{
//Autoghost loop
UpdateGhostZHData();
UpdateEWeapons();
UpdateClock();
CleanUpGhostFFCs();
Waitdraw();
DrawGhostFFCs();
AutoGhost();
//Bomb ammo fix
if(Game->Counter[CR_BOMBS]>0 && !Link->Item[I_BOMB]) {Link->Item[I_BOMB]=true;}
//Platform script
NesMovementFix();
MovingPlatforms();
//Map
if (!(Game->LItems[Game->GetCurLevel()] & LI_MAP)) {
Link->InputMap = false;
Link->PressMap = false;
}
Waitframe();
}
}
}
#10
Posted 11 May 2013 - 12:24 PM
Other than that, I really don't know.
Edited by grayswandir, 11 May 2013 - 12:25 PM.
#11
Posted 11 May 2013 - 12:34 PM
Here it is again, except I have commented the platform functions so it can compile:
global script active
{
void run()
{
//Autoghost init
StartClock();
InitializeGhostZHData();
while(true)
{
//Autoghost loop
UpdateGhostZHData();
UpdateEWeapons();
UpdateClock();
CleanUpGhostFFCs();
Waitdraw();
DrawGhostFFCs();
AutoGhost();
//Bomb ammo fix
if(Game->Counter[CR_BOMBS]>0 && !Link->Item[I_BOMB]) {Link->Item[I_BOMB]=true;}
//Platform script
// NesMovementFix();
// MovingPlatforms();
//Map
if (!(Game->LItems[Game->GetCurLevel()] & LI_MAP)) {
Link->InputMap = false;
Link->PressMap = false;
}
Waitframe();
}
}
}
#12
Posted 11 May 2013 - 12:40 PM
#13
Posted 11 May 2013 - 12:47 PM
#14
Posted 11 May 2013 - 01:34 PM
TraceB(Game->LItems[Game->GetCurLevel()] & LI_MAP);in there and seeing if the log keeps printing true.
#15
Posted 12 May 2013 - 07:33 AM
I have identified the culprit: the Waitdraw(); command. I don't know why it's doing that. But it's needed for the ghosted enemies to work.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users

