Jump to content

Photo

Rafting


  • Please log in to reply
6 replies to this topic

#1 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 20 December 2017 - 06:18 PM

Just wondering if this script exists (not making a request).

 

A script that lets Link face different directions and use items while rafting on raft paths.



#2 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 20 December 2017 - 07:34 PM

You probably want to use that https://www.purezc.n...=scripts&id=137



#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 21 December 2017 - 05:15 AM

I don't recall if that script requires raft paths.


You cannot affect the internal rafting sequence in any way that would allow using items on whole rafting. The only way to allow using internal raft mechanics, and doing anythimg else, would require hacking fake item code into a global active script.

To fake Link's direction, or to allow him to be hurt, eould require hacks that make Link invisible, and draw a tile over the raft; or create simulated collision and damage, respectively.

I experimented with using items while swimmimg, in this way: FWIF, you can run item scripts from the Lens of Truth while raftinfg, or swimming, IIRC, which gives you one hackish avenue to create weapons or events while doing either.

Be careful though, as prior to 2.53.0, the lens can steal item scripts from other items, it it does not have its own. I advise placing this on all lens of truth items that do not otherwise run a script, as a sanity net:



Link is invincible while rafting in ga way that scripts cannot disable. If his action abruptly changed from LA_RAFTING to e.g., LA_ATTACKING, then the rafting sequence would instantly stop, over water.

It is much saner to script the entire sequence. I'm not fond of ffc rafts, or ffc platforms that span screens: They are too prone to bugs.

My mechanics for this are always code in the active script that runs prior to Waitdraw().

In essence, I set Link->Z and Link->Jump > 0, I draw a tile over Link, I draw Link over the tile, and I copy his weapons to the appropriate layer.

If Link must move on the platform, while the platform moves Link, I use black magic and Sith secrets. his weapons to the appropriate layer. If Link must move on the platform, while the platform moves Link, I use black magic and Sith secrets.
  • Anthus likes this

#4 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 21 December 2017 - 07:49 AM

wow, sounds like too much work. thanks for the info



#5 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 December 2017 - 12:25 PM

wow, sounds like too much work. thanks for the info

Aye, it is. Link can have only one action at a time. Rafting is an action, and attacking is an action. You can see why that would be a problem, if you want to do both simultaneously.

#6 Anthus

Anthus

    Lord of Liquids

  • Members
  • Location:Ohio

Posted 22 December 2017 - 11:38 PM

Zoria, when you say "hack a fake item script into a global script" what exactly does that mean? Is it to say, use ZScript in a way not intended normally, and make it think it is doing something else? I'm just curious, cause I've heard of these instances where people have to "hack" ZScript.



#7 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 23 December 2017 - 05:37 AM

Zoria, when you say "hack a fake item script into a global script" what exactly does that mean? Is it to say, use ZScript in a way not intended normally, and make it think it is doing something else? I'm just curious, cause I've heard of these instances where people have to "hack" ZScript.


Something like this:

int rafting_item;
global script a
{
	
	void run()
	{
		lweapon waterwpn[2];
		while(1)
		{
			if ( Link->Action == LA_RAFTING ) 
			{
				rafting_item = GetEquipmentB();
			
				if ( Link->PressB ) //B items 
				{
					if ( rafting_item == I_ARROW ) 
					{
						if ( Game->Counter[CR_ARROWS] > 0 )
						{
							waterwpn[0] = Screen->CreateLWeapon(LW_ARROW);
							waterwpn[0]->UseSprite(SPR_ARROW); 
							waterwpn[0]->Damage = 2;
						}
					}
					else if ( rafting_item == I_BOOMERANG ) 
					{
						waterwpn[0] = Screen->CreateLWeapon(LW_BRANG);
						waterwpn[0]->UseSprite(SPR_BRANG); 
						waterwpn[0]->Damage = 0;
					}
					else if ( rafting_item == I_WAND ) 
					{
						if ( Game->Counter[CR_MAGIC] > 0 )
						{
							Game->Counter[CR_MAGIC] -= 8;
							waterwpn[0] = Screen->CreateLWeapon(LW_MAGIC);
							waterwpn[0]->UseSprite(SPR_MAGIC); 
							waterwpn[0]->Damage = 4;
						}
					}
					else //non-handled items. 
					{
						waterwpn[0] = Screen->CreateLWeapon(LW_SPARKLE);
						waterwpn[0]->HitXOffset = -32768;
						waterwpn[0]->DrawXOffset = -32768;
					}
					
					if ( waterwpn[0]->isValid() )
					{
						waterwpn[0]->X = Link->X; 
						waterwpn[0]->Y = Link->Y;
						if ( Link->InputUp ) 
						{
							waterwpn[0]->Dir = DIR_UP;
							//also adjust the wpn position based on its type and sprite. 
							if ( Link->InputRight )  //diagonal inputs handling
							{
								if ( Link->Dir == DIR_RIGHT ) 
								{
									waterwpn[0]->Dir = DIR_RIGHT;
									//also adjust the wpn position based on its type and sprite. 
								}
							}
							if ( Link->InputLeft ) 
							{
								if ( Link->Dir == DIR_LEFT ) 
								{
									waterwpn[0]->Dir = DIR_LEFT;
									//also adjust the wpn position based on its type and sprite. 
								}
							}
						}
						if ( Link->InputDown ) 
						{
							waterwpn[0]->Dir = DIR_DOWN;
							//also adjust the wpn position based on its type and sprite. 
							if ( Link->InputRight )  //diagonal inputs handling
							{
								if ( Link->Dir == DIR_RIGHT ) 
								{
									waterwpn[0]->Dir = DIR_RIGHT;
									//also adjust the wpn position based on its type and sprite. 
								}
							}
							if ( Link->InputLeft ) 
							{
								if ( Link->Dir == DIR_LEFT ) 
								{
									waterwpn[0]->Dir = DIR_LEFT;
									//also adjust the wpn position based on its type and sprite. 
								}
							}
						}
						if ( Link->InputLeft ) 
						{
							waterwpn[0]->Dir = DIR_LEFT;
							//also adjust the wpn position based on its type and sprite. 
						}
						if ( Link->InputRight ) 
						{ 
							waterwpn[0]->Dir = DIR_RIGHT;
							//also adjust the wpn position based on its type and sprite. 
						}
					}
				}
				if ( Link->PressA ) 
				{
					//major hack alert!
					//script a sword slash here:
					//waterwpn[1] = Screen->CreateLWeapon(LW_BEAM); ;//Because we cannopt create swords. 
				}
			}
			Waitdraw();
			Waitframe();
		}
	}
}



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users