Jump to content

Photo

One-Hit Obliterator


  • Please log in to reply
6 replies to this topic

#1 idontknow8

idontknow8

    Senior

  • Members

Posted 10 January 2018 - 02:51 AM

I'm wondering how one might script this - I'm not necessarily asking for someone to do it for me but asking how to go about it (hence why it's not in the request topic).

 

In case you don't already know, this is a new item in the second DLC pack for Breath of the Wild that looks kinda like a Trident and it keeps Link's health at a quarter of a heart so that any single one hit will kill him instantly but he also will kill all enemies in one hit.

 

I'm pretty sure I can write a few lines in the global script that check to see if such item is selected in the Item slot and if so, set Link's Heath to a quarter heart and then set this item's damage to the max (999?).  The problem is how do I prevent Link from picking up any hearts/fairies or using potions?  Will setting his health to 1/4 heart every frame work? (so even after gaining health it'll go right back down anyway).

 

Will this work and do you think it's even worth scripting???

 

EDIT:  Oh, the other major piece to script is that it has a cool-down, where after only two consecutive uses, the weapon no longer does insta-kill damage (you can still continue to use it as a sword but with minimal damage).  Not sure if this should be true if scripted in ZQuest too or not but if so, not sure how to go about doing so.


Edited by idontknow8, 10 January 2018 - 02:54 AM.


#2 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 10 January 2018 - 07:05 AM

Setting Link's health to 1 every frame will work.



#3 Alucard648

Alucard648

    Wizard

  • Members
  • Location:castle Dracula

Posted 10 January 2018 - 08:31 AM

Setting Link's health to 1 every frame will work.

And don`t forget to do this only if Link`s HP > 1.


  • ShadowTiger and Evan20000 like this

#4 idontknow8

idontknow8

    Senior

  • Members

Posted 10 January 2018 - 09:58 PM

Hmm...Ok...now I got it to always set Link's heart to a quarter (1HP). I also made it so it drops Link's magic down to 0 so he can't cast Nayru's Love to protect himself (evil I know, but that kind of defeats the purpose of dropping his health).  Now the only thing I can't figure how is how to change the sword from a fully-powered, glowing sword that does instant-kill damage to all enemies, down to a weak level 1 sword after x number of uses and then after awhile it charges back up again.  In BotW it was only two consecutive uses and then about 5 seconds to charge.  I would like to be more like 3 to 5 uses and and then about 5 or 6 seconds to charge.  Can't figure this part out though.  Waitframes won't work in the global script (as far as I know) because that will also prolong all other scripts in the global part.  Thoughts???



#5 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 11 January 2018 - 01:51 AM

What you'd wanna do is make a global timer and counter, let's just call them G_OBLITERATOR_USES_REMAINING and G_OBLITERATOR_TIMER. Set the timer to -1 at the start. Every time you use the item, decrease G_OBLITERATOR_USES_REMAINING by one. If G_OBLITERATOR_USES_REMAINING == 0 && G_OBLITERATOR_TIMER == -1, set G_OBLITERATOR_TIMER to 300 (frames). If G_OBLITERATOR_TIMER > 0, decrease it by one. If it's equal to 0 and G_OBLITERATOR_USES_REMAINING == 0, set G_OBLITERATOR_TIMER to -1 and G_OBLITERATOR_USES_REMAINING back to whatever maximum amount of uses you want.

That's generally the trick for things that need to wait a set amount of time in the global; just make timers that, if they're above 0, are decreased each frame, and only do something if they equal 0 (and then set them to -1 so that the effect isn't triggered every single frame they remain at 0).

#6 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 11 January 2018 - 09:38 PM

If I remember correctly, you can't change Sword Damage with scripts. What I'd do is make two copies of the obliterator, one with full power damage and the other with whatever damage you want it to have. Like Russ said, using timers, once the cooldown effect begins, give Link the weak obliterator and take away the fully powered one. Viceversa once the cooldown wears off.

 

BTW, that was an awesome weapon in the game as well. :)



#7 idontknow8

idontknow8

    Senior

  • Members

Posted 12 January 2018 - 01:05 PM

Russ...so where exactly in the global scripts do these lines go? Within the while loop I’m assuming?

And DemonLink...I totally agree! Which is why I’d love to reproduce the item but not sure how well it could be done giving the ZC engine, 2D graphics & the constraints of ZScript. But I figure it’s worth a shot.

So far I’ve drawn the graphics for it & they’re ok - again, challenging to reproduce in 2D - but if anyone would like to give a crack at it feel free.

As for the functionality, I have it scripted so while equipped it always has your health at a quarter heart but it also keeps your health there when switched to a different weapon. I would like it ideally to remember your health prior to equipping so that it will go back up to that level after unequipping. I also like I said am toying with having it lose its strength after x uses & requiring y cool down time but not sure.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users