Jump to content

Photo

Shield Breaking


  • Please log in to reply
3 replies to this topic

#1 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 17 July 2011 - 04:44 PM

Almost identically similar to the shields in Skyward Sword, I want my shields to be able to break.
I want it so each type of enemy weapon hurts Link's shield a certain amount. And his shield has a "stamina".

Example: Lets say small rocks from Octoroks are 1, arrows from Moblins are 2, and boomerangs from Goriya's are 4. And Link's small shield stamina is 30. once the stamina is 0, a small animation happens, and it tells Link his shield broke, making him defenseless, until he buys a new one.

Also, I don't want the shield to reset it's stamina, ever. Even if the game is Continued, Saved, etc.

I also want the script to be able to do multiple shields, as in small and magic/iron, etc.

Is this possible? It seems hard, but I hope so! It could be so awesome!
Whoever can do it, THANK YOU SO MUCH.

Edited by Jared, 17 July 2011 - 05:15 PM.


#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 18 July 2011 - 02:56 AM

QUOTE
I want to use script to replace the build in collision detection between EWeapons and Link so I can null the effects of Links shield and make my own system. See Jared's post in Script Request on Shield Breaking for more info on this. Anyways basically I want to make it so the shield has it's own hp meter and breaks when it runs out of HP. That's the whole point of creating my own system.

The question is... What if anything will change or break if I do this by turning collision detection off for ALL eweapons using a script. I know I will need to detect my own collisions and that's find, but is there anything else I should know?


It's entirely possible other scripts can break easily by shutting off collision checking, or maybe not, -I don't know. This can probably be minimized by only turning it off when an eweapon is about to collide with Link, on otherwise.

CODE

float distance_squared(object a, object b)
{
    float dx = b->X - a->X;
    float dy = b->Y - a->Y;
    float distanceSquared = dx * dx + dy * dy;
    return distanceSquared;
}

#define RADIUS 16
#define RADIUSSQUARED RADIUS * RADIUS

//Global script
//loop only if weapons can be blocked or need to be handled
foreach(eweapon)
{
    if(distance_squared(Link,eweapon) < RADIUSSQUARED)
    //if(distance_squared(Link,eweapon) <= 8*8 + eweapon->Step*eweapon->Step) //perhaps a better alternative
    {
        eweapon->CollDetection = false;
    }
    else
    {
        eweapon->CollDetection = true;
    }
}


Something like that should 'play nice' with others I'd think.

#3 Eddard McHorn Van-Schnuder

Eddard McHorn Van-Schnuder

    smash the bye button

  • Members
  • Real Name:Ronny Wiltersen

Posted 18 July 2011 - 03:17 AM

Just a quick idea: even if you said you don't want the shield to reset itself ever, wouldn't it be cool if there was a shop that sells a "fix" tool somewhere, and upon "consumption", the tool would repair all or parts of the stamina bar?

That'd add another player choice, where the player has to consider buying repair tools (which could say, be expensive, but not as expensive as the shield itself) and lose cash now, or wait til it breaks and then pay more, and be without a shield until you do get one.

Or you could do it the other way around, where the tool is more expensive than the shield, yet not having a shield would be a problem, thus balancing it out. Anyway, just an idea icon_razz.gif


#4 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 18 July 2011 - 09:35 AM

QUOTE(Gleeok @ Jul 18 2011, 01:56 AM) View Post

It's entirely possible other scripts can break easily by shutting off collision checking, or maybe not, -I don't know. This can probably be minimized by only turning it off when an eweapon is about to collide with Link, on otherwise.


Why would it break scripted EWeapons?

EDIT: Another thing that would break would be magic mirrors. If your using those will need to go with Gleeok's method.

Edited by blackbishop89, 18 July 2011 - 09:38 AM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users