User Tag List

Results 1 to 6 of 6

Thread: Stealing the mirror shield?

  1. #1
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%

    Stealing the mirror shield?

    I want to make it so you can steal the mirror shield off a fancy darknut with the hookshot which in turn breaks the shield but only if you hit it from the from the front.

  2. #2
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,560
    Level
    30
    vBActivity - Bars
    Lv. Percent
    51.7%
    Is there an issue you are running into? I could script this. It doesn't seem too complicated, but I know your talents. I imagine you could aswell.

  3. #3
    Cor Blimey! CJC's Avatar
    Join Date
    Dec 2002
    Location
    Fading into the darkness
    Age
    35
    Posts
    1,398
    Mentioned
    150 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,618
    Level
    25
    vBActivity - Bars
    Lv. Percent
    0.96%
    Well, you're going to need to know two things:

    1.) Which bit of the enemy flags refers to the Shielded (Front) flag, so that you can set the bit to 0 when the logic of the snatch succeeds.
    I can't help with this, all I know is it's one of the enemy flags. I guess you might be able to find this info on Shardstorm.

    2.) EXACTLY when the hookshot collides with the target, so that you can compare the LWeapon direction and ensure it is the opposite of the Darknut's (IE the enemy is facing the weapon directly).
    I don't have an exact answer from this, but I have a few suggestions. First, you could define a 1-pixel border around the Darknut where you test the direction of the hookshot weapon; on a correct direction you switch the shielded enemy flag off, thereby snatching the shield away (you could also draw a tile to show the shield shattering).
    Second, you could use my method of converting direction indices to a rotational modular equivalency, letting you more easily check which direction is the reverse:
    Spoiler: show
    Code:
    //======SpinDir8======
    //Method for converting clockwise rotation to the 8 directional constants
    int SpinDir8(int dir) {
        //Take the modulo 8 to hopefully prevent invalid inputs.
        dir = (dir+8)%8;
        if(dir==0)
            return DIR_UP;
        else if(dir==1)
    	return DIR_RIGHTUP;
        else if(dir==2)
            return DIR_RIGHT;
        else if(dir==3)
    	return DIR_RIGHTDOWN;
        else if(dir==4)
            return DIR_DOWN;
        else if(dir==5)
    	return DIR_LEFTDOWN;
        else if(dir==6)
            return DIR_LEFT;
        else if(dir==7)
    	return DIR_LEFTUP;
        return -1;
    }
    
    //Method for converting the 8 directional constants to clockwise rotation
    int ToSpinDir8(int dir) {
    	//Take the modulo 8 to hopefully prevent invalid inputs.
    	dir = (dir+8)%8;
        if(dir==DIR_UP)
            return 0;
        else if(dir==DIR_RIGHTUP)
    	return 1;
        else if(dir==DIR_RIGHT)
            return 2;
        else if(dir==DIR_RIGHTDOWN)
    	return 3;
        else if(dir==DIR_DOWN)
            return 4;
        else if(dir==DIR_LEFTDOWN)
    	return 5;
        else if(dir==DIR_LEFT)
            return 6;
        else if(dir==DIR_LEFTUP)
    	return 7;
        return -1;
    }


    To see if the darknut is facing the right way relative to the hookshot, you would want to store the hookshot's direction in a variable (by looking for the LWeapon type LW_HOOKSHOT [might be a different constant, don't know off the spot]), the darknut's direction in a separate variable (by checking each enemy on screen, comparing enemy # to confirm it is a darknut, and then recording its direction) and then comparing the two
    Code:
    if(darknut->dir == SpinDir8(ToSpinDir8(hook->Dir) + 4){
        //Do the shield snatchy
    }

    I know this isn't everything you need to do what you want, but it should help you come up with some ideas. Then your scripting talent can fill in the rest.

  4. #4
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    My main problem is that the hookshot should break the shield and I want the same collision as normal for darknuts. (stun them from sides and behind) but no shield stealing.
    Chances are I'm going to have to script the normal hookshot block-stun behavior

  5. #5
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,560
    Level
    30
    vBActivity - Bars
    Lv. Percent
    51.7%
    Quote Originally Posted by Tamamo View Post
    My main problem is that the hookshot should break the shield and I want the same collision as normal for darknuts. (stun them from sides and behind) but no shield stealing.
    Chances are I'm going to have to script the normal hookshot block-stun behavior
    Well yeah, you would script the shield stealing and the shield breaking. Just detect that the hookshot was blocked by the Darknut's shield. I believe the hookshot would show WDS_BOUNCE when it hits.

  6. #6
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    Oh yeah, I forgot that deadstate effected hookshots too and not just boomerangs.
    Thanks SUCCESSOR. I'll give it a spin.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social