Jump to content

Photo

Attack Ring


  • Please log in to reply
36 replies to this topic

#1 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 07:36 PM

So, basically, the idea is that I'd like an item that works like the defensive rings, but rather than dividing the damage taken by link, it would multiply the damage link does with all weapons. I was looking at this for a possible solution to a problem I'm having with the subscreens and item overrides (namely that making multiple levels of multiple items in multiple slots with the same itemclass is a little too much for the engine to handle, apparently). So... yeah, is something like this possible? 



#2 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 30 July 2013 - 08:09 PM

I'm sure it's possible. I'd wager it involves duplicating every (attack-related) item such that the clone does double damage, (and you can give it a nice shiny aura or something too.) then the attack ring is just a useless trinket with a pick-up script that checks to see if you have any past varieties of items you've already gotten and gives you the cloned versions, and enables all future items picked up to go immediately to their cloned double-damage version. Something to that effect.

#3 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 July 2013 - 08:30 PM

Untested but should work. One constant to set.

const int MISC_LW_BOOSTED = 0; //Weapon->Misc[] slot for boosted weapons

float attackRingPower = 1; //Global variable; gets changed by attackRingPickup

global script active{
    void run(){
        while(true){
            for(int i = 1; i <= Screen->NumLWeapons(); i++){
                lweapon weap = Screen->LoadLWeapon(i);
                if(weap->Misc[MISC_WEAP_BOOSTED] == 0){
                    weap->Damage *= attackRingPower;
                    weap->Misc[MISC_LW_BOOSTED] == 1;
                }
            }
            Waitframe();
        }
    }
}

//D0: The power of this attack ring (can be integer or decimal)
item script attackRingPickup{
    void run(float power){
        attackRingPower = Max(attackRingPower, power);
    }
}

Let me know if you want a modification to allow multiple tiers of rings.


Edited by MoscowModder, 31 July 2013 - 10:24 AM.
Renamed constant and global

  • Timelord likes this

#4 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 08:38 PM

Hmmm.... I don't think it would do what i need it to if it just cloned items, I thought of this idea so that I could have 10 separate swords, but they're all going to have the same power, just different elemental attributes, so if I could make higher level versions of the same weapons and get it to work, I'd just do that (easier, and more profitable, in that the players have to spend more money upgrading individually) Basically, I want all of the swords to be viable weapons, so I could put high level grass monsters in the last dungeon and still use the fire sword (which you get at the end of level 1). I'm explaining badly. I want to be able to do thing like have a level 2 water sword AND a level 2 fire sword, but I don't think it can be done like that, because item override can only affect one item at a time, it can't make multiple level items hold the same slot, so I'd need, instead, something that simply adds a multiplier. If it has to use cloned items or anything like that, I'm about 99.9% certain it won't work. BUT, if I can just make ONE of each sword and get the damage to multiply globally with each ring, it'll be exactly what i need. Except I'm starting to think that there's no way to do that. Which means I have to go back to the drawing board AGAIN.

 

EDIT: Oh, THanks, MoscowModder, I'll test it right away. Sorry, was still typing when you posted, I think.

 

FURTHER EDIT: Yeah, I'd like tiered versions of the ring, sorry.


Edited by Lineas, 30 July 2013 - 08:48 PM.


#5 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 July 2013 - 09:39 PM

No big deal. Edited above.

 

Note: you'll probably need to restart your ZC save file.



#6 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 09:52 PM

Ok, it compiled just fine, now to see how it works.

 

EDIT: The float set up in the code says 2, so does the d0 argument ignore that, or does the D0 argument get multiplied by 2?


Edited by Lineas, 30 July 2013 - 09:55 PM.


#7 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 30 July 2013 - 10:22 PM

Oh yeah, change it to 1 in the code. Then, each time you get an attack ring it will increase that value to whatever you set its D0 to. If it's less than the current value it will be ignored so you can't accidentally downgrade your ring.



#8 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 30 July 2013 - 10:35 PM

Ok, and just to be sure, I set the I_ATTACKRING constant to the item number of the level one attack ring only? And then "keep lower level items" and the further ones just change the multiplier, right?

 

