Jump to content

Photo

Making Wood Sword Only Effective Against Ganon


  • Please log in to reply
5 replies to this topic

#1 Lynel Richie

Lynel Richie

    Recipient of Ways

  • Members

Posted 29 May 2020 - 06:28 PM

Let's say you can have Link keep all of his swords after upgrading to better ones (the possibility of that is another topic). I want to make it so you can only beat Ganon with the wooden sword. It seems like most the defensive enemy attributes are disabled for him. So, is there to do this?



#2 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 29 May 2020 - 06:45 PM

You could disable all other swords on the DMap the ganon room is located in (which you could make it's own DMap). Maybe not the best solution, but it's *a* solution.

I don't really see how this is justified in the gameplay though..., I assume you could just achieve similar effect simply by cranking up ganon's HP instead, it'd feel less arbitrary.


  • Lightwulf and Lynel Richie like this

#3 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 29 May 2020 - 07:39 PM

If you made all swords selectable on the subscreen and had only the wooden one hurt him as part of a puzzle, that could be kinda funny. As Mani Kanina said, you probably shouldn't keep his HP default if you did this. I could write a script that does this it if you'd like.


  • Lightwulf likes this

#4 Lynel Richie

Lynel Richie

    Recipient of Ways

  • Members

Posted 29 May 2020 - 07:55 PM

If you made all swords selectable on the subscreen and had only the wooden one hurt him as part of a puzzle, that could be kinda funny. As Mani Kanina said, you probably shouldn't keep his HP default if you did this. I could write a script that does this it if you'd like.

 

I think I might take you up on that. If it's not too much trouble of course. I would do it myself but I don't think it will anything I will learn how to do anytime soon.


  • Lightwulf likes this

#5 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 30 May 2020 - 03:27 AM

I think I might take you up on that. If it's not too much trouble of course. I would do it myself but I don't think it will anything I will learn how to do anytime soon.

Okay here's an FFC script that should do the trick. My approach is a bit hacky since ZScript doesn't get along with the NES Ganon enemy or sword weapon type. Place the FFC on the screen and set D0 to the damage of your wooden sword. That's how it'll know when you're using it.

ffc script WoodSwordGanon{
	void run(int woodSwordDamage){
		while(true){
			//Find Ganon onscreen
			npc ganon = LoadNPCOf(NPC_GANON);
			if(ganon->isValid()){
				//Assume Ganon is invincible
				ganon->CollDetection = false;
				//Find a sword weapon onscreen
				lweapon sword = LoadLWeaponOf(LW_SWORD);
				if(sword->isValid()){
					//If the sword is wooden, make Ganon vulnerable
					if(sword->Damage==woodSwordDamage)
						ganon->CollDetection = true;
				}
				else{
					//If there wasn't a sword weapon, find an arrow
					lweapon arrow = LoadLWeaponOf(LW_ARROW);
					if(arrow->isValid()){
						//As long as there's an arrow onscreen and no sword, make him vulnerable for the last hit
						ganon->CollDetection = true;
					}
				}
			}
			Waitframe();
		}
	}
}

  • ShadowTiger and Lightwulf like this

#6 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 30 May 2020 - 06:51 AM

Normally this is where I would chime in with an "Actually, it's really easy if you just do THIS"

...But, we're talking about Ganon. Ganon's code is.... well... I'd rather jump into an active volcano than deal with Ganon's code. So, if you've got something that works at all, then that's an accomplishment. I'm damn well surprised that Ganon respects CollDetection as a variable, and doesn't just arbitrarily ignore that because it feels like such.

 

The only peeve I have; you are loading Ganon every frame. You could do `while(ganon->isValid())` instead of `if()`, so that it doesn't need to load him every time; but that's just optimization.


  • Mani Kanina, Lightwulf, Demonlink and 1 other like this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users