Jump to content

Photo

[2.55] boss message strings


  • Please log in to reply
1 reply to this topic

#1 Jenny

Jenny

    Hero of Time

  • Members
  • Real Name:Jennette
  • Pronouns:She / Her

Posted 21 April 2023 - 07:36 PM

Basically, a script that would play a string if any enemies are present on the screen. It would then play a second string once when all enemies are defeated.


  • Twilight Knight likes this

#2 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 22 April 2023 - 06:08 AM

I've put everything you need to know in the comments in the script, here you go:

ffc script EnemiesMessages
{
	void run(
		int entryString,	// Friendly greeting string
		int victoryString,	// String to play after slaughtering the innocent enemies
		int delay,		// Increase the delay to have the entryString appear later
		int noRepeat,		// Set to more than 1 to never show the strings again after defeating the enemy
		int screenVar		// Only set this to anything other than 0 if there are conflicting scripts using screen variables
	) {
		if (noRepeat && Screen->D[screenVar]) return;
		
		// Enemies spawn after 3 frames
		// Increase the delay to have the entryString appear later
		if (!delay) delay = 3;
		
		// Need to wait a few frames before enemies have spawned
		while (delay) {
			delay--;
			Waitframe();
		}

		int totalEnemies = Screen->NumNPCs();
		
		// No enemies, return so the messages won't be shown
		if (!totalEnemies) return;
		
		Screen->Message(entryString);
		
		// Wait until all enemies have been smashed to pieces
		while (Screen->NumNPCs()) {
			Waitframe();
		}
		
		Screen->Message(victoryString);
		
		// Set the screen var so the message won't be shown again (if noRepeat enabled that is)
		if (noRepeat) {
			Screen->D[screenVar] = 1;
		}
	}
}

I could potentially also change it so the entryString plays only once


  • Jenny likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users