User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Scripted LWeapon items #1

  1. #1
    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,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.09%

    Scripted LWeapon items #1

    Three new lv3 items:


    EDIT: Ok, bugfix. Use the CUSTOM ITEM CLASSES for the b_rang and the flamethrower. Also you probably need at least the lv1 boomerang for the sprites to display correctly.

    I always use the custom item classes for all of these weapons sense that's what they were designed for.



    The flamethrower candle,
    The lv2 (or lv3) Wand,
    The Multi_rang! (my personal favorite)


    Everything is basically already set up. If you want to change something then change it in the code. You'll see stuff like:
    "// cset" or
    "// speed"
    for example. change it from there.

    EXEPT the wand magic item. This one is meant to be used for NON Z3 MOVEMENT, and you'll have to slightly change it for animating the magic sprite. ...or if you like request what you want and i'll change it for you.

    Wand lv2 item uses one D variable, Tile. Just set D0 argument to the tile you want to use.This should be arranged as 4 tiles in your tiles page! *Up,Down,Left,Right.*

    Code:
    int fire3;
    int wand2;
    
    
    
    global script global_2{
    
    	void run(){
    
    		int attack_delay;
    
    		while(true){
    
    			Waitframe();
    
    			int lx = Link->X; int ly = Link->Y;
    
    			if(attack_delay>0)attack_delay--;
    			if(Link->InputB && fire3>0){
    
    				if(attack_delay==0){
    					attack_delay = 6;
    
    					lweapon laser = Screen->CreateLWeapon(WPN_FIRE);
    					
    					if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
    					else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
    					else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
    					else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
    					laser->Step=2;
    					laser->Damage=2;
    					laser->CSet=8;
    					Game->PlaySound(13);
    				}
    			}
    			else fire3=0;
    		}
    	}
    }
    
    item script flamethrower_item{
    	void run(){
    		fire3=3;
    	}
    }
    
    
    item script wand_lv2{
    	void run(int tile){
    
    		int d = 2; // damage
    		int c = 7; // cset
    		int s = 3; // speed
    
    		int t = Link->Dir;
    
    		int lx = Link->X; int ly = Link->Y;
    
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(WPN_WAND);
    					
    		if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
    		else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
    		else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
    		else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
    		laser->Step=s;laser->Tile=tile+t;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(WPN_WAND);
    					
    		if(Link->Dir==0){laser->Dir=0;laser->X=lx+8;laser->Y=ly-16;}
    		else if(Link->Dir==1){laser->Dir=1;laser->X=lx+8;laser->Y=ly+16;}
    		else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly+8;}
    		else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly+8;}
    		laser->Step=s;laser->Tile=tile+t;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(WPN_WAND);
    					
    		if(Link->Dir==0){laser->Dir=0;laser->X=lx-8;laser->Y=ly-16;}
    		else if(Link->Dir==1){laser->Dir=1;laser->X=lx-8;laser->Y=ly+16;}
    		else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly-8;}
    		else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly-8;}
    		laser->Step=s;laser->Tile=tile+t;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(WPN_WAND);
    					
    		if(Link->Dir==0){laser->Dir=1;laser->X=lx;laser->Y=ly+16;laser->Tile=tile+1;}
    		else if(Link->Dir==1){laser->Dir=0;laser->X=lx+8;laser->Y=ly-16;laser->Tile=tile;}
    		else if(Link->Dir==2){laser->Dir=3;laser->X=lx+16;laser->Y=ly;laser->Tile=tile+3;}
    		else{ laser->Dir=2;laser->X=lx-16;laser->Y=ly;laser->Tile=tile+2;}
    		laser->Step=s;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    	}
    }
    
    
    item script boomerang_multi{
    	void run(){
    
    	int s = 3; // b_rang speed
    	int c = 11;
    
    		lweapon fire1 = Screen->CreateLWeapon(WPN_BRANG);
    		fire1->Step=s;
    		fire1->Damage=0;
    		fire1->CSet=c; // cset
    		Game->PlaySound(4);
    
    
    		if(Link->InputLeft && Link->InputUp){
    			fire1->X = Link->X - 16; 
    			fire1->Y = Link->Y - 16;
    			fire1->Dir=4;
    		}
    		else if(Link->InputRight && Link->InputUp){
    			fire1->X = Link->X + 16; 
    			fire1->Y = Link->Y - 16;
    			fire1->Dir=5;
    		}
    		else if(Link->InputLeft && Link->InputDown){
    			fire1->X = Link->X - 16; 
    			fire1->Y = Link->Y + 16;
    			fire1->Dir=6;
    		}
    		else if(Link->InputRight && Link->InputDown){
    			fire1->X = Link->X + 16; 
    			fire1->Y = Link->Y + 16;
    			fire1->Dir=7;
    		}
    		else{
    			if(Link->Dir == 0) {
    				fire1->X = Link->X; 
    				fire1->Y = Link->Y - 16;
    				fire1->Dir=0;
    			}
    			if(Link->Dir == 1) {
    				fire1->X = Link->X; 
    				fire1->Y = Link->Y + 16;
    				fire1->Dir=1;
    			}
    			if(Link->Dir == 2) {
    				fire1->X = Link->X - 16; 
    				fire1->Y = Link->Y;
    				fire1->Dir=2;
    			}
    			if(Link->Dir == 3) {
    				fire1->X = Link->X + 16; 
    				fire1->Y = Link->Y;
    				fire1->Dir=3;
    			}
    		}
    	}
    }

    http://www.youtube.com/watch?v=1nqf3Gj4DCs
    Thanks to bigjoe for making a video. I had no problems with the boomerang sprites though...Ah, I just figured it out.




    Oh, and one more cool thing: The Multirang will shoot whatever type boomerangs you currently have! So if you have fire boomerangs for example, Now you have LOTS of fire boomerangs. :)


    ..Screenshots:


    Practice your accuracy by trying to stun multiple enemies!


    I think sweet fiery vengance speaks for itself.


    Maybe too powerful??? Hmm...OK got it, simply make the item use magic in the item editor. peice of cake.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #2
    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,389
    Level
    18
    vBActivity - Bars
    Lv. Percent
    70.78%

    Re: Scripted LWeapon items #1

    ...You can spawn weapons now?

  3. #3
    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,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.09%

    Re: Scripted LWeapon items #1

    Oops... I had a capitol L in there... :| It's fixed now!
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  4. #4
    I shall exalt myself over all Armagedddon Games bigjoe's Avatar
    Join Date
    Apr 2000
    Age
    39
    Posts
    5,618
    Mentioned
    87 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,572
    Level
    24
    vBActivity - Bars
    Lv. Percent
    93.34%

    Re: Scripted LWeapon items #1

    Heres you a video. You can link to it in your main post if you wish.

    http://www.youtube.com/watch?v=1nqf3Gj4DCs

  5. #5
    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,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.09%

    Re: Scripted LWeapon items #1

    Quote Originally Posted by bigjoe View Post
    Heres you a video. You can link to it in your main post if you wish.

    http://www.youtube.com/watch?v=1nqf3Gj4DCs
    Thank you bigjoe! I'll do that. By the way, you know you can hold down the B Button for the flamethrower right? Also was there a bug with the boomerang sprites? I think the problem may be that Link Needs the original boomerang item for the sprites to display correctly.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  6. #6
    Octorok sps999's Avatar
    Join Date
    Feb 2007
    Age
    28
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,084
    Level
    11
    vBActivity - Bars
    Lv. Percent
    33.45%

    Re: Scripted LWeapon items #1

    Umm... there is no variable for the weapons (WPN_FIRE,WPN_WAND,WPN_BRANG) so it won't work for me.

  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,141
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.29%
    I bet there was at this time last year...
    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 sps999's Avatar
    Join Date
    Feb 2007
    Age
    28
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,084
    Level
    11
    vBActivity - Bars
    Lv. Percent
    33.45%

    Re: Scripted LWeapon items #1

    my bad... I still keep thinking it's 2008...

  9. #9
    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,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.09%

    Re: Scripted LWeapon items #1

    Should work fine now. I also updated the speed variables for the new step format.

    PS: I still love the multi-rang and the flame *hold down the B button*thrower! :heart:

    Code:
    int fire3;
    int wand2;
    
    
    
    global script global_2{
    
    	void run(){
    
    		int attack_delay;
    
    		while(true){
    
    			Waitframe();
    
    			int lx = Link->X; int ly = Link->Y;
    
    			if(attack_delay>0)attack_delay--;
    			if(Link->InputB && fire3>0){
    
    				if(attack_delay==0){
    					attack_delay = 6;
    
    					lweapon laser = Screen->CreateLWeapon(LW_FIRE);
    					
    					if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
    					else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
    					else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
    					else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
    					laser->Step=200;
    					laser->Damage=2;
    					laser->CSet=8;
    					Game->PlaySound(13);
    				}
    			}
    			else fire3=0;
    		}
    	}
    }
    
    item script flamethrower_item{
    	void run(){
    		fire3=3;
    	}
    }
    
    
    item script wand_lv2{
    	void run(int tile){
    
    		int d = 2; // damage
    		int c = 7; // cset
    		int s = 300; // speed
    
    		int t = Link->Dir;
    
    		int lx = Link->X; int ly = Link->Y;
    
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(LW_MAGIC);
    					
    		if(Link->Dir==0){laser->Dir=0;laser->X=lx;laser->Y=ly-16;}
    		else if(Link->Dir==1){laser->Dir=1;laser->X=lx;laser->Y=ly+16;}
    		else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly;}
    		else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly;}
    		laser->Step=s;laser->Tile=tile+t;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(LW_MAGIC);
    					
    		if(Link->Dir==0){laser->Dir=0;laser->X=lx+8;laser->Y=ly-16;}
    		else if(Link->Dir==1){laser->Dir=1;laser->X=lx+8;laser->Y=ly+16;}
    		else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly+8;}
    		else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly+8;}
    		laser->Step=s;laser->Tile=tile+t;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(LW_MAGIC);
    					
    		if(Link->Dir==0){laser->Dir=0;laser->X=lx-8;laser->Y=ly-16;}
    		else if(Link->Dir==1){laser->Dir=1;laser->X=lx-8;laser->Y=ly+16;}
    		else if(Link->Dir==2){laser->Dir=2;laser->X=lx-16;laser->Y=ly-8;}
    		else{ laser->Dir=3;laser->X=lx+16;laser->Y=ly-8;}
    		laser->Step=s;laser->Tile=tile+t;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    		if(wand2>=0){
    		lweapon laser = Screen->CreateLWeapon(WLW_MAGIC);
    					
    		if(Link->Dir==0){laser->Dir=1;laser->X=lx;laser->Y=ly+16;laser->Tile=tile+1;}
    		else if(Link->Dir==1){laser->Dir=0;laser->X=lx+8;laser->Y=ly-16;laser->Tile=tile;}
    		else if(Link->Dir==2){laser->Dir=3;laser->X=lx+16;laser->Y=ly;laser->Tile=tile+3;}
    		else{ laser->Dir=2;laser->X=lx-16;laser->Y=ly;laser->Tile=tile+2;}
    		laser->Step=s;
    		laser->Damage=d;
    		laser->CSet=c;
    		Game->PlaySound(32);
    		}
    	}
    }
    
    
    item script boomerang_multi{
    	void run(){
    
    	int s = 300; // b_rang speed
    	int c = 11;
    
    		lweapon fire1 = Screen->CreateLWeapon(LW_BRANG);
    		fire1->Step=s;
    		fire1->Damage=0;
    		fire1->CSet=c; // cset
    		Game->PlaySound(4);
    
    
    		if(Link->InputLeft && Link->InputUp){
    			fire1->X = Link->X - 16; 
    			fire1->Y = Link->Y - 16;
    			fire1->Dir=4;
    		}
    		else if(Link->InputRight && Link->InputUp){
    			fire1->X = Link->X + 16; 
    			fire1->Y = Link->Y - 16;
    			fire1->Dir=5;
    		}
    		else if(Link->InputLeft && Link->InputDown){
    			fire1->X = Link->X - 16; 
    			fire1->Y = Link->Y + 16;
    			fire1->Dir=6;
    		}
    		else if(Link->InputRight && Link->InputDown){
    			fire1->X = Link->X + 16; 
    			fire1->Y = Link->Y + 16;
    			fire1->Dir=7;
    		}
    		else{
    			if(Link->Dir == 0) {
    				fire1->X = Link->X; 
    				fire1->Y = Link->Y - 16;
    				fire1->Dir=0;
    			}
    			if(Link->Dir == 1) {
    				fire1->X = Link->X; 
    				fire1->Y = Link->Y + 16;
    				fire1->Dir=1;
    			}
    			if(Link->Dir == 2) {
    				fire1->X = Link->X - 16; 
    				fire1->Y = Link->Y;
    				fire1->Dir=2;
    			}
    			if(Link->Dir == 3) {
    				fire1->X = Link->X + 16; 
    				fire1->Y = Link->Y;
    				fire1->Dir=3;
    			}
    		}
    	}
    }

    Unfortunately there's alot of scripts that need to be updated. (basically every thread in the showcase forum from 2008 and prior) Best thing to do is bump them if the poster is still active and you want to use them.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  10. #10
    Octorok sps999's Avatar
    Join Date
    Feb 2007
    Age
    28
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,084
    Level
    11
    vBActivity - Bars
    Lv. Percent
    33.45%

    Re: Scripted LWeapon items #1

    Pass 1: Parsing
    Pass 2: Preprocessing
    Pass 3: Building Symbol Tables
    TMP, Line 117: Error S09: Variable LW_Brang is undeclared.
    TMP, Line 60: Error S09: Variable LW_Magic is undeclared.
    TMP, Line 72: Error S09: Variable LW_Magic is undeclared.
    TMP, Line 84: Error S09: Variable LW_Magic is undeclared.
    TMP, Line 96: Error S09: Variable WLW_Magic is undeclared. //Possibly a typo in the script?
    TMP, Line 24: Error S09: Variable LW_Fire is undeclared.

    -- Press a key --

    ------------------------------------------------------------------------

    Still not working, pretty much same problem as the start.

    ---EDIT---EDIT---EDIT---EDIT---EDIT---EDIT---EDIT---EDIT---EDIT---
    Well, turns out I just needed to import std.zh, all that typing of that error message was useless. Still, I suppse I did point out that typo, "WLW_Magic."

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