Jump to content

Photo

Triforce Sound Effect


  • Please log in to reply
24 replies to this topic

#16 klop422

klop422

    Guess I'm full of monsters and treasure

  • Members
  • Real Name:Not George
  • Location:Planet Earth

Posted 26 August 2020 - 04:34 PM

Just tested it: works decently well (though I assume having Link stand there with both his arms up for the whole time might be less easy). Thanks a lot.

 

(I might make a request for this to be an in-built feature though :P)



#17 ywkls

ywkls

    Master

  • Members

Posted 26 August 2020 - 10:53 PM

Just tested it: works decently well (though I assume having Link stand there with both his arms up for the whole time might be less easy). Thanks a lot.

 

(I might make a request for this to be an in-built feature though :P)

Yeah, getting Link to hold things up right via script is kind of tricky.

 

I don't know if Triforce Pieces will ever be able to run scripts (or if that feature was added in 2.53 or 2.55)

Venrob wrote the section which handles the fade from sides animation.

Anyways, glad that this worked out for you!



#18 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 27 August 2020 - 09:29 PM

FWIW, TF pieces in 2.55 all seem to run collect scripts (for one frame). I'm unsure about 2.53.x.

 

 


Yeah, getting Link to hold things up right via script is kind of tricky.

 

err...

void HoldUpItem(int id, int twohands)
{
    int oldaction = Link->Action;
    Link->HeldItem = id;
    if ( oldaction == LA_SWIMMING || oldaction == LA_DIVING || oldaction == LA_GOTHURTWATER )
    {
        Link->Action = Clamp(LA_HOLD1LAND+twohands,LA_HOLD1WATER,LA_HOLD2WATER);
    }
    else Link->Action = Clamp(LA_HOLD1LAND+twohands,LA_HOLD1LAND,LA_HOLD2LAND);
}

That should cover it across all versions. Better solutions require newer ZC builds, but this one is--at least--universal. Holding up an item is easy. Link need not even own it, nor need it be an inventory item. You need only write HeldItem (used to be ItemHeld in pre-2.50.0R, and I may have restored this alias), and set the action type that you want (of the four available to date). 



#19 ywkls

ywkls

    Master

  • Members

Posted 27 August 2020 - 09:49 PM

That should cover it across all versions. Better solutions require newer ZC builds, but this one is--at least--universal. Holding up an item is easy. Link need not even own it, nor need it be an inventory item. You need only write HeldItem (used to be ItemHeld in pre-2.50.0R, and I may have restored this alias), and set the action type that you want (of the four available to date).


What I meant was that while you can write to HeldItem, it doesn't seem to persist for very long.

Same seems to be true of setting Link->Action to LA_HOLD1LAND and other similar things.

 

I don't exactly how to deal with this in older versions (where writing over multiple frames didn't always seem to work for me).

And I'm not sure how of if this was dealt with in newer versions.

Glad to hear Triforce items now obey the laws of physics, though.  :clap:



#20 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 29 August 2020 - 04:07 PM

What I meant was that while you can write to HeldItem, it doesn't seem to persist for very long.

Same seems to be true of setting Link->Action to LA_HOLD1LAND and other similar things.

 

I don't exactly how to deal with this in older versions (where writing over multiple frames didn't always seem to work for me).

And I'm not sure how of if this was dealt with in newer versions.

Glad to hear Triforce items now obey the laws of physics, though.  :clap:

 

 

I am quite confused by this. I verified in 2.53, and TF collect scripts run there, so they would have also run in 2.50.x.

 

Here is a quest with some tests. The scripts are in the buffer. On screen 0x67, you will find a TF fragment with a collect script, and on screen 0x66 I put an amulet that uses a collect script that calls HeldItem/Link->Action = HOLD1LAND. The duration of these animations never changes, unless you overwrite ->Action. If you prolong it by re-writing, then you would likely need to re-write HeldItem, too, as it may clear that when you overwrite Action.

 

There is certainly no need to write it for multiple frames for it to persist for its engine duration.

 

Tell me if this doesn't work in 2.50.2. Perhaps I fixed this without knowing, but I suspect that that is not the case. TF Fragments could also run item action scripts before, AFAIR, but only for one frame. I am pretty sure that I used that in TGC/LoE, as each of the Sernarani was a unique item that could be used to cast spells.