EDIT:Oh, also, what am I supposed to use for  the "MISC_WEAP_BOOSTED" value? The number of the item? Or does it do all of them at once? That line confuses me, lol.


Edited by Lineas, 31 July 2013 - 02:38 AM.


#9 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 31 July 2013 - 10:22 AM

Oops, don't need that I_ATTACKRING constant anymore. Updated above.

 

Unless you have another script that uses LWeapon->Misc[] variables, you can leave MISC_WEAP_BOOSTED at 0. If you're unsure, you can show me your complete script, but you probably won't. That's just the index of the variable to store whether each weapon has been boosted. If that doesn't make sense to you, that's okay. Just leave it at 0.



#10 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 31 July 2013 - 11:25 AM

Oh, ok, I get that. Makes perfect sense, now that you explain it. Ok, I'm having some problems, now

 

Lines 122, 298; Error S09: variable attackRingPower is undeclared

line 121; Error S09: Variable MISC_WEAP_BOOSTED is undeclared

 

Did I need to define constants for those two?

 

Never mind, one was a capitalization error, and one I needed to add a constant for. It compiled, now.


Edited by Lineas, 31 July 2013 - 11:29 AM.


#11 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 31 July 2013 - 11:45 PM

So.... I finally got everything implemented and ready to test, so I started a new game and.... the music plays but nothing else happens. It freezes up.



#12 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 01 August 2013 - 12:50 PM

You may have multiple waitframe() statements. That happened to me a while back.

When it happened to me, the music played, but no movement or button press action registered, and I had to force-quit ZC.

 

Post your entire global active script for debugging please.

 

This is a very brilliant script, BTW MM. I was pondering something similar for weapons and for armour; particularly something that reduces damage by X, rather than halving or quartering, etc. I'm hoping to have a selection of magical rings in my game, from which the player can select to wear only one or two at a time, and this will add to my manifest of new and interesting mystical items nicely.

 

I do think that this would function better with a bool statement to enable or disable it. I'm working on a way to do that for several passive items, and for Alucard's game, to have a subweapon that automatically changes by picking up a new one, discarding whatever the player already has.


Edited by ZoriaRPG, 01 August 2013 - 12:56 PM.


#13 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 01 August 2013 - 02:02 PM

//Common Constant, only need to define once per script file. 
const int BIG_LINK                                              = 0;   //Set this constant to 1 if using the Large Link Hit Box feature. 
 
//Constants used by Bottomless Pits & Lava. 
const int CT_HOLELAVA                     = 128; //Combo type to use for pit holes and lava."No Ground Enemies by default" 
const int CF_PIT                                                                = 98;  //The combo flag to register combos as pits. 
const int CF_LAVA                                                 = 99;  //The combo flag to register combos as lava. 
const int WPS_LINK_FALL           = 88;  //The weapon sprite to display when Link falls into a pit. "Sprite 88 by default" 
const int WPS_LINK_LAVA           = 89;  //The weapon sprite to display when Link drowns in lava. "Sprite 89 by default" 
const int SFX_LINK_FALL           = 38;  //The sound to play when Link falls into a pit. "SFX_FALL by default" 
const int SFX_LINK_LAVA           = 55;  //The sound to play when Link drowns in Lava. "SFX_SPLASH by default. 
const int CMB_AUTOWARP                  = 888; //The first of your four transparent autowarp combos. 
const int HOLELAVA_DAMAGE                 = 8;   //Damage in hit points to inflict on link. "One Heart Container is worth 16 hit points" 
 
//Global variables used by Bottomless Pits & Lava. 
int Falling; 
bool Warping; 
 
//Global variables used by Attack Ring
float ATTACKRING_POWER = 1; //How much to multiply damage by (allows decimals)

const int MISC_LW_BOOSTED = 0; //Weapon->Misc[] slot for boosted weapons

const int MISC_WEAP_BOOSTED = 0;
    
