Jump to content

Photo

Screen Script, Enemies and Music Changer if Item ID

Screen Changer

  • Please log in to reply
21 replies to this topic

#1 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 10 December 2019 - 02:20 PM

I want Hyrule to get more dangerous, the more you gain to your inventory

I need a screen data script, where D0 is an Item ID that changes enemies, at screen init.
D1 and 2 are specific enemy numbers/ID on the screen, that change into another ID,

wich are veryfied by D3 and D5.
D6 is the MIDI  to change to.

Thank you, very much.


  • ShadowTiger likes this

#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 December 2019 - 09:03 AM

I want Hyrule to get more dangerous, the more you gain to your inventory

I need a screen data script, where D0 is an Item ID that changes enemies, at screen init.
D1 and 2 are specific enemy numbers/ID on the screen, that change into another ID,
wich are veryfied by D3 and D5.
D6 is the MIDI  to change to.

Thank you, very much.


Is this something that you'd run on every screen? Sounds very tedious to set up for all mapscreens in a quest. It'd probably be more logical to use dmap scripts for this, and to use an attribute of the enemy editor for the evolved form ID of each enemy.



#3 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 12 December 2019 - 09:28 AM

It's just for a few screens, which are very peaceful  at the beginnig (Lake Hylia), but should get more difficult later.
These screens don't use Dmap Midi, they got an own Music, which should Change to Dmap Midi later

The Enemies (just a few bees) shall be replaced by Tektites/Octorocks and Maybe add a Zora Enemy Flag



#4 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 13 December 2019 - 11:36 AM

It's just for a few screens, which are very peaceful  at the beginnig (Lake Hylia), but should get more difficult later.
These screens don't use Dmap Midi, they got an own Music, which should Change to Dmap Midi later

The Enemies (just a few bees) shall be replaced by Tektites/Octorocks and Maybe add a Zora Enemy Flag


I haven't tested this in action, but give it a try:

screendata script sd_digivolve
{
	const int SD_DIGIV_MAX = 20;
	void run(int iid, int nid1, 
		int nid2, int new_nid1, int new_nid2, int mid)
	{
		npc removeme[SD_DIGIV_MAX];
		unless(Link->Item[iid]) Quit();
		Waitframes(6);
		
		for(int q = Screen->NumNPCs(); q > 0; --q)
		{
			if ( q == SD_DIGIV_MAX ) break;
			npc oldguy = Screen->LoadNPC(q);
			if(oldguy->ID == nid1)
			{
				npc n = Screen->CreateNPC(new_nid1);
				n->X = oldguy->X;
				n->Y = oldguy->Y;
				removeme[q] = oldguy;
			}
			else if(oldguy->ID == nid2)
			{
				npc n = Screen->CreateNPC(new_nid2);
				n->X = oldguy->X;
				n->Y = oldguy->Y;
				removeme[q] = oldguy;
			}
		}
		for(int q = 0; q < SD_DIGIV_MAX; ++q)
		{
			if((<int>removeme[q]) && removeme[q]->isValid())
			{
				removeme[q]->Remove();
			}
		}
	}
}
			
D0: Required Item
D1: First original npc.
D2: Second original npc.
D3: First replacement npc.
D4: Second replacement npc.
D5: New MIDI

#5 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 14 December 2019 - 03:17 PM

THANKS!
You're all pretty amazing here.
This seems to be forum for REAL miracle workers!

It's exactly what I was looking for

#6 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 15 December 2019 - 10:45 AM

I haven't tested this in action, but give it a try:
 

screendata script sd_digivolve
{
	const int SD_DIGIV_MAX = 20;
	void run(int iid, int nid1, 
		int nid2, int new_nid1, int new_nid2, int mid)
	{
		npc removeme[SD_DIGIV_MAX];
		unless(Link->Item[iid]) Quit();
		Waitframes(6);
		
		for(int q = Screen->NumNPCs(); q > 0; --q)
		{
			if ( q == SD_DIGIV_MAX ) break;
			npc oldguy = Screen->LoadNPC(q);
			if(oldguy->ID == nid1)
			{
				npc n = Screen->CreateNPC(new_nid1);
				n->X = oldguy->X;
				n->Y = oldguy->Y;
				removeme[q] = oldguy;
			}
			else if(oldguy->ID == nid2)
			{
				npc n = Screen->CreateNPC(new_nid2);
				n->X = oldguy->X;
				n->Y = oldguy->Y;
				removeme[q] = oldguy;
			}
		}
		for(int q = 0; q < SD_DIGIV_MAX; ++q)
		{
			if((<int>removeme[q]) && removeme[q]->isValid())
			{
				removeme[q]->Remove();
			}
		}
	}
}
			
