PDA

View Full Version : [2.50.2 and Above]Setting Link->Action = LA_CASTING No Longer Works



ZoriaRPG
12-18-2016, 12:19 AM
Reported by Alucard, and confirmed. Setting LA_CASTING worked in 2.50.,0 and 2.50.1, but ceased working in 2.50.2.

test script:


import "std.zh"

global script a{
void run(){
int timer = 120;
while(true){
if ( Link->PressEx1 ) {
while ( --timer) { Link->Action = LA_CASTING; Waitframe(); }
timer = 120;
}
Waitdraw(); Waitframe();
}
}
}

Saffith
12-18-2016, 12:48 AM
I don't see it working in the older versions. Could you make a quest?

action is set back to none if no magic item has been used, and that's always been the case. I don't see why it would ever have worked.

ZoriaRPG
12-18-2016, 04:38 AM
I don't see it working in the older versions. Could you make a quest?

action is set back to none if no magic item has been used, and that's always been the case. I don't see why it would ever have worked.

I saw that in link.cpp. i was going to go in and try to fix it, but I don't see what could have caused it to work. I had some files from 2.50.1, and even there, I see nothing.

Alucard claims it did, and I'm waiting for a reply. I feel as if I have set it before, back in 2.50.0, but IDK if it worked or not. I suppose I could make a patch to make it work, but I have no idea if the result would be useful, because without a clk value to control it, there isn't much for it to do. The magic items all have a clock for their animation, so I guess a generic clock would work, that has a 100 frame count, or something.



if(magicitem==-1)
{
if ( --castclock <= 0 ) { action = none; castclock = 90; }
}

break;


Something like that.

Adding that var to the class shouldn't affect much in 2.50.3, AFAIK, but this is speculative in general. I'll test that next build and see if it works at all.
I'll wait for is reply, but I'm still trying to sort out the flipping npc script defs. IDK if you checked in on that thread, but after adding the code to the loader, everything is going mad. I'm uploading that source and bins, and I'll post them in that thread, if you want to have a look while I check into this LA_CASTING business.


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

Edit: Hmph. In link.cpp, switch(new_action), i did:



case casting:
if ( !magiccastclk ) magiccastclk = 96;
action = casting;
break;


and in switch(action)



case casting:
if(magicitem==-1)
{
if ( --magiccastclk <= 0 ) { action = none; }
}

break;


Doing that froze link for the 96 frames that I specified, but it didn't change his sprite. If I can get his sprite to change to the casting sprite, that will work; so I suppose that counts as progress?

------

When determining what version of ZC a quest was mad ein, should I be using one of these:

-=SPOILER=-

...or



#define ZELDA_VERSION 0x0254 //version of the program
#define VERSION_BUILD 32 //build number of this version


or something else?

If I knew where the check for how bitmap placement is handled was located, that would be a good template.

I need to set up a check to determine if a quest was made in 2.50.3 or earlier, versus this, so that checking edefSCRIPT for all types still occurs in quests designed with that in mind.

Saffith
12-19-2016, 01:50 PM
There's no mechanism for checking the quest version during the game. All the "if version then behavior" stuff is set up during quest loading, and I'd rather keep it that way. For weapon defenses, I'd prefer to add weapon->Defense, which would indicate which defense should be used for the weapon. That would be more flexible and wouldn't need any special handling for backward compatibility.

ZoriaRPG
12-19-2016, 02:54 PM
Well, for the time being, I fixed the problem. Now these things work from ZQuest's enemy editor, and all is well in the world.