global script slot2 
{ 
        void run() 
        { 
                //Initialize variables used to store Link's strating position on Screen Init. 
                int olddmap = Game->GetCurDMap(); 
                int oldscreen = Game->GetCurDMapScreen(); 
                int startx = Link->X; 
                int starty = Link->Y; 
                int startdir = Link->Dir; 
 
                //Clear global variables used by Bottomless pits. 
                Falling = 0; 
                Warping = false; 


                //Main Loop 
                while(true) 
                { 
			//Stops enemies from dropping ammunition items that Link doesn't have a way to carry (Bomb bag, quiver, etc.).
			for ( int i = 1; i <= Screen->NumItems(); i++) 
			{ 

				item drop = Screen->LoadItem(i);
				if ( (drop->ID == I_ARROWAMMO1 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_ARROWAMMO10 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_ARROWAMMO30 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_ARROWAMMO5 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_BOMBAMMO1 && !Link->Item[I_BOMBBAG1])
				|| ( drop->ID == I_BOMBAMMO4 && !Link->Item[I_BOMBBAG1])
				|| ( drop->ID == I_BOMBAMMO8 && !Link->Item[I_BOMBBAG1])
				|| ( drop->ID == I_BOMBAMMO30 && !Link->Item[I_BOMBBAG1]) )
					Remove (drop);
                    //hard-coded Self-upgrading drops
                if ( (drop->ID == I_SWORD1 && !Link->Item[I_SWORD1])) 
                    Remove (drop); //This checks if you have the wooden sword, if not, it removes the drop
                if ( (drop->ID == I_SWORD1 && Link->Item[I_SWORD1]))
                    drop->ID = I_SWORD2; //This checks if you have the wooden sword, if you do, it changes the picked up item to the white sword
                if ( (drop->ID == I_SWORD2 && Link->Item[I_SWORD2]))
                    drop->ID = I_SWORD3; //THis checks if you have the white sword, if you do, it replaces it with the magic sword
                if ( (drop->ID == I_SWORD3 && Link->Item[I_SWORD3]))
                    drop->ID = I_SWORD4;  //This checks if you have the magic sword, if you do, it replaces it with the master sword 
                
                //Attack Ring script body
                for(int i = 1; i <= Screen->NumLWeapons(); i++){
                lweapon weap = Screen->LoadLWeapon(i);
                if(weap->Misc[MISC_WEAP_BOOSTED] == 0){
                    weap->Damage *= ATTACKRING_POWER;
                    weap->Misc[MISC_LW_BOOSTED] == 1;
                }
            }
		

            }
 
			}
	
                        if(Link->Action != LA_SCROLLING) 
                        { 
                                Update_HoleLava(startx, starty, olddmap, oldscreen, startdir); 
                                if(Link->Z==0 && !Falling && (oldscreen != Game->GetCurDMapScreen() || olddmap != Game->GetCurDMap())) 
                                { 
                                        olddmap = Game->GetCurDMap(); 
                                        oldscreen = Game->GetCurDMapScreen(); 
                                        startx = Link->X; 
                                        starty = Link->Y; 
                                        startdir = Link->Dir; 
                                } 
                        } 
                        Waitframe(); 
                } 
        }  
//Handles Pit Combo Functionality. 
void Update_HoleLava(int x, int y, int dmap, int scr, int dir) 
{ 
        lweapon hookshot = LoadLWeaponOf(LW_HOOKSHOT); 
        if(hookshot->isValid()) return; 
 
        if(Falling) 
        { 
                Falling--; 
                if(Falling == 1) 
                { 
                        int buffer[] = "holelava"; 
                        if(CountFFCsRunning(Game->GetFFCScript(buffer))) 
                        { 
                                ffc f = Screen->LoadFFC(FindFFCRunning(Game->GetFFCScript(buffer))); 
                                Warping = true; 
                                if(f->InitD[1]==0) 
                                { 
                                        f->InitD[6] = x; 
                                        f->InitD[7] = y; 
                                } 
                        } 
                        else 
                        { 
                                Link->X = x; 
                                Link->Y = y; 
                                Link->Dir = dir; 
                                Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000); 
                                Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000); 
                                Link->HP -= HOLELAVA_DAMAGE; 
                                Link->Action = LA_GOTHURTLAND; 
                                Link->HitDir = -1; 
                                Game->PlaySound(SFX_OUCH); 
                                if(Game->GetCurDMap()!=dmap || Game->GetCurDMapScreen()!=scr) 
                                        Link->PitWarp(dmap, scr); 
                        } 
                        NoAction(); 
                        Link->Action = LA_NONE; 
                } 
         } 
         else if(Link->Z==0 && OnPitCombo() && !Warping) 
         { 
                        Link->DrawXOffset += Cond(Link->DrawXOffset < 0, -1000, 1000); 
                        Link->HitXOffset += Cond(Link->HitXOffset < 0, -1000, 1000); 
                        int comboflag = OnPitCombo(); 
                        SnaptoGrid(); 
                        Game->PlaySound(Cond(comboflag == CF_PIT, SFX_LINK_FALL, SFX_LINK_LAVA)); 
                        lweapon dummy = CreateLWeaponAt(LW_SCRIPT10, Link->X, Link->Y); 
                        dummy->UseSprite(Cond(comboflag == CF_PIT, WPS_LINK_FALL, WPS_LINK_LAVA)); 
                        dummy->DeadState = dummy->NumFrames*dummy->ASpeed; 
                        dummy->DrawXOffset = 0; 
                        dummy->DrawYOffset = 0; 
                        Falling = dummy->DeadState; 
                        NoAction(); 
                        Link->Action = LA_NONE; 
        } 
} 

