User Tag List

Results 1 to 8 of 8

Thread: Statues' script

  1. #1
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,458
    Level
    12
    vBActivity - Bars
    Lv. Percent
    93.1%

    Statues' script

    What I'm trying to make is a script to create a safe zone around stone statues such that they won't fire at Link if he's close (within a square centered on the point where the fireballs emanate). Since it needs to effect all instances of Fireball-shooting statues in the game, I wanted to make it global. The range I was thinking of was 24 pixels, although that should be easily modified if that's not right.

    To be clear, this should effect each statue independently, so that one could fire when another does not, etc.
    Last edited by Imzogelmo; 08-10-2011 at 02:45 PM.

  2. #2
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,458
    Level
    12
    vBActivity - Bars
    Lv. Percent
    93.1%
    Very weird bots we have running around here...

    Anyway, I can make a script to detect that Link is too close, but the problem is that I don't know how to tell each individual statue to become dormant/reactivated.

    I'm trying to come up with a workaround until the NES behavior is available.
    Last edited by Imzogelmo; 08-13-2011 at 02:56 AM.

  3. #3
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    If they don't play sounds, you could simply move them offscreen. If they do, I think your only option is to kill them, then spawn new ones when Link moves away.

  4. #4
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,458
    Level
    12
    vBActivity - Bars
    Lv. Percent
    93.1%
    How do you reference an invisible, environmentally-spawned shooter enemy (in other words, not one of the 10 screen enemies)?

    And, more to my point, how do you do so in a coordinate-independent way, as I want this to apply globally, regardless of the placement of the statue (which presumably has the same coordinates as the environmentally-spawned shooter)?

    My first thought was that one could loop over all combos on screen, and if the combo type were (for instance) Right Statue, then get its coordinates, and, if Link is within that threshhold, silently replace it with combo having the same tile but having no type. Do the same for Left and Center Statues as well. Loop continuously, though, as he may move out of the safe zone and you'll have to replace it with a shooting one in that case....

    And all that is assuming that replacing the combo will remove the hidden shooter enemy, which is actually quite illogical to me, and I don't know how the game actually handles that.

    Surely there is a more efficient way?
    Last edited by Imzogelmo; 08-17-2011 at 02:07 AM.

  5. #5
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,458
    Level
    12
    vBActivity - Bars
    Lv. Percent
    93.1%
    Nevermind this, everyone.

    I have found a way to do it, using Saffith's autoghost script for a homing shooter. I modified it slightly, to make the safe distance a parameter in Misc. and I set the homing parameters high enough to render the homing nonexistent. The only thing I haven't figured out yet is how to make the enemies not knock link back (as real shooters do not have any effect when "touched").

    Saffith, do you know how to do the above?

    And thank you to Saffith and anyone else who looked at this thread.

    EDIT: Nevermind the above request, I just discovered the SetOffsets function, and figured out how to tweak it such that the hitbox is 0, so there is no other issue.
    Last edited by Imzogelmo; 08-18-2011 at 12:01 AM.

  6. #6
    Octorok
    Join Date
    Jan 2011
    Location
    Canada
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    812
    Level
    9
    vBActivity - Bars
    Lv. Percent
    98.9%
    Another way to prevent Link from getting knocked back is to set npc->CollDetection = false.

  7. #7
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,458
    Level
    12
    vBActivity - Bars
    Lv. Percent
    93.1%
    Thanks, that's much more concise. I think I'll change the script to use that instead.

    Finally (!) I have a way to make the default statue (fireball shooters) give a safe zone such that they only fire when Link is far enough away, which is the way it works on the NES.

    The script I'm using is Saffith's HomingFireballShooter script, with just a few changes. I made the distance a parameter (the default of 32 is good already though, but it could be set independently now). I also added the above line in the file, so it won't knock Link back if he touches the shooter. I have it to spawn from statues, so I don't even place the enemy.

    Since this very much effects the way that I play, it was important for me to have it working correctly. Thanks again to Saffith for the script and to all who helped me.
    Last edited by Imzogelmo; 08-18-2011 at 01:15 AM.

  8. #8
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,458
    Level
    12
    vBActivity - Bars
    Lv. Percent
    93.1%
    Sorry to double post, but I felt this needed to be said. I've got an update that also will allow you to make the shooter only fire at certain divisions of the circle. With that, I believe it is possible to fully replicate the shooters from Zelda 1, both in safe zone distance and specific shooting angles.

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