Jump to content

Photo

Link's one heart->warp


  • Please log in to reply
5 replies to this topic

#1 Kallineon

Kallineon

    Initiate

  • Members
  • Real Name:Phelan
  • Location:Croatia

Posted 25 December 2010 - 12:33 AM

1. can anyone write a script for Link's one heart->warp...that means when overwhelming boss almost kill you and before death, Link must be warped to another dmap or screen on map...and when he is warped, then comes cutscene...
Link's trigger autowarp is when he have one heart remains...that is something like metroid fusion, battle with final boss omega metroid

http://www.youtube.c...h?v=-APjIRTials

...currently I can't remember any of other examples, but this is a good one

2. can you send me push start->warp script...it's disappear from script showcase...

and one more question: can you fire a beam (which is shaped like arrows) and have animation for that beam
thnx

#2 MarioBrosCom

MarioBrosCom

    Adept

  • Members
  • Real Name:Stylianos
  • Location:Canada

Posted 25 December 2010 - 01:40 PM

Here's a no-win script that plays a message when you're low on health and sidewarps you away:

CODE
//**
//* Play a message and warp Link away when health passes a certain threshold
//* D0 = critical the amount of HP to consider a critical amount and trigger the warp.
//* D1 = string the string to play when low on health.
//* D2 = min_delay the number of frames to wait before warping if Link enters the screen low on health.
//*/
ffc script NoWin {
    void run(int critical, int string, int min_delay) {
        if (Link->HP <= critical) Waitframes(min_delay);
        else while (Link->HP > critical) Waitframe();
        Link->HP = Max(Link->HP, 1); // Prevent game over
        if (string > 0) {
            Screen->Message(string);
        }
        Waitframe();
        this->Data = CMB_AUTOWARPA;
    }
}

CMB_AUTOWARPA is any combo with the combo type Auto Side Warp, and should be declared somewhere outside this script.

I don't have the original title screen warp, but I can give you one with a few modifications I made:

CODE
// Draw a Press Start-like blinking string on the screen.
void draw_blinking_string(int layer, int x, int y, int font, int color,
    int background_color, int format, int ptr, int opacity, int init_time,
    int interval) {
    
    int sess_time = (Game->Time - init_time) * 10000;
    // As of build 1296, Game->Time increments at 0.0001/frame, and not
    // in 60ths of a second. If this ever changes, remove the *10000 part
    // from the line above and replace it with /60 to set interval in terms of seconds.
    if (sess_time % interval <= interval / 2.0) {
        Screen->DrawString(layer, x, y, font, color, background_color, format,
            ptr, opacity);
    }
}

//**
//* Warp Link to another screen after pressing start, padded with several delays.
//* D0 = dly1 the delay before allowing the player to press start.
//* D1 = dly2 the delay between the player pressing start and warping.
//* D2 = sfx the sfx to play when the player presses start.
//* D3 = start_string unimplemented, define the start_string in the body of the script.
//*/
ffc script StartWarp{
    void run(int dly1, int dly2, int sfx, int start_string){
        int interval = 120;
        Waitframes(dly1);
        int t1 = Game->Time;
        int start_game[] = "Press Start";
        while(!(Link->InputStart)) {
            draw_blinking_string(6, 120, 152, FONT_Z3, 1, -1, TF_CENTERED,
                start_game, 128, t1, interval);
            Waitframe();
        }
        Link->InputStart = false;
    Game->PlaySound(sfx);
    Waitframes(dly2);
        this->Data = CMB_AUTOWARPA;
    }
}

Set everything to 0 to use it as a plain Press Start script. You can remove the call to draw_blinking_string if you don't want to have the text show at all. I added the extra parameters so I could set it to transition more smoothly.


#3 Rastael

Rastael

    744

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 25 December 2010 - 02:57 PM

Just a question:
Is it possible to make such things, when Link's zero hearts? (for instance a kind of fairy-potion that heals you, insteed of dying, like the fairys-in-bottles of the other Zeldagames)

#4 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 25 December 2010 - 06:45 PM

There is already one (Fairy Bottle script) here; look in Scripting Practice or Script Requests, I'm not sure where I saw it on one or the other of the two subforums, but look in Scripting Practice first.

Edit: Ontopic; One of the scripts that MarioBrosCom posted was by Moo2wo (I think). It does come in handy for intro bosses (Maybe an early fight against Ganon?), one alteration is that it could activate when Link reaches 0HP and not kill him. That may require a fair bit of scripting knowlege, but it would be much more smoother rather than activating when Link has 1 heart left or something like that


Edited by Orin XD, 25 December 2010 - 07:01 PM.


#5 Kallineon

Kallineon

    Initiate

  • Members
  • Real Name:Phelan
  • Location:Croatia