I was only able to find one waitframe in the global. There are 2 in the FFC for the lava and pits, but those shouldn't affect the global, and the whole global worked before I added in the attack ring.


But yeah, isn't it (The attack ring script) just awesome, though? I saw a topic the other day about difficulty level, (before I needed this item for my quest) and I was thinking, you could use an item bundle and my self upgrading drop script to make a difficulty setting easily: Make all the enemies balanced for the blue ring at the start of the game, then start the players in a room, easy setting gives them the red ring and attack ring (x2) at the start, normal gives them blue ring, and hard gives them a regular green tunic and attack ring (x0.5). Then, you set all the rings like you normally would, and code them into the upgrader, so if you're  on hard mode and you find the blue ring, you turn blue, if you're on normal, you'll get the red ring, instead, and if you're on easy, you'll get the gold ring. And just as soon as I can confirm this attack ring script to be working properly, I will go and post this idea in that thread, too.


Edited by Lineas, 01 August 2013 - 02:09 PM.


#14 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 01 August 2013 - 08:13 PM

Yeah, the problem is definitely somewhere in the global script, I pulled it out of slot 2 (but left the script compiled) and it worked, but when I tried to remove just the attack ring section (from the code), it didn't solve anything, so the error must be somewhere else...


Edited by Lineas, 01 August 2013 - 08:54 PM.


#15 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 02 August 2013 - 01:43 AM

Ok, weird thing, I checked out the script in my test quest file, and it was still working with the attack ring and everything, so I exported it, and imported the script into my main quest, and now it works. Still don't know what was wrong (EDIT: Never mind, I can see the line of code I was missing before), but whatever it was, it's fixed now. And everything seems to work. Except for the attack ring, which seems to do nothing at all

import "std.zh"
import "ffcscript.zh"
import "string.zh"

item script PotionSpecial
{
	void run(int a,int b, int c)
	{

		if(a==0){Link->HP+=b;}
		if(a==1){Link->MP+=c;}
		if(a==2){Link->HP+=b;Link->MP+=c;}
	
	}
}


item script DummyItem
{
	void run(int ItemID)
	{
		Link->Item[ItemID] = true;
	}
}

item script ItemBundle
{
	void run(int a, int b, int c, int d)
	{
		Link->Item[a] = true;
		Link->Item[b] = true;
		Link->Item[c] = true;
		Link->Item[d] = true;
	}
}


ffc script TFReqItem 
{ 
	void run(int itemID, int triforceCount)
	{ 
		if ( Screen->State[ST_ITEM] ) 
		return; 
                                                
		item drop = CreateItemAt(itemID, this->X, this->Y); 
                                 
		drop->Pickup |= IP_ST_ITEM; 
                                                 
		if ( NumTriforcePieces() < triforceCount ) 
		drop->Pickup |= IP_DUMMY; 
	} 
}
//Common Constant, only need to define once per script file. 
const int BIG_LINK                                              = 0;   //Set this constant to 1 if using the Large Link Hit Box feature. 
 
