Jump to content

Photo

Links Awakening Stuff?


  • Please log in to reply
20 replies to this topic

#1 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 18 March 2022 - 12:00 PM

Hello, im currently working on a quest  (https://www.purezc.n...showtopic=74033)

 

and was looking for the following

 

1) Links Awakening Item Scripts for Sword (hold down to spin up)

 

2) Enemy Scripts for Swordfighting (currently only able to shoot)

 

etc... basically Links Awakening Scripts and stuff, i couldnt find much in Scripts OR even how to use them i would be glad for any help :)



#2 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 19 March 2022 - 09:34 AM

also can pay if someone is interested in making some of these :)



#3 Aslion

Aslion

    End Fascism

  • Members
  • Real Name:Ryan
  • Location:Plug One's spectacles

Posted 19 March 2022 - 12:47 PM

The spin attack is a native feature in ZC, just give the player the item Scroll: Spin Attack. The Charge Ring class of items can change how long it takes to charge, and the Charge Ring 2 will pretty closely mimic how long it takes to charge in LA.



#4 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 19 March 2022 - 01:23 PM

Thanks, i tried that altho id love to have it automatically spawn with the weapon, but i guess that can be fixed later now it doesnt seem to work tho?

 

https://www.youtube....h?v=fNgh0118juQ

 

 

also after the 2nd which is the Swordfighting im stuck on this Treasure Chest Script, i made the chest, i made the FCC Script as seen here, but when i click the Chest nothing happens except he opens it?

 

590f5091ce.png

 

35202d319c.png

// GB Treasure Chest by ~Nimono~
// Make sure to set the CSet of the FFC to the CSet you want the chest to be in!
// Variables:
// DValue: Which Screen->D[] to use to track the chests. Make sure to pick one not currently in use by other scripts!
// D0 chestCombo: The starting combo for your chest, used to make sure you can't reopen chests again. The script changes it to its next combo, so make sure the open chest is the very next combo!
// D1 openSFX: What sound effect ID to play upon opening the chest.
// D2 receiveSFX: What sound to play upon receiving the item.
// D3 itemID: The item to give to the player upon opening the chest.
// ^ on 0 use screen's special item ID.

// D4 receiveMessage: Which message to display upon receiving the item.
// D5 itemDisplay: Whether or not to display the item rising from the chest. 0 = do not display, anything else = display.
// ^ I changed this to standard to 0 to display rising animation.

// D6 lockValue: Whether or not to have the chest be locked. 0 = no lock, 1 = regular key required; 2 = boss key required.
// If you are using ghost.zh, uncomment out SuspendGhostZHScripts() and ResumeGhostZHScripts().

const int DValue = 5; // change this to change which Screen->D value the chest data is stored into, to avoid conflicts with other scripts that use them

