User Tag List

Results 1 to 9 of 9

Thread: help with an enemy...

  1. #1
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    help with an enemy...

    ok i dont know if this one has been created yet, but i need a script where an enemy will mimic your moves and only fire a weapon if it is pointing directly at the player. im using build 584. Thanks
    ... i just died a little inside...

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    "this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"

    --Andross Maximillion Remedy
    (otherwise known as Rem)

  2. #2
    Octorok
    Join Date
    May 2007
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,506
    Level
    13
    vBActivity - Bars
    Lv. Percent
    11.25%

    Re: help with an enemy...

    Code:
    ffc script follower{
    void run(int id){
    int LinkX; int LinkY;
    npc ene = Screen->CreateNPC(id);
    while(ene->isValid())
    {
    ene->X = this->X;
    ene->Y = this->Y;
    LinkX = Link->X;
    LinkY = Link->Y;
    Waitframe();
    if (Link->X > LinkX) {ene->Dir = 2; if (is_walkable(this->X-4,this->Y)){this->X -= 4;} }
    if (Link->X < LinkX) {ene->Dir = 3; if (is_walkable(this->X+4,this->Y)){this->X += 4;} }
    if (Link->Y > LinkY) {ene->Dir = 0; if (is_walkable(this->X,this->Y-4)){this->Y -= 4;} }
    if (Link->Y > LinkY) {ene->Dir = 1; if (is_walkable(this->X-4,this->Y)){this->Y += 4;} }
    }
    }
    }
    
    bool is_walkable(int x, int y)
    {
    	if(x<0 || x>240 || y<0 || y>160)
    	{
    		return false;
    	}
    return Screen->ComboS[y+(x>>4)]==0;
    }
    Alright, I wrote this in like 10 minutes so its untested, also the weapon fireing is not implimented yet. If you would like to test it and see if this is the kind of movement you had in mind (and if it works!) Let me know, I'll write the fireing script for you as well, but not tonight, gotta work tommarow. The script as it is should create an enemy of your choice (put enemy ID in argument 0) and have it mirror Link's movement (just like those enemies in Lttp, that is what I assumed you wanted to model this after) Well let me know what you think.

  3. #3
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    Re: help with an enemy...

    ok so everywhere there is a 0 i put the enemy ID? also it wont let me copy and paste... how do i make it work?
    ... i just died a little inside...

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    "this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"

    --Andross Maximillion Remedy
    (otherwise known as Rem)

  4. #4
    Octorok
    Join Date
    May 2007
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,506
    Level
    13
    vBActivity - Bars
    Lv. Percent
    11.25%

    Re: help with an enemy...

    Okay, to get the script into ZQ:
    If you already are useing some scripts:
    In ZQ, tools->Scripts - Compile ZScript - Export.
    Then open the file you exported (in notepad) and add the script to it. save it
    Tools->Scripts - Compile ZScript - Import. Compile. Assign the script to an FFC slot

    If this is the first script you are adding:
    copy this script to a notepad
    add this as the first line:
    import "std.zh"
    save as a .Z file (save as type All files)
    Tools->Scripts - Compile ZScript - Import. Compile. Assign the script to an FFC slot

    on the screen where you want the enemy,
    Data->Freefrom Combos. Choose one, Edit.
    Data Tab: Choose an invisible combo (NOT COMBO #0). Xpos,Ypos the cords you want your enemy to appear at (I can add in a random appearence if you like)
    Script drop box, choose the script slot number you assiged this script to
    Flags: Check 'Run script at screen init'
    Arguments tab: D0: Enemy ID

    Good to Go :)

  5. #5
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    Re: help with an enemy...

    ok... lol ill attempt to understand this
    ... i just died a little inside...

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    "this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"

    --Andross Maximillion Remedy
    (otherwise known as Rem)

  6. #6
    Keese
    Join Date
    Mar 2007
    Age
    30
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    833
    Level
    10
    vBActivity - Bars
    Lv. Percent
    9.44%

    Re: help with an enemy...

    Ooh... some nasty puzzles could be done with this... Could you make one that does the same thing, except with the directions the enemy moves reversed (as in, you move left, it moves right)?

  7. #7
    Octorok
    Join Date
    May 2007
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,506
    Level
    13
    vBActivity - Bars
    Lv. Percent
    11.25%

    Re: help with an enemy...

    Could you make one that does the same thing, except with the directions the enemy moves reversed (as in, you move left, it moves right)?
    Actually that is what it does now. Just like the Green/Red Goryia 2 in Lttp

  8. #8
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,959
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.21%

    Re: help with an enemy...

    Ooooooohhh!! Oooh! How about for weapons they fire a a stream of lasers, rapid fire lasers. Like 6 ffc's a second! And, and, use some Ax and Ay action so they bend towards Link's position. Ahahaha!!!

    Warp link to the center of a room where he's surrounded by 'em, now that's a puzzle!!!

    Good use for if(Abs(this->X == Link->X) + 8//-8){ fire lasers!;}

    How about omnidirectional enemy fire?


    Ah, Teleporting ffc statues! ..if(Link->InputB){ this->X etc...; }


    Hey, you could recreate those Skeletons that jump back when attacked from LTTP. ......Plus make them counterattack! You don't even need ffc life, just keep this->X,Y at enemyNPC->X,Y, and move the enemy accordingly.

    I just got a bunch of ideas...Anyway, howabout a variable that allows the user to specify enemy difficulty? If you want to finish the basic script I'd be happy to add much evilness to it.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  9. #9
    Gibdo Master Maniac's Avatar
    Join Date
    Aug 2007
    Location
    umm in a house
    Age
    32
    Posts
    646
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,533
    Level
    16
    vBActivity - Bars
    Lv. Percent
    47.1%

    Re: help with an enemy...

    umm its not working right...[yes i just got around to testing it] when i try to import the file it says," unable to parse instruction from script mirror enemy ,the error was: invalid instruction, the command was (script) (follower{,)

    ... im not even in the beginning stages of being able to translate this... can you please explain it?
    ... i just died a little inside...

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    "this time, of this sixteenth of a thousand lives will be my last, and this curse will be broken. though my fate is to burn in hell, it is worse to live among the thousand lifetimes that i have been sentenced to, than it would be to have satan tear the flesh from my body repeatedly for an eternity"

    --Andross Maximillion Remedy
    (otherwise known as Rem)

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