//Constants used by Bottomless Pits & Lava. 
const int CT_HOLELAVA                     = 128; //Combo type to use for pit holes and lava."No Ground Enemies by default" 
const int CF_PIT                                                                = 98;  //The combo flag to register combos as pits. 
const int CF_LAVA                                                 = 99;  //The combo flag to register combos as lava. 
const int WPS_LINK_FALL           = 88;  //The weapon sprite to display when Link falls into a pit. "Sprite 88 by default" 
const int WPS_LINK_LAVA           = 89;  //The weapon sprite to display when Link drowns in lava. "Sprite 89 by default" 
const int SFX_LINK_FALL           = 38;  //The sound to play when Link falls into a pit. "SFX_FALL by default" 
const int SFX_LINK_LAVA           = 55;  //The sound to play when Link drowns in Lava. "SFX_SPLASH by default. 
const int CMB_AUTOWARP                  = 888; //The first of your four transparent autowarp combos. 
const int HOLELAVA_DAMAGE                 = 8;   //Damage in hit points to inflict on link. "One Heart Container is worth 16 hit points" 
 
//Global variables used by Bottomless Pits & Lava. 
int Falling; 
bool Warping; 
 
//Global variables used by Attack Ring
const int I_ATTACKRING = 0; //Attack ring item number
float ATTACKRING_POWER = 1; //How much to multiply damage by (allows decimals)

const int MISC_WEAP_BOOSTED = 0; //Weapon->Misc[] slot for boosted weapons
  