#21 ywkls

ywkls

    Master

  • Members

Posted 29 August 2020 - 11:00 PM

I think I may have inadvertently confused you.

I didn't mean that you couldn't write LA_HOLD1LAND and its assorted cousins to Link->Action.

What I meant was that detecting that was chancy at best.

One of the scripts that I have assigns different scripted animations based on Link->Action.

But when it came to the "holding up item" class, always seemed to ignore directions to change the animation based on that.

As for whether Triforce pieces can run pickup scripts prior to 2.53 I can confirm that they don't. 

I checked on the same quest in 2.50.2 and 2.53 to be sure. 

Though both had pickup scripts, neither ran them.



#22 klop422

klop422

    Guess I'm full of monsters and treasure

  • Members
  • Real Name:Not George
  • Location:Planet Earth

Posted 30 August 2020 - 07:13 AM

It's possible some scripts run and some don't? If so, would likely be related to exactly what script it is and what they're doing. Avaro's script in this thread didn't seem to work, but I've seen people say an itembundle does work. I don't know how it works behind the scenes, but it seems like music stuff at least doesn't work or is overridden by TF pieces

#23 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 30 August 2020 - 10:02 PM

I think I may have inadvertently confused you.

I didn't mean that you couldn't write LA_HOLD1LAND and its assorted cousins to Link->Action.

What I meant was that detecting that was chancy at best.

One of the scripts that I have assigns different scripted animations based on Link->Action.

But when it came to the "holding up item" class, always seemed to ignore directions to change the animation based on that.

As for whether Triforce pieces can run pickup scripts prior to 2.53 I can confirm that they don't. 

I checked on the same quest in 2.50.2 and 2.53 to be sure. 

Though both had pickup scripts, neither ran them.

 

Sorry but that's untrue. I tried the test quest in 2.50.2 and the collect script ran. The script prints a trace, and that trace was logged in a versions.

 

What quest are you using and how are you testing it?

 

Now it's certainly plausible that trying to play music with scripts won't work as ZC forces all active music off during the cutscene; and the collect script runs prior to that, but the script does run.

 

I added another flag (Don't affect music) to 2.55A83 to prevent that conflict. I also made a slight change so that even with the internal cutscene the action script can run during every frame of the cutscene. The user can make it pause during the cutscene with a flag.

 

FWIW, the action script could literally use while(Link->Action == LA_HOLD2LAND) instead of while(true).

 

IDK why you had issues with holding item actions, but I can confidently say that if you read Action and ink is holding an item, it will return the correct action type during the entirety of the animation.



#24 ywkls

ywkls

    Master

  • Members

Posted 30 August 2020 - 10:32 PM

Sorry but that's untrue. I tried the test quest in 2.50.2 and the collect script ran. The script prints a trace, and that trace was logged in a versions.

 

What quest are you using and how are you testing it?

 

Now it's certainly plausible that trying to play music with scripts won't work as ZC forces all active music off during the cutscene; and the collect script runs prior to that, but the script does run.

My own quest, Balance of Nature.

It had an item pickup script attached to the Triforce Piece that is supposed to play a message.

When playing in either 2.50.2 or 2.53 it doesn't run the script.

Even turning the flag "Side Warp Out" off doesn't seem to change this.

So, I'm not certain what you're doing which I'm not.


Edited by ywkls, 30 August 2020 - 10:33 PM.


#25 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 31 August 2020 - 04:29 PM

My own quest, Balance of Nature.

It had an item pickup script attached to the Triforce Piece that is supposed to play a message.

When playing in either 2.50.2 or 2.53 it doesn't run the script.

Even turning the flag "Side Warp Out" off doesn't seem to change this.

So, I'm not certain what you're doing which I'm not.

 

Screen messages may also be cleared during/aborted by the cutscene, as it calls ALLOFF(). I'll look into that.

 

You can be certain if a script runs by tacking a trace onto it as the first instruction of its run() function. I always do this, and then remove those traces when I am ready to deploy as it helps me to view what is happening in-game, and it alerts me when something isn't running--hence how I realised that lweapon scripts did not run on sparkle weapons.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users