Jump to content

Photo

?Epona Script?


  • Please log in to reply
138 replies to this topic

#1 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 05 January 2008 - 11:06 PM

Okay... Well in my quest... I... Kinda need Epona. Is it possible to make a script?

maybe epona can be kinda like a raft?

I need Epona to:

1. go 2x faster than Link
2. to be invincible (enemies can't hurt her.)

I'll add anyone who makes this to the credits section in my game

#2 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 05 January 2008 - 11:09 PM

It is possible, there was a post on AGN about this. No one ever took up it though, it's a big feat to accomplish but, like I said at AGN, I would really love to have it too.

#3 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 06 January 2008 - 10:31 AM

It's okay if nobody wants to do it, if it's too difficult...

#4 Joe123

Joe123

    Retired

  • Members

Posted 06 January 2008 - 02:08 PM

CODE
import "std.zh"

bool epona = false;
bool ep1 = false;
bool ep2 = false;

item script eponassong{
    void run(){
        epona = !epona;
        if(epona){ep1 = true;}
        if(!epona){ep2 = true;}
        Game->PlaySound(33);
    }
}

global script globalscript{
    void run(){
    int eponaLTM = 123;
    int framedelay;
    int speed = 1;
        while(true){
            if(epona){
                if(ep1){
                    //item clk = Screen->CreateItem(I_CLOCK):
                    //clk->X = Link->X;
                    //clk->Y = Link->Y;
                    Link->Item[eponaLTM] = true;
                    Link->SwordJinx = -1;
                    ep1 = false;
                }
                if(Link->Action != LA_FROZEN && Link->Action != LA_ATTACKING){
                    if(Link->InputLeft && Link->Dir == DIR_LEFT){
                        if(framedelay == speed){Link->X = Link->X-1; framedelay = 0;}
                        else{framedelay++;}
                    }
                    if(Link->InputRight && Link->Dir == DIR_RIGHT){
                        if(framedelay == speed){Link->X = Link->X+1; framedelay = 0;}
                        else{framedelay++;}
                    }
                    if(Link->InputUp && Link->Dir == DIR_UP){
                        if(framedelay == speed){Link->Y = Link->Y-1; framedelay = 0;}
                        else{framedelay++;}
                    }
                    if(Link->InputDown && Link->Dir == DIR_DOWN){
                        if(framedelay == speed){Link->Y = Link->Y+1; framedelay = 0;}
                        else{framedelay++;}
                    }
                }
            }else{
                if(ep2){
                    Link->Item[I_CLOCK] = false;
                    Link->Item[eponaLTM] = false;
                    Link->SwordJinx = 0;
                    ep2 = false;
                }
            }
        Waitframe();
        }
    }
}

Well, that is what I have after working at if for 20 mins or so, and since I've run into some ridiculous GlobalScript Carryover bug, I've lost interest for the moment.
Might come back in a bit, but I thought I'd post it now incase I can't be bothered, and someone else wants to take over.

I think it does work to a degree at the moment, it's geared up to be 'Epona's Song' on the ocarina, in that, when you use the item, it plays a SFX to 'call Epona'.

However, at the moment it's still just a 16x16 Epona, it'd be quite a lot more effort to make it any bigger than that, although not impossible.

Couldn't make Link invincible very easily (I'm still not very good at spawning items) and he can still use all of his items, but not the sword, whilst riding.

Use the item again to loose Epona.

Edited by Joe123, 06 January 2008 - 02:08 PM.


#5 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 06 January 2008 - 03:54 PM

This sounds quite hard, but yet very original.
I didn't know you were such advanced at scripting Joe.

#6 Joe123

Joe123

    Retired

  • Members

Posted 06 January 2008 - 04:10 PM

Heh, what I've written isn't too complex really.
A slow walk script that I wrote earlier, and inverted to make Link walk faster, plus a bit of LTM and some boolean manipulation to make it work when you want it to.

I've mastered some parts to a reasonable degree, but I still have a lot to learn.
Like those noted lines in the script, they don't seem to want to work properly for some reason, so I noted them out.