global script slot2 
{ 
        void run() 
        { 
                //Initialize variables used to store Link's strating position on Screen Init. 
                int olddmap = Game->GetCurDMap(); 
                int oldscreen = Game->GetCurDMapScreen(); 
                int startx = Link->X; 
                int starty = Link->Y; 
                int startdir = Link->Dir; 
 
                //Clear global variables used by Bottomless pits. 
                Falling = 0; 
                Warping = false; 


                //Main Loop 
                while(true) 
                { 
			//Stops enemies from dropping ammunition items that Link doesn't have a way to carry (Bomb bag, quiver, etc.).
			for ( int i = 1; i <= Screen->NumItems(); i++) 
			{ 

				item drop = Screen->LoadItem(i);
				if ( (drop->ID == I_ARROWAMMO1 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_ARROWAMMO10 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_ARROWAMMO30 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_ARROWAMMO5 && !Link->Item[I_QUIVER1])
				|| ( drop->ID == I_BOMBAMMO1 && !Link->Item[I_BOMBBAG1])
				|| ( drop->ID == I_BOMBAMMO4 && !Link->Item[I_BOMBBAG1])
				|| ( drop->ID == I_BOMBAMMO8 && !Link->Item[I_BOMBBAG1])
				|| ( drop->ID == I_BOMBAMMO30 && !Link->Item[I_BOMBBAG1]) )
					Remove (drop);
                    
                    //Self-upgrading drop
                if ( (drop->ID == I_SWORD1 && !Link->Item[I_SWORD1])) 
                    Remove (drop); //This checks if you have the wooden sword, if not, it removes the drop
                if ( (drop->ID == I_SWORD1 && Link->Item[I_SWORD1]))
                    drop->ID = I_SWORD2; //This checks if you have the wooden sword, if you do, it changes the picked up item to the white sword
                if ( (drop->ID == I_SWORD2 && Link->Item[I_SWORD2]))
                    drop->ID = I_SWORD3; //THis checks if you have the white sword, if you do, it replaces it with the magic sword
                if ( (drop->ID == I_SWORD3 && Link->Item[I_SWORD3]))
                    drop->ID = I_SWORD4;  //This checks if you have the magic sword, if you do, it replaces it with the master sword 
                
                //Attack ring body
                if(Link->Item[I_ATTACKRING]){                  
                    for(int i = 1; i <= Screen->NumLWeapons(); i++){
                    lweapon weap = Screen->LoadLWeapon(i);
                    if(weap->Misc[MISC_WEAP_BOOSTED] == 0){
                        weap->Damage *= ATTACKRING_POWER;
                        weap->Misc[MISC_WEAP_BOOSTED] == 1;
                    }
                }
 
            }
 
			}
	
                        if(Link->Action != LA_SCROLLING) 
                        { 
                                Update_HoleLava(startx, starty, olddmap, oldscreen, startdir); 
                                if(Link->Z==0 && !Falling && (oldscreen != Game->GetCurDMapScreen() || olddmap != Game->GetCurDMap())) 
                                { 
                                        olddmap = Game->GetCurDMap(); 
                                        oldscreen = Game->GetCurDMapScreen(); 
                                        startx = Link->X; 
                                        starty = Link->Y; 
                                        startdir = Link->Dir; 
                                } 
                        } 
                        Waitframe(); 
                } 
        }  
//Handles Pit Combo Functionality. 
void Update_HoleLava(int x, int y, int dmap, int scr, int dir) 
{ 
        lweapon hookshot = LoadLWeaponOf(LW_HOOKSHOT); 
        if(hookshot->isValid()) return; 
 
        if(Falling) 
        { 
                Falling--; 
                if(Falling == 1) 
                { 
                        int buffer[] = "holelava"; 
                        if(CountFFCsRunning(Game->GetFFCScript(buffer))) 
                        { 
                                ffc f = Screen->LoadFFC(FindFFCRunning(Game->GetFFCScript(buffer))); 
                                Warping = true; 
                                if(f->InitD[1]==0) 
                                { 
                                        f->InitD[6] = x; 
                                        f->InitD[7] = y; 
                                } 
                        } 
                        else 
                        { 
                                Link->X = x; 
                                Link->Y = y; 
                                Link->Dir = dir; 
                                Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000); 
                                Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000); 
                                Link->HP -= HOLELAVA_DAMAGE; 
                                Link->Action = LA_GOTHURTLAND; 
                                Link->HitDir = -1; 
                                Game->PlaySound(SFX_OUCH); 
                                if(Game->GetCurDMap()!=dmap || Game->GetCurDMapScreen()!=scr) 
                                        Link->PitWarp(dmap, scr); 
                        } 
                        NoAction(); 
                        Link->Action = LA_NONE; 
                } 
         } 
         else if(Link->Z==0 && OnPitCombo() && !Warping) 
         { 
                        Link->DrawXOffset += Cond(Link->DrawXOffset < 0, -1000, 1000); 
                        Link->HitXOffset += Cond(Link->HitXOffset < 0, -1000, 1000); 
                        int comboflag = OnPitCombo(); 
                        SnaptoGrid(); 
                        Game->PlaySound(Cond(comboflag == CF_PIT, SFX_LINK_FALL, SFX_LINK_LAVA)); 
                        lweapon dummy = CreateLWeaponAt(LW_SCRIPT10, Link->X, Link->Y); 
                        dummy->UseSprite(Cond(comboflag == CF_PIT, WPS_LINK_FALL, WPS_LINK_LAVA)); 
                        dummy->DeadState = dummy->NumFrames*dummy->ASpeed; 
                        dummy->DrawXOffset = 0; 
                        dummy->DrawYOffset = 0; 
                        Falling = dummy->DeadState; 
                        NoAction(); 
                        Link->Action = LA_NONE; 
        } 
} 
}

ffc script holelava 
{ 
        void run(int warp, bool position, int damage) 
        { 
                while(true) 
                { 
                        while(!Warping) Waitframe(); 
                        if(warp > 0) 
                        { 
                                this->Data = CMB_AUTOWARP+warp-1; 
                                this->Flags[FFCF_CARRYOVER] = true; 
                                Waitframe(); 
                                this->Data = FFCS_INVISIBLE_COMBO; 
                                this->Flags[FFCF_CARRYOVER] = false; 
                                Link->Z = Link->Y; 
                                Warping = false; 
                                Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000); 
                                Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000); 
                                Quit(); 
                        } 
                        if(position) 
                        { 
                                Link->X = this->X; 
                                Link->Y = this->Y; 
                        } 
                        else 
                        { 
                                Link->X = this->InitD[6]; 
                                Link->Y = this->InitD[7]; 
                        } 
                        if(damage) 
                        { 
                                Link->HP -= damage; 
                                Link->Action = LA_GOTHURTLAND; 
                                Link->HitDir = -1; 
                                Game->PlaySound(SFX_OUCH); 
                        } 
                        Link->DrawXOffset -= Cond(Link->DrawXOffset < 0, -1000, 1000); 
                        Link->HitXOffset -= Cond(Link->HitXOffset < 0, -1000, 1000); 
                        Warping = false; 
                        Waitframe(); 
                } 
        } 
} 
 
