Jump to content

Photo

Veil Stones Script? (Dungeon Gimmick)


  • Please log in to reply
19 replies to this topic

#1 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 26 August 2021 - 07:04 AM

Hey guys, I have an idea for a dungeon gimmick for my Shadow dungeon in Melody of the Demon King, and I was hoping to get some help getting it figured out.

 

This quest has been updated to 2.55.

 

I have decent scripting knowledge, but I am a full time college study and about to start working, so having help to set this up would be greatly appreciated.

I'll put this in a spoiler tag in case someone reading this topic would rather play the quest and be surprised when they reach it.

 

 

Spoiler

 

Maybe someone can help me with setting this up. I could do pretty much all of this scriptless, but it would be much smoother with a script.


  • Bagu likes this

#2 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

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

Posted 26 August 2021 - 07:58 AM

Hmm, interesting idea. I suppose the scriptless solution you're talking about is simply teleporting the player to copied map with different enemies & combos.

But doing this with scripts would indeed allow you do interesting real-time things, such as push a block and it will still be there when you switch back to living form.

 

As for the script, I think you want it to depend on the player having an item or not, but working with a global variable (int is_spirit_form = false/true, f.e.) could work just fine. However with the item you can immediately apply Link Tile Modifiers as well & easily display something in the subscreen (unless you have a scripted subscreen).

I also know these things can be achieved:

2. on each screen loop through combos, pick out the ones with a certain flag or type, make them blank and draw it on layer 4 instead
3. the same trick, but we change the combo data instead
4. this is feasible because we can loop through the enemies on screen and change their properties based on the player being in spirit form or not

As for point 1, making the player transparent... I'm not sure if that is possible


Here are some scripting examples:
 

// Point 2/3 changing combos
// Loop through combos (there are 176 on each screen)
for (int i = 0; i < 176; i++) {
	int cFlag = Screen->ComboF[i]; // combo flag
	int comboIFlag = Screen->ComboI[i]; // inherit flag
	int cData = Screen->ComboD[i]; // combo number
	int cType = Screen->ComboT[i]; // combo type
}

// Point 4 <- changing enemy data
int totalNPCs = Screen->NumNPCs();

// Loop through all enemies
for(int i = 1; i <= totalNPCs; i++) {
	npc SomeNPC = Screen->LoadNPC(i);
	
	if(SomeNPC->ID == THE_ID_YOU_WANT_TO_CHANGE) {
		// Change properties here
	}
}

Edited by Twilight Knight, 26 August 2021 - 08:05 AM.

  • Architect Abdiel likes this

#3 Bagu

Bagu

    Fandomizer

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

Posted 26 August 2021 - 08:19 AM

Making the player transperent might be possible by using tile modification, to make  him invisible, and then replacing the player sprite with a transperent ffc.
....but there's a long list of, things to pay attention, to realize that


Edited by Bagu, 26 August 2021 - 08:19 AM.

  • Twilight Knight and Architect Abdiel like this

#4 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 26 August 2021 - 09:17 AM

 

Hmm, interesting idea. I suppose the scriptless solution you're talking about is simply teleporting the player to copied map with different enemies & combos.

But doing this with scripts would indeed allow you do interesting real-time things, such as push a block and it will still be there when you switch back to living form.

 

As for the script, I think you want it to depend on the player having an item or not, but working with a global variable (int is_spirit_form = false/true, f.e.) could work just fine. However with the item you can immediately apply Link Tile Modifiers as well & easily display something in the subscreen (unless you have a scripted subscreen).

I also know these things can be achieved:

2. on each screen loop through combos, pick out the ones with a certain flag or type, make them blank and draw it on layer 4 instead
3. the same trick, but we change the combo data instead
4. this is feasible because we can loop through the enemies on screen and change their properties based on the player being in spirit form or not

As for point 1, making the player transparent... I'm not sure if that is possible


Here are some scripting examples:
 

// Point 2/3 changing combos
// Loop through combos (there are 176 on each screen)
for (int i = 0; i < 176; i++) {
	int cFlag = Screen->ComboF[i]; // combo flag
	int comboIFlag = Screen->ComboI[i]; // inherit flag
	int cData = Screen->ComboD[i]; // combo number
	int cType = Screen->ComboT[i]; // combo type
}

// Point 4 <- changing enemy data
int totalNPCs = Screen->NumNPCs();

// Loop through all enemies
for(int i = 1; i <= totalNPCs; i++) {
	npc SomeNPC = Screen->LoadNPC(i);
	
	if(SomeNPC->ID == THE_ID_YOU_WANT_TO_CHANGE) {
		// Change properties here
	}
}

 

Thanks for the help. I will have to test out these scripts and see what I can figure out about setting it up.

 

I assume that the change properties here part is a part I have to figure out myself. xD
Ideally I could just switch out one enemy with another. I'd have to do some research to see how possible that is in 2.53.11.

 