ffc script GBChest
{
	void run(int chestCombo, int openSFX, int receiveSFX, int itemID, int receiveMessage, int itemDisplay, int lockValue)
	{
		if(itemID == 0)
		{
			itemID = Screen->RoomData;
		}
		int holdType = 0;
		while(true)
		{
			if(Screen->D[DValue]&ConvertToBit(GetFFCNum(this)))
			{
				for(int i; i < 16; i++)
				{
					if(Screen->ComboF[ComboAt(this->X, this->Y)] == i+16)
					{
						Screen->ComboF[ComboAt(this->X, this->Y)] = 0;
					}
				}
				Game->SetComboData(Game->GetCurMap(), Game->GetCurScreen(), ComboAt(this->X, this->Y), chestCombo+1);
				Game->SetComboCSet(Game->GetCurMap(), Game->GetCurScreen(), ComboAt(this->X, this->Y), this->CSet);
			}
			if(LinkCollision(this) && Link->Dir == DIR_UP && Link->X < this->X + 4 && Link->X > this->X - 4)
			{
				if(CenterLinkY() > CenterY(this) && Link->InputA && Screen->ComboD[ComboAt(this->X, this->Y)] == chestCombo && (lockValue == 0 || (lockValue == 1 && Game->Counter[CR_KEYS] > 0) || (lockValue == 1 && Game->LKeys[Game->GetCurLevel()] > 0) || (lockValue == 2 && Game->LItems[Game->GetCurLevel()]&LI_BOSSKEY)))
				{
					Link->InputA = false;
					Link->PressA = false;
					
					
					if(lockValue == 1)
					{
						if(Game->LKeys[Game->GetCurLevel()] > 0)
						{
							Game->LKeys[Game->GetCurLevel()] -= 1;
						}
						else
						{
							Game->DCounter[CR_KEYS] = -1;
						}
					}
					NoAction();
					//SuspendGhostZHScripts();
					Game->PlaySound(openSFX);
					Game->SetComboData(Game->GetCurMap(), Game->GetCurScreen(), ComboAt(this->X, this->Y), chestCombo+1);
					holdType = Screen->ComboT[ComboAt(this->X, this->Y)];
					Screen->ComboT[ComboAt(this->X, this->Y)] = CT_SCREENFREEZE;
					Screen->D[DValue] |= ConvertToBit(GetFFCNum(this));
					int itemRaise = 0;
					for(int i; i < 28; i++)
					{
						if(itemDisplay == 0)
						{
							item Temp = CreateItemAt(itemID, 0, 0);
							Screen->FastTile(2, this->X, this->Y-8+itemRaise, Temp->OriginalTile, Temp->CSet, OP_OPAQUE);
							Remove(Temp);
							itemRaise-=0.25;
						}
						NoAction();
						if(i==27)
						{
							Screen->ComboT[ComboAt(this->X, this->Y)] = holdType;
						}
						Waitframe();
					}
					NoAction();
					
					bool MsgAndSFXPlayed = false;
					
					item Box = CreateItemAt(itemID, Link->X, Link->Y);
					if(itemDisplay > 0)
					{
						item Temp = CreateItemAt(itemID, 0, 0);
						Screen->FastTile(2, this->X, this->Y-8+itemRaise, Temp->OriginalTile, Temp->CSet, OP_OPAQUE);
						
						
						Game->PlaySound(receiveSFX);
						Screen->Message(receiveMessage);
						MsgAndSFXPlayed = true;
						
						Remove(Temp);
					}
					if(Screen->Flags[SF_ITEMS]&1)
					{
						Box->Pickup|=IP_HOLDUP;
					}
					
					if(MsgAndSFXPlayed == false){
						Game->PlaySound(receiveSFX);
						Screen->Message(receiveMessage);
					}
					
					//ResumeGhostZHScripts();
				}
			}
			Waitframe();
		}
	}
}

int GetFFCNum(ffc thisffc)
{
	for(int i = 1; i < 32; i++)
	{
		ffc checkffc = Screen->LoadFFC(i);
		if(checkffc == thisffc)
		{
			if(i < 17)
			{
				return i;
			}
			else
			{
				return i-16;
			}
		}
	}
	return NULL;
}

int ConvertToBit(int num)
{
	return 1 << (num-1);
}

 



#5 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 19 March 2022 - 01:39 PM

If you are using the combo type 'Chest (Basic)', that means the combo is a chest, in-engine, no script required. You can click the '?' button next to the combo type, as well as any flags and attributes on the combo, for information about how to set it up.

 

Items can be given in-engine pickup strings in the item editor.

 

Chests... don't have an opening sound, though. I probably should add that...

 

That chest script... looks quite a bit complicated. If you do want a script instead of the engine chest behavior, I made one recently (combodata script, not ffc script)



#6 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 19 March 2022 - 01:58 PM

Thanks, i tried that but nothing

 

the FCC has -> Next and open from bottom the Script is Chest closed

 

the next FCC has Script Open and the same InitD as the previous one and Item 10 for test

 

but nothing happens once i open the Chest?

 

5f18b51c80.png