D0: Required Item
D1: First original npc.
D2: Second original npc.
D3: First replacement npc.
D4: Second replacement npc.
D5: New MIDI

 

Just tried the script.
I'm sorry to say, but it seems to do nothing.
No matter what I do
 



#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 25 December 2019 - 04:13 AM

Oh Zoria, why did you do it that way? You should modify 'Screen->Enemy[]' to change the enemies.

https://pastebin.com/nnkjRYuC

 

Untested, let me know if there are any issues. Make sure that "Run on Screen Init" is checked for the script, or it almost certainly won't work.



#8 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 25 December 2019 - 10:48 AM

Hey, Thanks
Gonna check it out now

I'll send a feedback, how it works

#9 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 25 December 2019 - 11:17 AM

This is amazing.
Short, simple Script that works great.
One last thing.
It's not including MIDI change function, as I've seen by now.
So is it possible to add a function like this?
Perhaps to verify by D7?
It would be fantastic if "0" = no change "1-x" = MIDI to change to and really great if "–1" would mean "use DMap MIDI"

Edited by Bagu, 25 December 2019 - 11:17 AM.


#10 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 25 December 2019 - 05:49 PM

Added a midi version ( https://pastebin.com/nnkjRYuC )



#11 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 25 December 2019 - 07:15 PM

Thanks, this is genius!
💚💚💚

#12 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 25 December 2019 - 09:32 PM

I hope I'm not annoying...
But there is still one thing.
The screens, I want to use it for, already use an own Screen Data MIDI.
so When I set D7 to "-1", it switches to the same. (seems I have to find a way, to reset this originaly screen data midi and change it to "use DMap Midi)

I tried to use it oppositly
(btw I specially use it for Sword item IDs - at Lake Hylia, bees turn into harder enemies and peaceful music should switch to regular Hyrule OW Theme when you got the white sword)

So I changed the original screen Data, to "use DMap Midi" and changed the screen enemies from bees into tektites.
Then I set the script D0 to Item ID 5 (Wooden Sword) and verified the "backward" Enemy and Musik replacent.
(Tektites -> Bees)
(Hyrule Theme -> Peaceful Music)
I use functions in item pickup string to completly remove wooden sword, when getting the white one.
This worked great.
As long, as I have the wooden sword, peacefully music plays and bees are flying around.
Without it (after getting the white one) there are tektites jumping and Hyrule theme is playing.

Last teardrop in my eye...
As long as I got the Wooden Sword (and the script is running), walking from one screen to next/neighbour screen (with same script - and Midi Number on D7) restarts music. (because of new run.
Don't know if there's a way to fix it.

Oh, yes
...perhaps it's something to do, with one error.
When I set the screen Script to "run at screen init" it starts the chosen, New MIDI but jumps directly to the DMap MIDI after first frame.

Edited by Bagu, 25 December 2019 - 11:25 PM.


#13 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 25 December 2019 - 11:58 PM

Because I don't need the the "if -1" variable on InitD7, I removed these lines, and tried just this.I hope it would fix the "error" on screen init (jumping to dmap MIDI, directly after starting chosen Midi:[list=1]
[*]screendata script ChangeEnemiesAndMidi

{

void run(int changeItem, int e1, int e2, int e3, int ne1, int ne2, int ne3, int midi)

{

unless(Hero->Item[changeItem]) Quit();

for(int q = 0; q < 10; ++q)

{

if(Screen->Enemy[q] == e1)

Screen->Enemy[q] = ne1;

else if(Screen->Enemy[q] == e2)

Screen->Enemy[q] = ne2;

else if(Screen->Enemy[q] == e3)

Screen->Enemy[q] = ne3;

}

Audio->PlayMIDI(midi);

}

}

}


But that didn't change anything.

Edited by Bagu, 26 December 2019 - 12:56 AM.


#14 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 26 December 2019 - 10:02 AM

So wait, it wasn't playing the dmap midi when you set it to -1?



#15 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 26 December 2019 - 10:22 AM

Ah, so writing Screen->Enemies[] works on screen init now? IIRC, it did not in the past, and you were forced to reload the screen.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users