User Tag List

Results 1 to 6 of 6

Thread: "Ally" Script

  1. #1
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,387
    Level
    18
    vBActivity - Bars
    Lv. Percent
    70.32%

    "Ally" Script

    I'm trying to write a script that makes an "Ally" follow Link directly behind his back, and when there are enemies around, it chases after enemy1, then after enemy1 is dead, it goes onto enemy2, and so on. If link kills enemy2 before the ally kills enemy1, it just goes on to enemy 3. I have the script that makes the ally follow Link...

    Code:
    WAIT WAITFRAME
     COMPAREV LINKDIR,0
     GOTOTRUE DOWN
     COMPAREV LINKDIR,1
     GOTOTRUE UP
     COMPAREV LINKDIR,2
     GOTOTRUE LEFT
     COMPAREV LINKDIR,3
     GOTOTRUE RIGHT
     GOTO WAIT
    DOWN SETR d4,LINKY
     ADDV d4,16
     SETR y,d4
     SETR x,LINKX
     SETR DATA,d0
     GOTO WAIT
    UP SETR d4,LINKY
     SUBV d4,16
     SETR y,d4
     SETR x,LINKX
     SETR DATA,d1
     GOTO WAIT
    LEFT SETR d4,LINKX
     ADDV d4,16
     SETR x,d4
     SETR y,LINKY
     SETR DATA,d2
     GOTO WAIT
    RIGHT SETR d4,LINKX
     SUBV d4,16
     SETR x,d4
     SETR y,LINKY
     SETR DATA,d3
     GOTO WAIT
    But I have no idea how to log the positions of enemies, or damage an enemy. Can I get some help on this?

  2. #2
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,608
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.4%

    Re: "Ally" Script

    In ZASM? Nope.

  3. #3
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,387
    Level
    18
    vBActivity - Bars
    Lv. Percent
    70.32%

    Re: "Ally" Script

    Okay then... Could you help me in Zscript?

  4. #4
    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%

    Re: "Ally" Script

    See, here's the thing: there seems to be a bit of a bug keeping REFFFC and REFNPC from being set correctly. I can tell you what I think you would do, but neither of us can really test it to make sure right now. You'll have to put this off until at least beta 17.


    The number of enemies on the screen is stored in NPCCOUNT. You load a reference to an NPC by setting the value of REFNPC - the first enemy is 0. With that, you can read and set that enemy's position with NPCX, NPCY, and NPCZ, and you can access its HP using NPCHP.

    I'm not sure, but I think NPCs include both guys and enemies, and I don't believe there's a way to check which you've got directly. There's sure to be some way of knowing, though.
    The amount of damage an NPC does when it touches link is NPCDP, and its weapon damage is NPCWDP. I figure if those are both 0 or less, it probably shouldn't be considered an enemy.

  5. #5
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,387
    Level
    18
    vBActivity - Bars
    Lv. Percent
    70.32%

    Re: "Ally" Script

    Thank you Saffith! As always, you are in my debt (whatever good that does...).

    So, I can set REFNPC to increment on NPCHP being 0, then moving the FFC torwards NPCX,NPCY by comparing x,y and changing the combo/moving accordingly. When the FFC and the target NPC are touching, the NPC takes damage... Then when all NPCs are dead, it returns behind Link...

    This will help me a lot with level 2 of my quest... Thank you!

  6. #6
    Gel Sir-Pimpalot's Avatar
    Join Date
    Dec 2006
    Age
    32
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    697
    Level
    9
    vBActivity - Bars
    Lv. Percent
    31.74%

    Re: "Ally" Script

    This'll be a nice one! :) Sorry, nope I'm of no help.

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