Re: Making Link Invisible
Why are you posting binary at me :confused:
I'm afraid I don't understand that at all.
I have Link with no shield, wooden, big and mirror, then I have climbing tiles for each. Each set of Links takes up three rows, plus I have a labelling row before each row of Links. Thus 3 sheets. I think I might be able to squeeze in an extra sheet for invisible Link though, especially if I remove the label rows.
Re: Making Link Invisible
Well what I was getting at was you could alter your invisibility script for one, to check Link's current equipment before assigning a Link tile mod to him. (Although it'd still be easier to free up more tilepages...jeez, that's ridiculous...)
..I'm assuming it's an invisibility cloak or something.
Re: Making Link Invisible
No no, I want to play an animation via drawtile when you play the whistle. The script doesn't seem to do anything at the moment though...
Re: Making Link Invisible
Quote:
I want to play an animation via drawtile when you play the whistle. The script doesn't seem to do anything at the moment
You should post the script, another pair (or better yet many pairs) of eyes often help see the *kicks self* type mistakes that we all make when looking at something too closely and for too long.
Re: Making Link Invisible
Quote:
Originally Posted by
ShadowMancer
You should post the script, another pair (or better yet many pairs) of eyes often help see the *kicks self* type mistakes that we all make when looking at something too closely and for too long.
I've typed: " state_counter == 3;" when I meant "state_counter = 3" waaaay to many times. Hard to find, won't generate an error message, royally fucks up the code.
Re: Making Link Invisible
Dyu know what possibly the best thing ever for mistakes like that is?
The 'Replace' tool on notepad.
It seriously saved me about 2 hours writing that snow combo script.
Code:
item script whistle{
void run(){
int timer = 20;
int tile = 54793;
int cset = 6;
while(timer > 0){
timer--;
Screen->DrawTile(3, Link->X, Link->Y, tile, 1, 1, cset, 1, 0, 0, 0, 3, true, 128);
}
}
}
Anyway, that's what I have so far for the whistle script. I haven't made Link invisible or put in the animation on the drawtile function yet, but what I have there doesn't seem to want to do anything at all...
I think I might be putting it on the item wrong though, I'm not very familliar with item scripts.
Re: Making Link Invisible
Your problem is that item scripts only execute for one frame.. well a couple of problems actually. The script you have (even if it was an FFC or Global script) has no waitframe so it goes through and draws what you want until the timer reaches 0 then *poof* disapears at the next call of Waitframe. Drawing functions only draw for each frame they are called then the screen is refreshed.. sooo you probley want to have the item script set a global varible to 'true' then do the animation (put a waitframe in the while loop) and just set the global var back to 'false' at the end of the loop.
Also, if you only want Link invisible durring the animation, just draw something on say Layer 6 above him, and freeze movement by setting all the input keys to false until the animation is over, but if that is not what you want then just ignore this :)
Re: Making Link Invisible
You don't need LTMs if link is invisible for a whole screen. Use one of the settings that was in V1.92- Invisible Link in the screen flags menu.
Re: Making Link Invisible
Ahhh, thankyou ShadowMancer.
I knew Waitframe(); didn't work for item scripts, so I thought - I know, I'll have a while loop which loops for 20 frame via the timer, but obviously that doesn't work. I'll have a go at adding into the global script then. Thankyou.
EDIT: oh, but of course that doesn't make it wait a frame though, because there's no waitframe. It just loops 20 times. >_<
EDIT:
Code:
while(usewhistle == 1){
Game->PlaySound(33);
Link->Item[invis] = true;
Screen->ComboT[ComboAt(0,0)] = thisType;
if(timer > 10){Screen->DrawTile(2, Link->X, Link->Y, tile, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);}
if(timer > 20 && timer <= 10){Screen->DrawTile(2, Link->X, Link->Y, tile+1, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);}
if(timer > 30 && timer <= 20){Screen->DrawTile(2, Link->X, Link->Y, tile+2, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);}
if(timer > 40 && timer <= 30){Screen->DrawTile(2, Link->X, Link->Y, tile+3, 1, 1, 6, 1, 0, 0, 0, 0, true, 128);}
if(timer == 40){usewhistle = 0; Link->Item[invis] = false; Screen->ComboT[ComboAt(0,0)] = thisType;}
timer++;
Waitframe();
}
So now I have this while loop added into my global script, and
Code:
item script whistle_animation{
void run(){
usewhistle = 1;
}
}
this as the item script.
I have the whistle's sound effect set to 0, because if you don't the script doesn't activate till after it's played.
However what happens at the moment is:
when you play the whistle the first time, Link dissapears for a frame, then the first tile only of the animation appears, the sound effect plays, then Link becomes visible again.
then when you play it the second time, Link becomes permanently invisible, no sound effect plays, and you get the first tile of the drawtile animation stuck on Link enabling you to walk around as a graphic of Link playing the ocarina. Oh dear...
Re: Making Link Invisible
timer > 20 && timer <= 10 ??? Can timer be greater then 20 And less then 10 at the same time.. Common mistakes check all your logic, seems like the script should work with the proper logic.
Also, make sure you set timer back to 0 before running the loop again. (this is why Link stays invisibal, timer is already greater then 40 so: if(timer == 40){usewhistle = 0; Link->Item[invis] = false; never gets called)