//Used to determine if Link is on a Pit or Lava combo. 
int OnPitCombo() 
{ 
        int comboLoc = ComboAt(Link->X+8, Link->Y + Cond(BIG_LINK==0, 12, 8)); 
        if(Screen->ComboT[comboLoc] != CT_HOLELAVA) 
                return 0; 
        else if(Screen->ComboI[comboLoc] == CF_PIT || Screen->ComboI[comboLoc] == CF_LAVA) 
                return Screen->ComboI[comboLoc]; 
        else if(Screen->ComboF[comboLoc] == CF_PIT || Screen->ComboF[comboLoc] == CF_LAVA) 
                return Screen->ComboF[comboLoc]; 
        else 
                return 0; 
} 
 
 
//Snaps Link to the combo so he appears completely over pit and lava combos. 
void SnaptoGrid() 
{ 
        int x = Link->X; 
        int y = Link->Y + Cond(BIG_LINK==0, 8, 0); 
        int comboLoc = ComboAt(x, y); 
 
        //X Axis 
        if(Screen->ComboT[comboLoc] == CT_HOLELAVA && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc+1] != CT_HOLELAVA)) 
                Link->X = ComboX(comboLoc); 
        else if(Screen->ComboT[comboLoc+1] == CT_HOLELAVA && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc] != CT_HOLELAVA)) 
                Link->X = ComboX(comboLoc+1); 
        if(Cond(y % 16 == 0, false, Screen->ComboT[comboLoc+16] == CT_HOLELAVA) && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc+17] != CT_HOLELAVA)) 
                Link->X = ComboX(comboLoc+16); 
        else if(Cond(y % 16 == 0, false, Screen->ComboT[comboLoc+17] == CT_HOLELAVA) && Cond(x % 16 == 0, true, Screen->ComboT[comboLoc+16] != CT_HOLELAVA)) 
                Link->X = ComboX(comboLoc+17); 
 
        //Y Axis 
        if(Screen->ComboT[comboLoc] == CT_HOLELAVA && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc+16] != CT_HOLELAVA)) 
                Link->Y = ComboY(comboLoc); 
        else if(Screen->ComboT[comboLoc+16] == CT_HOLELAVA && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc] != CT_HOLELAVA)) 
                Link->Y = ComboY(comboLoc+1); 
        if(Cond(x % 16 == 0, false, Screen->ComboT[comboLoc+1] == CT_HOLELAVA) && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc+17] != CT_HOLELAVA)) 
                Link->Y = ComboY(comboLoc+1); 
        else if(Cond(x % 16 == 0, false, Screen->ComboT[comboLoc+17] == CT_HOLELAVA) && Cond(y % 16 == 0, true, Screen->ComboT[comboLoc+1] != CT_HOLELAVA)) 
                Link->Y = ComboY(comboLoc+17); 
}
//D0: The power of this attack ring
item script attackRingPickup
{
    void run(float power)
    {
        ATTACKRING_POWER = Max(ATTACKRING_POWER, power);
    }
}
 

That's my whole script as it currently stands, any reason why the attack ring isn't functional?

 

EDIT: For the record, I have the arguments on the rings set to 1,2,4,8,16, and 32, but none of them made me able to kill a blue octorok with one shot of the basic sword, whether I had none, or the level 1 or the level 6 item, it was always a 2 hit kill.

 

 

EDIT EDIT: it appears that the line in question was "if(Link->Item[I_ATTACKRING]){". It was part of MM's original script, but he removed it when he added the pickup script (so I could make it a multi-level item) Without that line, the script compiles, but it freezes the game, with that line, it compiles but nothing happens, so I assume the problem is related to the pickup scripts, somehow.


Edited by Lineas, 02 August 2013 - 03:36 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users