Edited by Joe123, 06 January 2008 - 04:11 PM.


#7 Hoten

Hoten

    Doyen(ne)

  • Members
  • Location:Pearland, Texas

Posted 06 January 2008 - 04:52 PM

You also have to take into account that you don't want Epona coming to you in a dungeon/house 0.o

I'm sure you can restrict the dmaps that this item works in via scripting though.

Edited by Hoten, 06 January 2008 - 04:59 PM.


#8 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 06 January 2008 - 05:00 PM

You don't need scripting to restrict an items use in certain dmaps. You can just go to the tab on the dmap editor that let's you choose what items to disable.

So, how complete is this script, and how do I set it up?

#9 Joe123

Joe123

    Retired

  • Members

Posted 06 January 2008 - 05:30 PM

Not very, you might want to add some to it.

You need to make an LTM item that moves Link's tiles along to some Epona tiles, an item for the activation script, obviously, you need to set the item ID of the LTM item so that it's in place of where it says '123', and you might wanna change the SFX from 33 (which is the whistle) to some other one.

Otherwise, that's pretty much it.
Might want to change the value of 'speed' to change how fast Epona moves though.

Other ideas:
Larger than 16x16 sprite, Link is frozen whilst SFX plays, Link is invicible while on Epona, Link's items (except for the bow?) are disabled whilst Link is on Epona, Link gets off Epona when he steps into interiors.

EDIT: Oh yeah, I have tested this.
Link changing into an Octorok was quite funny =P

Edited by Joe123, 06 January 2008 - 05:30 PM.


#10 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 06 January 2008 - 06:48 PM

Thanks Joe123! icon_biggrin.gif I'll add you to credits right now!
(for Pearl Of Shadows.)

#11 Joe123

Joe123

    Retired

  • Members

Posted 06 January 2008 - 06:52 PM

Oh well...
Thanks, but, you'll have to watch because it's really not very complete at the moment...

#12 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 06 January 2008 - 11:28 PM

QUOTE(Joe123 @ Jan 6 2008, 01:08 PM) View Post

Well, that is what I have after working at if for 20 mins or so, and since I've run into some ridiculous GlobalScript Carryover bug



Epona wow. What kind of bug?


Also, your all crazy...umm, I mean visionaries.

#13 Joe123

Joe123

    Retired

  • Members

Posted 07 January 2008 - 02:46 AM

Oh, it was using the global script from my LA remake file carried over, so I was getting gameboy sized screens and the Epona part just wasn't happening.

I've reported it before but nothing appeared to happen icon_shrug.gif

#14 Joe123

Joe123

    Retired

  • Members

Posted 07 January 2008 - 05:23 PM