Making the player transperent might be possible by using tile modification, to make  him invisible, and then replacing the player sprite with a transperent ffc.
....but there's a long list of, things to pay attention, to realize that

 

 

I suppose one thing I could probably do is give the player an item that changes the player sprite CSet and then take it away any time Spirit Form isn't active. I could actually use that for checking whether a screen should be in its spirit form.


  • Bagu likes this

#5 Bagu

Bagu

    Fandomizer

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

Posted 26 August 2021 - 09:56 AM

I use a simialar system, in my DayNight functions, to "pseudo-tint" the player sprite pallete at night.
...to avoid glowing color effects.


It's also very intresting that we both are making astral-form scripts.
...you are switching the player to spirit form and I let my "Little Hero" enter the spectral realm.

 


Edited by Bagu, 26 August 2021 - 09:57 AM.

  • Twilight Knight likes this

#6 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 26 August 2021 - 09:56 AM

As far as I know, you cannot literally make the player transparent, but I know you can, like Bagu said, make him invisible and position a combo every frame where the player ought to be. This is how I did sideview swimming in some of my quests.


  • Twilight Knight, Mani Kanina and Bagu like this

#7 Bagu

Bagu

    Fandomizer

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

Posted 26 August 2021 - 09:58 AM

Simialar things are done in the "epona script"
...you just need proper combo settings for each Link Action


Edited by Bagu, 26 August 2021 - 09:59 AM.


#8 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

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

Posted 26 August 2021 - 10:10 AM

I assume that the change properties here part is a part I have to figure out myself. xD

Ideally I could just switch out one enemy with another. I'd have to do some research to see how possible that is in 2.53.11

Hehe, for now I don't know which properties you'd need to change. But there is some documentation around for what you can do with the npc pointer and surely we'll help you if there is a property you're having trouble with.
Setting defenses is pretty horrible though.

But interesting idea you propose, switch out one enemy with another. What if you use a FFC script to place the enemies in both living & spirit form?  The arguments of the script could be the enemy IDs, and you could change the IDs in the script if Link is in spirit form. Then you can control exactly which enemies spawn on the screen, but it's a hassle to set up the FFC on every screen I'd imagine. Also wouldn't work if changing to spirit/living form when already on a screen.


Regarding the player sprint transparency, maybe you're better off compromising by not doing that, but rather try to make the player look ghostly via a link tile modifier.


  • Bagu likes this

#9 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 26 August 2021 - 11:35 AM

I use a simialar system, in my DayNight functions, to "pseudo-tint" the player sprite pallete at night.
...to avoid glowing color effects.


It's also very intresting that we both are making astral-form scripts.
...you are switching the player to spirit form and I let my "Little Hero" enter the spectral realm.
 

It is interesting. I really was just trying to think of gimmicks that really fit the theme of the dungeons they are in.

And I think the idea that you can switch to a Spirit form really does cover that well.

 

I was inspired by Supernatural.

 

 

As far as I know, you cannot literally make the player transparent, but I know you can, like Bagu said, make him invisible and position a combo every frame where the player ought to be. This is how I did sideview swimming in some of my quests.

That's a very interesting way to have gone about sideview swimming. I know I've wanted to do a quest with sideview swimming, but I'm just waiting until it's part of the program soon. At this point, I think I am just going to give my player an item that changes the LTM.

 

 

Simialar things are done in the "epona script"
...you just need proper combo settings for each Link Action

Epona may be something I am interested in a different quest. I have always been interested in remaking OoT.

 

 

 

Hehe, for now I don't know which properties you'd need to change. But there is some documentation around for what you can do with the npc pointer and surely we'll help you if there is a property you're having trouble with.
Setting defenses is pretty horrible though.

But interesting idea you propose, switch out one enemy with another. What if you use a FFC script to place the enemies in both living & spirit form?  The arguments of the script could be the enemy IDs, and you could change the IDs in the script if Link is in spirit form. Then you can control exactly which enemies spawn on the screen, but it's a hassle to set up the FFC on every screen I'd imagine. Also wouldn't work if changing to spirit/living form when already on a screen.


Regarding the player sprint transparency, maybe you're better off compromising by not doing that, but rather try to make the player look ghostly via a link tile modifier.

I was reading the script, and I am a little confused on what part of the script changes layers and which part switches combos.

 

I think switching enemies would be the easiest way to do it. I just wonder what I would do with things like special items that may appear upon killing enemies or something.

 

I think I am just going to make a ring for the form.


  • Bagu likes this

#10 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 26 August 2021 - 12:39 PM

Immediate problem, moving combos on layers. You can't make temp-edits to layers in 2.53, so the changes would need to be permanent until quest reload.... or until the script somehow reverts them, which creates a crapton of extra work. 2.55 makes a lot of this far easier.... best of luck.


  • Bagu likes this

#11 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 26 August 2021 - 01:31 PM

Immediate problem, moving combos on layers. You can't make temp-edits to layers in 2.53, so the changes would need to be permanent until quest reload.... or until the script somehow reverts them, which creates a crapton of extra work. 2.55 makes a lot of this far easier.... best of luck.

