User Tag List

Results 1 to 6 of 6

Thread: Help with NPC script.

  1. #1
    Octorok Archangel's Avatar
    Join Date
    Apr 2008
    Age
    34
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,732
    Level
    13
    vBActivity - Bars
    Lv. Percent
    94.8%

    Help with NPC script.

    Code:
    ffc script Gibdo2{
    		void run(){
    				npc Shadow = Screen->LoadNPC(1);
    				npc Gibdo = Screen->LoadNPC(2);
    				while(????){
    						Shadow->X = Gibdo->X + 32;
    						Shadow->Y = Gibdo->Y;
    						Waitframe();
    				}
    		}
    }
    Basically it compiles find if I put true in it. But I want it to loop only if the Gibdo is still alive.
    The problem is that when I use Bool isValid method, I can't get it to work. This is what I'm using.
    Code:
    While(bool Gibdo->isValid){
    Note: If you have ever played Land Stalker, this gibdo is suppose to function as an exact duplicate of the mummy from the crypt with the 8 puzzles.

    EDIT: Okay, so I compiled it, and it works find. The only problem is that the Gibdo warps to combo 2 on the grid meaning the script is continuing. When all is said and done slaying the shadow kills the Gibdo using the ring leader function.
    -Archangel-
    Keeping the ZC Developers busy with heavy beta testing skills and experimentation is what I do best. May ZC be bug free!

    You should seriously check advmath.zh out if you use ZC.

  2. #2
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,142
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.56%

    Re: Help with NPC script.

    Though you seem to have solved the compilation problem, a quick note of reference:

    The bool or int or whatever in front of a ZScript function in the manual is there to indicate its type. You don't include it in the script!

    As for the second problem, I'm not sure what you mean by "The Gibdo warps to combo 2 on the grid".

    Do you mean that the FFC (or, rather, the shadow?) is moving to the upper-left corner of the screen when the gibdo dies?

    I think this is what you need:

    Code:
    ffc script Gibdo2{
    		void run(){
    				npc Shadow = Screen->LoadNPC(1);
    				npc Gibdo = Screen->LoadNPC(2);
    				while(Shadow->isValid() && Gibdo->isValid()){
    						Shadow->X = Gibdo->X + 32;
    						Shadow->Y = Gibdo->Y;
    						Waitframe();
    				}
    				//if we get here, one of the monsters have died
    				//so, let's kill the one that didn't!
    				if(Gibdo->isValid()) Gibdo->HP = 0;
    				if(Shadow->isValid()) Shadow->HP = 0;
    		}
    }
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  3. #3
    Octorok Archangel's Avatar
    Join Date
    Apr 2008
    Age
    34
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,732
    Level
    13
    vBActivity - Bars
    Lv. Percent
    94.8%

    Re: Help with NPC script.

    Actually, the gibdo is invincible. The shadow is it's weak spot.
    Therefore, when you kill the shadow the gibdo moves to combo 2 on the grid or rather position (32,0)
    -Archangel-
    Keeping the ZC Developers busy with heavy beta testing skills and experimentation is what I do best. May ZC be bug free!

    You should seriously check advmath.zh out if you use ZC.

  4. #4
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,142
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.56%

    Re: Help with NPC script.

    Oh, I see what's going on... Hmm, I think this might be a bug.

    I bet that when the shadow dies, the gibdo moves up in the enemy list to take spot #1. The "Shadow" pointer, which was pointing at spot #1 now points at the gibdo in that spot.

    Although, that said, my version of the script *should* kill both if either one dies...
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  5. #5
    Octorok Archangel's Avatar
    Join Date
    Apr 2008
    Age
    34
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,732
    Level
    13
    vBActivity - Bars
    Lv. Percent
    94.8%

    Re: Help with NPC script.

    Which would be awesome because that would mean I could add bubbles or something.

    Also, a modified version of this script might just work to allow me to further manipulate bosses won't it. Oh god, now we can have some fun. Patras on Crack?
    -Archangel-
    Keeping the ZC Developers busy with heavy beta testing skills and experimentation is what I do best. May ZC be bug free!

    You should seriously check advmath.zh out if you use ZC.

  6. #6
    Octorok Archangel's Avatar
    Join Date
    Apr 2008
    Age
    34
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,732
    Level
    13
    vBActivity - Bars
    Lv. Percent
    94.8%

    Re: Help with NPC script.

    Damn it, now it doesn't follow the Gibdo, let's try your script then.

    EDIT: Sorry for the double post, Tried you script, same behavior. It just sits there doing nothing anyways. I'm going to set it to true and just use ring leader and it can run if it's dead
    -Archangel-
    Keeping the ZC Developers busy with heavy beta testing skills and experimentation is what I do best. May ZC be bug free!

    You should seriously check advmath.zh out if you use ZC.

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