Posted 26 December 2010 - 02:08 AM

QUOTE(MarioBrosCom @ Dec 25 2010, 07:40 PM) View Post

Here's a no-win script that plays a message when you're low on health and sidewarps you away:

CODE
//**
//* Play a message and warp Link away when health passes a certain threshold
//* D0 = critical the amount of HP to consider a critical amount and trigger the warp.
//* D1 = string the string to play when low on health.
//* D2 = min_delay the number of frames to wait before warping if Link enters the screen low on health.
//*/
ffc script NoWin {
    void run(int critical, int string, int min_delay) {
        if (Link->HP <= critical) Waitframes(min_delay);
        else while (Link->HP > critical) Waitframe();
        Link->HP = Max(Link->HP, 1); // Prevent game over
        if (string > 0) {
            Screen->Message(string);
        }
        Waitframe();
        this->Data = CMB_AUTOWARPA;
    }
}

CMB_AUTOWARPA is any combo with the combo type Auto Side Warp, and should be declared somewhere outside this script.

I don't have the original title screen warp, but I can give you one with a few modifications I made:

CODE
// Draw a Press Start-like blinking string on the screen.
void draw_blinking_string(int layer, int x, int y, int font, int color,
    int background_color, int format, int ptr, int opacity, int init_time,
    int interval) {
    
    int sess_time = (Game->Time - init_time) * 10000;
    // As of build 1296, Game->Time increments at 0.0001/frame, and not
    // in 60ths of a second. If this ever changes, remove the *10000 part
    // from the line above and replace it with /60 to set interval in terms of seconds.
    if (sess_time % interval <= interval / 2.0) {
        Screen->DrawString(layer, x, y, font, color, background_color, format,
            ptr, opacity);
    }
}

//**
//* Warp Link to another screen after pressing start, padded with several delays.
//* D0 = dly1 the delay before allowing the player to press start.
//* D1 = dly2 the delay between the player pressing start and warping.
//* D2 = sfx the sfx to play when the player presses start.
//* D3 = start_string unimplemented, define the start_string in the body of the script.
//*/
ffc script StartWarp{
    void run(int dly1, int dly2, int sfx, int start_string){
        int interval = 120;
        Waitframes(dly1);
        int t1 = Game->Time;
        int start_game[] = "Press Start";
        while(!(Link->InputStart)) {
            draw_blinking_string(6, 120, 152, FONT_Z3, 1, -1, TF_CENTERED,
                start_game, 128, t1, interval);
            Waitframe();
        }
        Link->InputStart = false;
    Game->PlaySound(sfx);
    Waitframes(dly2);
        this->Data = CMB_AUTOWARPA;
    }
}

Set everything to 0 to use it as a plain Press Start script. You can remove the call to draw_blinking_string if you don't want to have the text show at all. I added the extra parameters so I could set it to transition more smoothly.


script error:for no-win script says:TMP, LINE 17:ERROR S09: VARIABLE CMB_AUTOWARPA IS UNDECLARED

and for press start script says:TMP, LINE 38:ERROR S09: VARIABLE CMB_AUTOWARPA IS UNDECLARED
that script for press start is one script?...it looks like 2 scripts, but I was compile whole...


CMB_AUTOWARPA is any combo with the combo type Auto Side Warp, and should be declared somewhere outside this script.

oh I'm blind...can you explain that?"and should be declared somewhere outside this script." that's confusing me... I'm beginner


#6 MarioBrosCom

MarioBrosCom

    Adept

  • Members
  • Real Name:Stylianos
  • Location:Canada

Posted 26 December 2010 - 11:12 AM

You should set up a blank combo with the combo type Auto Side Warp and keep track of the combo number displayed in the title. Then, add this line to the top of your script:

CODE
int CMB_AUTOWARPA = #;


Replace the # with the number I asked you to keep track of.

I should also note, since you're a beginner, that HP is in 1/16ths of a heart, so if you want to set the threshold to 1 heart, you'll need to set D0 to 16.

QUOTE(Orin XD @ Dec 25 2010, 06:45 PM) View Post

There is already one (Fairy Bottle script) here; look in Scripting Practice or Script Requests, I'm not sure where I saw it on one or the other of the two subforums, but look in Scripting Practice first.

Edit: Ontopic; One of the scripts that MarioBrosCom posted was by Moo2wo (I think). It does come in handy for intro bosses (Maybe an early fight against Ganon?), one alteration is that it could activate when Link reaches 0HP and not kill him. That may require a fair bit of scripting knowlege, but it would be much more smoother rather than activating when Link has 1 heart left or something like that

I ended up writing this myself (but never posted it). It's such a short script that a lot of it is probably similar, though I don't think the one you're referring to had a min_delay either.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users