Yeah, it really makes me want to move the quest to 2.55, but I've already done so much work in 2.53. I really wish it wasn't in 2.53. Maybe I can find a way to move it over to 2.55, but it seems like it'll be pretty tough.

 

I guess I could always do the duplicate map solution.



#12 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 26 August 2021 - 02:30 PM

I'm confused why people are acting like this is such a hard thing to do. It'd be trivial to do, even in 2.53.

 

1. Transparent player is easy. Set Link->Invisible to true, then use Screen->DrawTile to draw Link->Tile to Link's position transparently every frame. Easy peasy.

2. While layer changes are permanent until reverted or the quest is saved and quit, yes, there's an easy workaround here. Define an array of combos for layer 1. If state is alive, scan the combos on screen and if you find comboID + 1, set it to comboID. If state is dead, search for comboID, increase by 1. Do the opposite for layer 4. That way, when you enter the dead state, the combos on layer 1 all shift 1 up to an empty combo, while the combos on layer 4 all shift one up from an empty to non-empty combo, effectively swapping the combo's layer.

3. This is basically the same thing as my solution to 2.

4. If using ghosted enemies, it's as simple as having their script check the state and set their draw effects and CollDetection accordingly. If not ghosted, you'll need the script to cycle through enemies and set those for them, but still shouldn't be very challenging.


  • Architect Abdiel and Bagu like this

#13 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 26 August 2021 - 04:46 PM

Yeah, it really makes me want to move the quest to 2.55, but I've already done so much work in 2.53. I really wish it wasn't in 2.53. Maybe I can find a way to move it over to 2.55, but it seems like it'll be pretty tough.

 

I guess I could always do the duplicate map solution.

"Maybe I can find a way to move it over to 2.55"

I mean, you launch 2.55, and you open the quest file. Everything that works in 2.53 should still work in 2.55 (and if it doesn't, that's a bug to report)

 

I'm confused why people are acting like this is such a hard thing to do. It'd be trivial to do, even in 2.53.

 

1. Transparent player is easy. Set Link->Invisible to true, then use Screen->DrawTile to draw Link->Tile to Link's position transparently every frame. Easy peasy.

2. While layer changes are permanent until reverted or the quest is saved and quit, yes, there's an easy workaround here. Define an array of combos for layer 1. If state is alive, scan the combos on screen and if you find comboID + 1, set it to comboID. If state is dead, search for comboID, increase by 1. Do the opposite for layer 4. That way, when you enter the dead state, the combos on layer 1 all shift 1 up to an empty combo, while the combos on layer 4 all shift one up from an empty to non-empty combo, effectively swapping the combo's layer.

3. This is basically the same thing as my solution to 2.

4. If using ghosted enemies, it's as simple as having their script check the state and set their draw effects and CollDetection accordingly. If not ghosted, you'll need the script to cycle through enemies and set those for them, but still shouldn't be very challenging.

1. Aye, true. 2.55 could use ScriptTile instead of Invisible, but much the same effort and effect.

2. Or you can do none of that work and just make the layer changes temporary

3. ^

4. Aye, ghosted enemies or npc scripts would be the easiest way to handle this. For non-ghosted enemies, an NPC script to make it so you don't need to cycle through enemies would be easily managable, and could be done in as little as 10ish lines depending on what changes you need to make.

 

So, aye, it's doable in 2.53; it's just far easier in 2.55. And when one becomes accustomed to 2.55's tools, going back to writing stuff for 2.53 is actively painful (which is why I don't write 2.53 scripts anymore)


  • Twilight Knight and Bagu like this

#14 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 26 August 2021 - 05:06 PM

I think I'll at least TRY to get the quest working in 2.55. The main deciding factor being that the pits in my quest have become wonky in testing. I've just been concerned cause I am using the Vintage Dreams Tileset, which hasn't been updated for 2.55. But I guess, if I have any issues, I'll just have to.... report and fix them.

 

I'm not exactly using many of the scripts as it is.


  • Twilight Knight and Bagu like this

#15 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 26 August 2021 - 05:33 PM

I think I'll at least TRY to get the quest working in 2.55. The main deciding factor being that the pits in my quest have become wonky in testing. I've just been concerned cause I am using the Vintage Dreams Tileset, which hasn't been updated for 2.55. But I guess, if I have any issues, I'll just have to.... report and fix them.

 

I'm not exactly using many of the scripts as it is.

Oh god are you using the built-in VD scripts?  :shiver: (If they have a compile error, chances are you don't have the latest version with the fixes.... it had multiple issues with compiling in 2.55, for things that.... should not have ever compiled in 2.53, as they were complete nonsense and were in fact errors that 2.53 somehow didn't catch; just let me know and I can help)

 

As for pits, you can probably swap over to the engine ones for 2.55 easily enough, just by editing your pit combos to the right type and setting up their settings.


  • Twilight Knight and Bagu like this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users