a4cb99a9b0.png



#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 19 March 2022 - 05:18 PM

Combo scripts don't run on FFCs, you have to place the combo on the screen. Also, by default, they only run on layer 0; though you can change what layers they can run on in "ZScript->Quest Script Settings".



#8 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 20 March 2022 - 01:56 AM

Combo scripts don't run on FFCs, you have to place the combo on the screen. Also, by default, they only run on layer 0; though you can change what layers they can run on in "ZScript->Quest Script Settings".

sorry i ment Combos i changed it to layer0 ANS scripts to run on layer0 and it works

 

 

but does that mean i now need 100s of chest combos for each item in there?

 

 

also does anyone know of a existing script for swordfighting enemies or hurricane slash?


Edited by Heffernans, 20 March 2022 - 02:13 AM.


#9 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 20 March 2022 - 06:55 AM

If you read the instructions, you would see:

 *     -InitD[1] = Item ID in the chest.
 *                     Set to '-1' to use the screen item.
 *                     Set to '-2' to use the screen catchall value.

so, you can make it set using screen data. I don't recommend using the screen item (SLG wanted that, so I added it, but it's not the best idea); the screen catchall is easy to use though. That means you can have one combo, and it will use the screen's catchall. If you want *more than one chest per screen*, you'll need additional combos.



#10 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 23 March 2022 - 04:41 PM

few more questions if i may

 

1) is there a tutorial on Doors/Keys?

2) i got a script i used (https://www.purezc.n...=scripts&id=250) can someone tell me how to remove the reusable key part from this?

3) How do i set doors or chests to when all enemies are dead?

 

thx



#11 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 24 March 2022 - 12:18 PM

few more questions if i may

 

1) is there a tutorial on Doors/Keys?

2) i got a script i used (https://www.purezc.n...=scripts&id=250) can someone tell me how to remove the reusable key part from this?

3) How do i set doors or chests to when all enemies are dead?

 

thx

1. Not that I know of... If you want to use NES dungeon doors, you mostly just use F6 (Screen->Doors).

2. Why are you using that script then? The reusable key seems to be the entire point? Just use engine lockblocks.

3. NES dungeon 'Shutters' will open when enemies die normally, I believe? Aside from that, you can use the 'Enemies->Secret' screen flag to make killing all enemies trigger screen secrets.



#12 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 24 March 2022 - 12:30 PM

1) thx i have this beautiful screen (i think) but i want the door unlocked by a key so i was windering what i need

 

9ea87194eb.png

 

2) the script is fairly easy its just a FCC Action script and i dont know how to use engine lockblocks

 

3) thx ill try that.



#13 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 24 March 2022 - 03:45 PM

1) thx i have this beautiful screen (i think) but i want the door unlocked by a key so i was windering what i need

 

2) the script is fairly easy its just a FCC Action script and i dont know how to use engine lockblocks

 

3) thx ill try that.

1) That isn't set up for an NES dungeon door layout... so, for that, I'd use engine lockblocks.

2) That's far more complicated than engine lockblocks.

 

So, engine lockblocks. You place the lockblock. You walk into it with a key. The lockblock changes into the "Next" combo in the list, and stays that way.

...That's it.



#14 Heffernans

Heffernans

    Experienced Forumer

  • Members

Posted 17 June 2022 - 03:45 PM

does anyone might have a cue why a script might not work? i put a script into /scripts/  compiled it in the quest, added it to action script of a item but nothing?

i use this one https://www.purezc.n...e=scripts&id=35

 

512f576b2c.png



#15 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 17 June 2022 - 05:06 PM

does anyone might have a cue why a script might not work? i put a script into /scripts/ compiled it in the quest, added it to action script of a item but nothing?

i use this one https://www.purezc.n...e=scripts&id=35

512f576b2c.png


have you got the global script set up too? the code’s in the supplied script - you just need to put it in your own global code to call it whenever

also do you have your link tile modifiers set up?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users