User Tag List

Results 1 to 10 of 10

Thread: Animal Stalker

  1. #1
    Keese gray0x's Avatar
    Join Date
    Jul 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    844
    Level
    10
    vBActivity - Bars
    Lv. Percent
    15.51%

    Animal Stalker

    Basically, I want a non-solid 1x1 FFC to always travel behind Link after getting a certain item. Sorta like Pikachu from Pokemon Yellow, I guess.

    I doubt it's impossible, seeing as it's probably simpler than the fairy script. Think anybody can do this for me?

  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,141
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.37%

    Re: Animal Stalker

    Do you need this companion to do anything at all? Or, is he/she/it purely for show?

    If the latter, then you don't even need an FFC, just a script I could write for you.
    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
    Keese gray0x's Avatar
    Join Date
    Jul 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    844
    Level
    10
    vBActivity - Bars
    Lv. Percent
    15.51%

    Re: Animal Stalker

    It's just purely for show. And if it means anything, I'm using item 165 for what should trigger it.

    And I don't need it to turn around and stuff, just a 2 frame 1 direction thing would work wonders.

  4. #4
    Octorok
    Join Date
    Jan 2008
    Age
    32
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    938
    Level
    10
    vBActivity - Bars
    Lv. Percent
    63.32%

    Re: Animal Stalker

    Code:
    import "std.zh"
    
    bool animal;
    //put it with your item
    item script animalfriendpickup
    {
    	void run()
    	{
    		animal=true;
    	}
    }
    //this ffc script should be put wherever you want the animal friend to appear.
    //D0:number of the ffc taken by animal friend
    //D1:its data when going up
    //D2:---------when going down
    //D3:---------when going left
    //D4:---------when going right
    //D5:the CSet of the animal friend
    ffc script animalfriend
    {
    	void run(int n,int d1, int d2, int d3, int d4, int c)
    	{
    		int animalData[4];
    		animalData[1]=d1;animalData[2]=d2;animalData[3]=d3;animalData[4]=d4;
    		ffc a=Screen->LoadFFC(n);
    		a->Cset=c;
    		if (animal==false)
    		{
    			Quit();
    		}
    		else
    		{
    			while(true)
    			{
    				if (Link->Dir==0)
    				{
    					a->Data=animalData[1];
    					a->X=Link->X;a->Y=Link->Y+16;
    				}
    				if (Link->Dir==1)
    				{
    					a->Data=animalData[2];
    					a->X=Link->X;a->Y=Link->Y-16;
    				}
    				if (Link->Dir==2)
    				{
    					a->Data=animalData[3];
    					a->X=Link->X+16;a->Y=Link->Y;
    				}
    				if (Link->Dir==3)
    				{
    					a->Data=animalData[4];
    					a->X=Link->X-16;a->Y=Link->Y;
    				}
    			Waitframe();
    			}
    		}
    	}
    }
    I did not test it. So it might not be working... :p

  5. #5
    Keese gray0x's Avatar
    Join Date
    Jul 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    844
    Level
    10
    vBActivity - Bars
    Lv. Percent
    15.51%

    Re: Animal Stalker

    Well Lucas, that's not what I want, I can tell by the comments. It should follow Link around on every screens, and only should really face 1 direction. Putting an FFC on every screen would be too much of a pain in the ass :|

    Thanks for trying though. 2 scripts for me in a day :O

  6. #6
    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,141
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.37%

    Re: Animal Stalker

    You want it to face in one direction, but be behind link?

    This should do the trick:

    Code:
    import "std.zh"
    
    const int animal_tile = 1234; //tile
    const int animal_cset = 2;    //cset
    const int animal_speed = 8;   //animation speed, in frames.
          int animal_frame = 0;   //frame, don't change this
          int animal_timer = 0;   //animation timer, don't change this
    
    global script slot_2 {
    	void run() {
    		while(true) {
    			if(Link->Item[165]) animalbuddy();
    			Waitframe();
    		}
    	}
    	
    	void animalbuddy() {
    		int dx;
    		int dy;
    		if (Link->Dir==0)
    		{
    			
    			dx=Link->X;dy=Link->Y+16;
    		}
    		if (Link->Dir==1)
    		{
    			dx=Link->X;dy=Link->Y-16;
    		}
    		if (Link->Dir==2)
    		{
    			dx=Link->X+16;dy=Link->Y;
    		}
    		if (Link->Dir==3)
    		{
    			dx=Link->X-16;dy=Link->Y;
    		}
    		Screen->DrawTile(2, dx, dy, animal_tile + animal_frame, 1, 1, animal_cset, 1, 0, 0, 0, 0, true, 128);
    		animal_timer += 1;
    		if(animal_timer >= animal_speed) {
    			animal_timer = 0;
    			if(animal_frame == 0) animal_frame = 1; else animal_frame = 0;
    		}
    	}
    }
    lucas, I stole you if block

    Regardless, this will activate the instant you pick up item #165, and will draw a tile behind link until the moment you lose the item.

    You can customize it by changing the three consts at the top. Also, if you want it to be translucent (eg, a ghost or something), change the 128 at the end of the "Screen->DrawTile" line to a 64.

    It compiles, but I haven't tested it.
    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!

  7. #7
    Keese gray0x's Avatar
    Join Date
    Jul 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    844
    Level
    10
    vBActivity - Bars
    Lv. Percent
    15.51%

    Re: Animal Stalker

    I love you.
    It works great, just as annoying as I hoped it would be. My only complaint is that it disappears if there's a message on screens, whats up with that?

  8. #8
    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,141
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.37%

    Re: Animal Stalker

    Is the "Messages freeze all action" rule on? If so, it's because the global script isn't running any more, and thus not drawing the animal.

    If this is a problem, I could rework it to be an FFC script.
    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!

  9. #9
    Keese bob1000's Avatar
    Join Date
    Jun 2008
    Age
    31
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    704
    Level
    9
    vBActivity - Bars
    Lv. Percent
    35.81%

    Re: Animal Stalker

    Hey pkmnfrk, can you modify that script to look in 4 directions and animate only while moving?

    EDIT: Nevermind, I managed to do it myself. (Anyone hoping to have it face in 4 directions can add "(Link->Dir * 4)" to "Screen->DrawTile".)
    Seriously, if you see me post, consider yourself lucky. Or run for the hills, either way.

  10. #10
    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,141
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.37%

    Re: Animal Stalker

    Code:
    import "std.zh"
    
    const int animal_tile = 1180; //tile
    const int animal_cset = 7;    //cset
    const int animal_speed = 8;   //animation speed, in frames.
    const int animal_frames = 2;  //number of frames
    
    
          int animal_frame = 0;   //frame, don't change this
          int animal_timer = 0;   //animation timer, don't change this
    			
    
    global script slot_2 {
    	void run() {
    		while(true) {
    			if(Link->Item[165]) animalbuddy();
    			Waitframe();
    		}
    	}
    	
    	void animalbuddy() {
    		int dx;
    		int dy;
    		if (Link->Dir==DIR_UP)
    		{
    			
    			dx=Link->X;dy=Link->Y+16;
    		}
    		if (Link->Dir==DIR_DOWN)
    		{
    			dx=Link->X;dy=Link->Y-16;
    		}
    		if (Link->Dir==DIR_LEFT)
    		{
    			dx=Link->X+16;dy=Link->Y;
    		}
    		if (Link->Dir==DIR_RIGHT)
    		{
    			dx=Link->X-16;dy=Link->Y;
    		}
    		Screen->DrawTile(2, dx, dy, animal_tile + animal_frame + (Link->Dir * animal_frames), 1, 1, animal_cset, 1, 0, 0, 0, 0, true, 128);
    		if(Link->Action == LA_WALKING) {
    			animal_timer += 1;
    			if(animal_timer >= animal_speed) {
    				animal_timer = 0;
    				animal_frame += 1;
    				if(animal_frame == animal_frames) animal_frame = 0;
    			}
    		} else {
    			animal_timer = 0;
    			animal_frame = 0;
    		}
    	}
    }
    This version has three new things:

    * The buddy can face in multiple directions (place the tiles in consecutive order: UP, DOWN, LEFT, RIGHT).

    * It will only animate when actually walking.

    * You can customize the number of frames by changing the "animal_frames" constant at the top.

    Although I didn't mention it before, you can change the prerequisite item by changing the "if(Link->Item[165]) ..." line.
    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!

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