Jump to content

Photo

shock sprite problem

shock sprite script ghost

  • Please log in to reply
10 replies to this topic

#1 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 15 September 2015 - 08:58 PM

People, I don't know what I did wrong, but can someone tell me why the shock sprite (BUZZ_ATTR_SHOCK_SPRITE) for the Buzz Blob script is appearing under Link instead of over him? The same problem is happening with the Bari & Biri script :(

 

I'll post the scripts here, of course, but maybe someone can solve this problem without seeing the scripts.

 

shockspriteproblem.png

 



#2 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 15 September 2015 - 09:29 PM

Link should be invisible while the shock happens. I think you probably have another (global?) script setting Link->Invisible = false.



#3 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 15 September 2015 - 10:01 PM

I did a search using the notepad++ and the result was this:
 

E:\zc-2-50-1-rc4-win\quests\scripts\[ENEMY] bari and biri.z (4 hits)
Line 151:                         oldLinkInvis=Link->Invisible;
Line 157:                         Link->Invisible=true;
Line 182:                                 Link->Invisible=oldLinkInvis;
Line 186:                         Link->Invisible=oldLinkInvis;

 

 

E:\zc-2-50-1-rc4-win\quests\scripts\[ENEMY] buzz blob.z (4 hits)
Line 160:                 oldLinkInvis=Link->Invisible;
Line 170:                 Link->Invisible=true;
Line 197:                     Link->Invisible=oldLinkInvis;
Line 201:                 Link->Invisible=oldLinkInvis;

 

 

E:\zc-2-50-1-rc4-win\quests\scripts\[FFC] GB power bracelet.z (2 hits)
Line 72:                         if(Link->Invisible || (Link->Action != LA_NONE && Link->Action != LA_WALKING)) break; // break if falling in pit or water!
Line 75:                     if(Link->Invisible || (Link->Action != LA_NONE && Link->Action != LA_WALKING)) break; // break if falling in pit or water!

 

 

E:\zc-2-50-1-rc4-win\quests\scripts\[FFC] sideview swimming2.z (2 hits)
Line 20:         Link->Invisible = true;
Line 27:     else Link->Invisible = false;  // if other scripts are making Link invisible this will negate that.

 

My test file using only the Buzz Blob script is normal, everything working. So, the problem is not with the ghost scripts, but with something in my global script/functions for the realm of spirits quest... and I don't know what it is...

 

hey, maybe this?
Line 27:     else Link->Invisible = false;  // if other scripts are making Link invisible this will negate that.

 

 

EDITED:

Thanks, Moscowmodder! I found the problem and is exactly the line above from the Sideview Swimming script.
But not specifically a script problem. There are 2 lines

ScrollFix();                                
Sideview_Swim();

 

that I added in the wrong place in the global script  >____<
Is working very well now. Thanks for the tip, dude!

 

 

 

 

 


Edited by accela2me, 15 September 2015 - 10:06 PM.


#4 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 15 September 2015 - 10:24 PM

Glad you figured it out! Those inter-script conflicts are the worst.



#5 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 16 September 2015 - 12:24 PM

Moscowmodder, I made a mistake, dude. The problem continues (the script worked yesterday because I tested without the line Sideview_Swim(); ... I forgot to save the file with this line back to the global script).

And really the conflict is what Justin said it could happen:

else Link->Invisible = false;  // if other scripts are making Link invisible this will negate that. you will want to add more conditions here in that case.

 

void Sideview_Swim(){
    if(underwater){
        Link->Invisible = true;

        if (Link->Dir == DIR_UP || Link->Dir == DIR_LEFT)
        Screen->FastCombo(4, drawX, drawY, SWIM_LEFT_COMBO, SWIM_COMBO_CSET, OP_OPAQUE);
        else
        Screen->FastCombo(4, drawX, drawY, SWIM_RIGHT_COMBO, SWIM_COMBO_CSET, OP_OPAQUE);
    }
    else Link->Invisible = false;  // if other scripts are making Link invisible this will negate that. you will want to add more conditions here in that case.
}

 

Here a test file with the Buzz Blob and Sideview Swimming scripts:
https://dl.dropboxus...ew swimming.rar



#6 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 16 September 2015 - 05:10 PM

There are two ways to fix this:

 

1. Have the swimming script tell when you go from underwater to not underwater and remove invisibility then (easy?).

2. Make a global variable of bitwise flags for things that can make Link invisible, then & and | the flags on and off of that instead of directly setting Link invisible. At the end of the global loop, make Link invisible if this variable is not 0 (hard).

 

I recommend #1 if you can manage it.



#7 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 16 September 2015 - 06:14 PM

Well, I choose the 1st option, but I have no idea how to do that :/



#8 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 16 September 2015 - 06:32 PM

Well, you could change "underwater" to a global variable. When underwater is currently true and is going to be set to false, make Link->Invisible false.



#9 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 17 September 2015 - 07:16 AM

isn't this line
bool underwater = false;

a global variable?



#10 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 17 September 2015 - 06:57 PM

I can't see your entire script, but if it's defined outside of a function or script then yes it is.

 

Look for a line of code that can set underwater to false, and expand that to make Link not invisible when underwater is true and the condition is false.



#11 accela2me

accela2me

    Illustrious

  • Members
  • Real Name:Juliano
  • Location:Minas Gerais, Brazil

Posted 19 September 2015 - 01:01 PM

I didn't understand why the Link->Invisible = false; can't be limited only in the screens with the Sideview Swimming FFC :/





Also tagged with one or more of these keywords: shock, sprite, script, ghost

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users