Jump to content

Photo

Making Enemies Appear over Layer Three


  • Please log in to reply
5 replies to this topic

#1 Valerie

Valerie

    Illustrious

  • Members
  • Real Name:Valerie
  • Location:K-Town

Posted 25 June 2021 - 05:44 PM

I found a script in this topic...
https://www.purezc.n...showtopic=62659

I used this script for Pol's Voices....
ffc script Layer3Enemy {
	void run(int enemyID) {
                bool floating = true;
		npc enemy;
		while (floating) {
			for (int i = 1; i <= Screen->NumNPCs(); i++)
			{
				enemy = Screen->LoadNPC(i);
				if (enemy->ID == enemyID)
				{
					DrawToLayer(enemy, 3, OP_OPAQUE);
				}
			}
			Waitframe();
		}
	}
}
but the problem is the Pol's voices show up as a "double image" two stacked on top of each other, (you can see them overlapping), also the spawn puff animation sometimes isn't showing up correctly.

Basically I want the pol's voice in this pic to jump over the statue on layer 3 while Link can still walk under it. I want the Pol's Voice to behave normally otherwise.
51265938157_ee76df377c_o.png

Edited by Valerie, 25 June 2021 - 05:54 PM.


#2 Valerie

Valerie

    Illustrious

  • Members
  • Real Name:Valerie
  • Location:K-Town

Posted 26 June 2021 - 02:53 PM

I set the enemies to invisible on that screen to get rid of the double image problem, and I modified the code a bit, and I also edited the Pol's Voice settings, but they don't flash when hit. Also I doubt I'm doing things in a very good way, I know very little about scripting, but somehow managed to fix it a bit... Also I'm using 2.50.2 for Linux. If anyone can write a better script I'd appreciate it.
ffc script Layer3Enemy {
	void run(int enemyID) {
                bool floating = true; 
            Waitframes(14);  
		npc enemy;
		while (floating) {
			for (int i = 1; i NumNPCs(); i++)
			{
			
				enemy = Screen->LoadNPC(i);
				if (enemy->ID == enemyID)
				{
					DrawToLayer(enemy, 3, OP_OPAQUE);
				}
			}
			Waitframe();
		}
	}
}

Edited by Valerie, 26 June 2021 - 03:52 PM.


#3 bigjoe

bigjoe

    Apprentice

  • Members

Posted 26 June 2021 - 04:53 PM

There is an internal function called Waitdraw(); that waits until after the screen/enemies/etc are drawn to continue. I believe the positioning of this function might fix the problem.



#4 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 26 June 2021 - 08:11 PM

There is an internal function called Waitdraw(); that waits until after the screen/enemies/etc are drawn to continue. I believe the positioning of this function might fix the problem.

Waitdraw cannot be used in ffc scripts until version 2.55, so cannot be used here. It would be correct to use it here, but that simply did not work before 2.55.

I believe you want to make the actual enemy invisible ('enemy->Invisible = true') to make this function in 2.50.2.



#5 Valerie

Valerie

    Illustrious

  • Members
  • Real Name:Valerie
  • Location:K-Town

Posted 26 June 2021 - 08:16 PM

There is an internal function called Waitdraw(); that waits until after the screen/enemies/etc are drawn to continue. I believe the positioning of this function might fix the problem.


I didn't really understand what I was doing, I just took a script I found and was messing around with it for a long time, just guessing things, I got so many errors. I really doubt I'm going to be able to figure this out, and the things that I did get kinda working just didn't seem to be done in a very good way. I did get most of it kinda working except for them flashing when hit.

Edited by Valerie, 26 June 2021 - 08:18 PM.


#6 Valerie

Valerie

    Illustrious

  • Members
  • Real Name:Valerie
  • Location:K-Town

Posted 27 June 2021 - 03:32 PM

Thanks to everybody who tried to help (this includes anybody who might have tried and not posted), but I decided to just redraw the screen so I don't need layers. Also this is for my 1st quest remake/ BS tileset update and I don't want to make it too complicated for others to use.

Edited by Valerie, 27 June 2021 - 03:33 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users