User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 23

Thread: Lttp style 'pickup rock' script

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

    Talking Lttp style 'pickup rock' script

    Now you can pickup rocks (or any other object of your choice) and use them as weapons just like in Lttp.
    it requires some settup to use.
    I choose combo page 25 to use for 'liftable objects' you can change that if you want, but to use this script as is, just setup the first 120 combos on page 25 as follows:

    combo 6400 - 6419 - Light objects
    combo 6420 - 6439 - Held Light objects
    combo 6440 - 6459 - Heavy objects
    combo 6460 - 6479 - Held Heavy objects
    combo 6480 - 6499 - Very Heavy objects
    combo 6500 - 6519 - Held Very Heavy objects

    Arguments:
    D0: the combo ID of the under combo you want to use after a rock is lifted
    D1: the damage of Light objects
    D2: the damage of Heavy objects
    D3: the damage of Very Heavy objects

    Just put this script in a FFC in each room you have something liftable.

    This script is setup to use the R button for lifting and throwing objects

    The only thing missing is to change Link's graphics to actually look like he is holding the object, I am thinking of giveing Link an invisible Item that does nothing execpt use the Link tile modifier to switch his graphics while holding the rock, and take the Item away once he has thrown it. Hopefully someone will make some graphics for this (as I am not useing Link as my main character I am working on other graphics)

    Enjoy, and please report any bugs! :)
    Code:
    ffc script liftRock{
    void run(int under, int dam_1, int dam_2, int dam_3) {
    int xx = 0;
    int yy = 0;
    int this_dam = 0;
    bool is_hit = false;
    bool is_hold = false;
    while (true) {
    	is_hit = false;
    	if (Link->Dir == 0) { 
    		 xx = Link->X; 
    		 yy = Link->Y-8;
    	}
    	if (Link->Dir == 1) { 
    		 xx = Link->X; 
    		 yy = Link->Y+16;
    	}
    	if (Link->Dir == 2) { 
    		 xx = Link->X-16; 
    		 yy = Link->Y;
    	}
    	if (Link->Dir == 3) { 
    		 xx = Link->X+16; 
    		 yy = Link->Y;
    	}
    	if (Link->InputR && can_lift(xx,yy) > 0 && is_hold == false)
    	{
    	//Main Action Loop
    	if (can_lift(xx,yy) == 1) {this_dam = dam_1;}
                 if (can_lift(xx,yy) == 2) {this_dam = dam_2;}
                 if (can_lift(xx,yy) == 3) {this_dam = dam_3;)
    	//assumes the shape of the rock
    	this->Data = Screen->ComboD[ComboAt(xx,yy)] + 20;
    	this->CSet = Screen->ComboC[ComboAt(xx,yy)];
    	//Changes Rock to undercombo
    	Screen->ComboD[ComboAt(xx,yy)] = under; 
    	//moves ffc to position of rock
    	this->X = xx;
    	this->Y = yy;
    	//Sets flag to tell Link is holding rock
    	is_hold = true;
    	
    	while(Link->InputR) { Waitframe(); }
    	}
    	
    
    	if (is_hold == true)
    	{
    //moves rock to above Link's head
    	this->X = Link->X;
    	this->Y = Link->Y-12;
    	}
    	
    	if (Link->InputR && is_hold == true)
    	{
    	//Throwing routine
                 is_hold = false;
    	if (Link->Dir == 0)
    		{
    		while (is_hit == false) 
    			{
    			this->Y-=12;
    			if (ene_damage(this_dam,this->X,this->Y) == true) { is_hit = true; }
    			Waitframe();
    			}
    		this->Data = 0;
    		this->X = 0;
    		this->Y = 0;
    		}	
    	if (Link->Dir == 1)
    		{
    		while (is_hit == false) 
    			{
    			this->Y+=12;
    			if (ene_damage(this_dam,this->X,this->Y) == true) { is_hit = true; }
    			Waitframe();
    			}
    			this->Data = 0;
    			this->X = 0;
    			this->Y = 0;	
    			}	
    	if (Link->Dir == 2)
    		{
    		while (is_hit == false) 
    			{
    			this->X-=12;
    			if (ene_damage(this_dam,this->X,this->Y) == true) { is_hit = true; }
    			Waitframe();
    			}
    			this->Data = 0;
    			this->X = 0;
    			this->Y = 0;	 	
    		}	
    	if (Link->Dir == 3)
    		{
    		while (is_hit == false) 
    			{
    			this->X+=12;
    			if (ene_damage(this_dam,this->X,this->Y) == true) { is_hit = true; }
    			Waitframe();
    			}
    			this->Data = 0;
    			this->X = 0;
    			this->Y = 0;		
    		}	
    	}
    
    
    
    
    	//}
    Waitframe();
    }
    }
    }
    
    
    
    int can_lift(int xn, int yn)
    {
    int result = 0;
    	if(xn<0 || xn>240 || yn<0 || yn>160)
    	{
    		return 0;
    	}
    	
    	if (Link->Item[107] && Screen->ComboD[ComboAt(xn,yn)] >= 6400 && Screen->ComboD[ComboAt(xn,yn)] <= 6419) { result = 1;}
    	if (Link->Item[19] && Screen->ComboD[ComboAt(xn,yn)] >= 6440 && Screen->ComboD[ComboAt(xn,yn)] <= 6459) { result = 2 ;}
    	if (Link->Item[56] && Screen->ComboD[ComboAt(xn,yn)] >= 6480 && Screen->ComboD[ComboAt(xn,yn)] <= 6499) { result = 3;}
    
    return result;
    }
    
    bool ene_damage(int damage,int xn, int yn) {
    	int ene_chk = 1;
    	bool result = false;
    	if (xn<0 || xn>240 || yn<0 || yn>160) {result = true;}		 	
    		while (ene_chk <= Screen->NumNPCs()) {
    			npc trg_ene = Screen->LoadNPC(ene_chk); 	
    			if (trg_ene->X+8 >= xn-8 && trg_ene->X+8 <= xn+24 && trg_ene->Y+8 >= yn-8 && trg_ene->Y+8 <= yn+24) {
    				//Enemy is Hit
    				result = true;
    				int timer = 10;
    				trg_ene->HP -= damage;
    				while(timer > 0) {
    					//Flash CSet
    					int def_cset = trg_ene->CSet;
    					if (trg_ene->CSet == def_cset) {
    						trg_ene->CSet = 5;} 
    					else {
    						trg_ene->CSet = def_cset;}
    					//Push enemy back
    					//0,1,2,3, - Up,Dn,Lt,Rt
    					if (trg_ene->Dir == 0) {
    						if (is_walkable(trg_ene->X,trg_ene->Y+4)) {trg_ene->Y+=4;}
    					}
    					if (trg_ene->Dir == 1) {
    						if (is_walkable(trg_ene->X,trg_ene->Y-4)) {trg_ene->Y-=4;}
    					}
    					if (trg_ene->Dir == 2) {
    						if (is_walkable(trg_ene->X+4,trg_ene->Y)) {trg_ene->X+=4;}
    					}
    					if (trg_ene->Dir == 3) {
    						if (is_walkable(trg_ene->X-4,trg_ene->Y)) {trg_ene->X-=4;}
    					}
    					timer -= 1;
    				}
    			}
    		ene_chk += 1;
    		Waitframe();
    		
    		} 
    return result;
    }

  2. #2
    Octorok
    Join Date
    Nov 2006
    Age
    29
    Posts
    463
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,770
    Level
    14
    vBActivity - Bars
    Lv. Percent
    8.15%

    Re: Lttp style 'pickup rock' script

    Cool. Thanks dude!

    Click here to level up my card, or be sacrificed... ^_^

    Want to see Shattered Earth, AGN's RPG, back? Got a computer that is capable of running a server? PM me!

  3. #3
    Octorok Beta Link's Avatar
    Join Date
    Jan 2007
    Age
    31
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,125
    Level
    11
    vBActivity - Bars
    Lv. Percent
    52.14%

    Re: Lttp style 'pickup rock' script

    Very interesting. Just make it change Link's tiles, and you've got a perfect LA Power Bracelet.

    Edit: I don't know much about scripting, but can't you change this into an item script and let that item change Link's tiles? That way, there's less setup involved. But whatever. Whatever'll work.

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

    Re: Lttp style 'pickup rock' script

    Quote Originally Posted by ShadowMancer View Post

    I am thinking of giveing Link an invisible Item that does nothing execpt use the Link tile modifier to switch his graphics while holding the rock, and take the Item away once he has thrown it. Hopefully someone will make some graphics for this (as I am not useing Link as my main character I am working on other graphics)
    Thats the way to do it. In Zodiac, I used the Bait to change the player's graphics when they're clinging to a wall ala Ninja Gaiden. Because, fuck, who uses the Bait anyway? Useless item.

    I'd use the z255 blank items, but despite my pleas, no one has fixed them so they can be reliably equipped or offered decent explaination on subscreen setup. So Bait it is.


    You might also want to think about making this into an item script hybrid. The item would just set a global variable telling the FFC script that the player is using the appropriate item. That way, you save a button. You could even use the Glove. I dont think there's anything stopping you from using an item with a mere possession effect like the Glove pushing blocks also as a useable item, is there?

  5. #5
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.39%

    Re: Lttp style 'pickup rock' script

    Nah! Use the Cane of Byrna! It's not even implemented anyway!

    Good job though.
    Avatar: Just who the SPAAAACE do you think I am?

  6. #6
    Octorok
    Join Date
    Oct 2004
    Age
    47
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,253
    Level
    12
    vBActivity - Bars
    Lv. Percent
    9.27%

    Re: Lttp style 'pickup rock' script

    I am getting a fatal error P00: can't open or parse input file

    EDIT: it says now that LINE XXX (last line) has an unexpected $end on token
    -----------------------------------------------------
    NEWEST QUESTS:
    -----------------------------------------------------
    ZC 2.5 build 635+ (Player): Origins III
    -----------------------------------------------------
    visit my web site, for all my quests Einstein Games

  7. #7
    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: Lttp style 'pickup rock' script

    You must be missing the ending }. Check to make sure you've copied that too. If it's not that, then it's up to Shadowmancer to help 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!

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

    Re: Lttp style 'pickup rock' script

    It shows this to me when I try to import the script.

    Unable to parse instruction 1 from script script_liftrock
    the error was : invalid instruction
    the command was (script)(liftrock{,)

    Anyone have an idea?

  9. #9
    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: Lttp style 'pickup rock' script

    Ah. You're importing it wrong. This is a ZScript, not a ZASM script. You need to put it in a text file, like this:

    Code:
    import "std.zh"
    
    //insert ShadowMancer's script here
    Save it as "rock.z" (not rock.txt or anything, rock.z) in your Zelda Classic folder, and then, in ZQuest, go Tools->Scripts->Compile ZScript...

    Then, click on Import. If it asks if you want to overwrite the buffer, click Yes. Now, choose rock.z, and click OK. Now, click on Compile, and see if that works.
    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!

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

    Re: Lttp style 'pickup rock' script

    Well, now it shows up:

    Line 33: syntax error, unexpected RPAREN, on token )
    Fatal error P00: can't open or parse input file

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