Well, I've done some more work on this now, and as a consequence it's a little better thought out, a little more user friendly, the option for everyone (hopefully even people who don't know ZScript) to disable whatever items they like is there, and I've written a script that makes Link get off Epona, and doesn't allow him to get back on again on that screen.

Don't ever let Link pick up items while on Epona though; very, very bad.
CODE
import "std.zh"

//I've included some setup for having Link's items disabled when he rides on Epona. All it requires is some duplication of
//code, and I've included pretty extensive instructions in the required sections, so even non-scripters should be able to
//to it. That's the idea anyway =P.
//The way it works is, when Link picks up each item, the game stores what level of the item he has in a global integer,
//therefore keeping a copy of his inventory closeby at all times. Not difficult by any means, just tedious for me to write
//out really.



bool epona = false;
bool ep1 = false;
bool ep2 = false;

//You'll have to make an integer for each itemclass you want to be disabled when Link rides Epona.
int brang = 0;

global script globalscript{
    void run(){
    int eponaLTM = 123;
    int framedelay = 0;
    int speed = 0;
        while(true){
            if(epona && !ep2){
                if(ep1){
                    //item clk = Screen->CreateItem(I_CLOCK);
                    //clk->X = Link->X;
                    //clk->Y = Link->Y;
                    Link->Item[eponaLTM] = true;
                    Link->SwordJinx = -1;
                    ep1 = false;
                    
                    //These next few lines can be used to remove Link's items while he is riding on Epona
                    //this will require some user-setup though.
                    //You'll have to find the item ID of what you want to disable, and copy one of the
                    //lines below, and then put that item ID in the [] instead.
                    Link->Item[23] = false;
                    Link->Item[24] = false;
                    Link->Item[35] = false;
                }
                if(Link->Action != LA_FROZEN && Link->Action != LA_ATTACKING){
                    if(Link->InputLeft && Link->Dir == DIR_LEFT){
                        if(framedelay == speed){Link->X -= 1; framedelay = 0;}
                        else{framedelay++;}
                    }
                    if(Link->InputRight && Link->Dir == DIR_RIGHT){
                        if(framedelay == speed){Link->X += 1; framedelay = 0;}
                        else{framedelay++;}
                    }
                    if(Link->InputUp && Link->Dir == DIR_UP){
                        if(framedelay == speed){Link->Y -= 1; framedelay = 0;}
                        else{framedelay++;}
                    }
                    if(Link->InputDown && Link->Dir == DIR_DOWN){
                        if(framedelay == speed){Link->Y += 1; framedelay = 0;}
                        else{framedelay++;}
                    }
                }
            }
            if(!epona){
                if(ep2){
                    Link->Item[I_CLOCK] = false;
                    Link->Item[eponaLTM] = false;
                    Link->SwordJinx = 0;
                    ep2 = false;

                    //To re-enable the items when Link gets off of Epona, you'll have to put an if
                    //statement here that has each level of the item (as you've set them with the item
                    //scripts) and then have that set the appropriate item ID to true.
                    if(brang == 1) Link->Item[23] = true;
                    if(brang == 2) Link->Item[24] = true;
                    if(brang == 3) Link->Item[35] = true;
                }
            }
        Waitframe();
        }
    }
}

//For disabling the items, you'll have to make item scripts like this for each item you want removed, and have them reference
//the itemclass numbers you typed above.
//Have it set the level of the item here (the first script sets the integer brang to 1), as you can see, this is 'wbrang',
//for the wooden boomerang, and so it sets the boomerang itemclass integer (brang) to 1.
item script wbrang{
    void run(){
        brang = 1;
    }
}

item script mbrang{
    void run(){
        brang = 2;
    }
}

item script fbrang{
    void run(){
        brang = 3;
    }
}

//This is the activation script for Epona. I've made it into an item that plays a SFX, so the idea is really that it's
//Epona's song on the ocarina, but that's up to you really =)
item script eponassong{
    void run(){
        if(!ep2){
            epona = !epona;
            if(epona){ep1 = true;}
            if(!epona){ep2 = true;}
        }
        Game->PlaySound(33);
    }
}

//This script should make sure that Link can't get on Epona on screens that you don't want him to. He should also get off
//instantly upon entering a screen with this script applied.
ffc script gerroffthathorse{
    void run(){
        while(true){
            ep2 = true;
            epona = false;
        Waitframe();
        }
    }
}


Epona Mark 2.

I still haven't adressed:
Making Link invicible (Just giving him a Clock doesn't solve this, I've tried),
Larger than 16x16 sprite (if anyone can give me a relevant size that they would like the sprite to be, I can have a look)
Link is frozen while SFX plays (if anyone can give me a SFX length in frames, I can do this quite easily also)
Jumps (Dunno how easy this would be, but I'm willing to give it at try perhaps)

EDIT: Oh, sorry for the double post, I thought I hadn't posted since yesterday.

EDIT2:IPB Image
Found some Epona sprites.
Dunno if anyone wants to try do something with them, I could probably make the script use them with some work.
Perhaps.

This website is quite nice in general actually
http://s6.invisionfr...oove/ar/t69.htm
icon_smile.gif

I'm going to go post it in Developer's Exchange.

Edited by Joe123, 07 January 2008 - 05:39 PM.


#15 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 07 January 2008 - 07:01 PM

Here is some Link sprites that come w/ epona!

IPB Image


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users