?Epona Script?
#1
Posted 05 January 2008 - 11:06 PM
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
Posted 05 January 2008 - 11:09 PM
#3
Posted 06 January 2008 - 10:31 AM
#4
Posted 06 January 2008 - 02:08 PM
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
Posted 06 January 2008 - 03:54 PM
I didn't know you were such advanced at scripting Joe.
#6
Posted 06 January 2008 - 04:10 PM
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
Posted 06 January 2008 - 04:52 PM
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
Posted 06 January 2008 - 05:00 PM
So, how complete is this script, and how do I set it up?
#9
Posted 06 January 2008 - 05:30 PM
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
Posted 06 January 2008 - 06:48 PM
(for Pearl Of Shadows.)
#11
Posted 06 January 2008 - 06:52 PM
Thanks, but, you'll have to watch because it's really not very complete at the moment...
#13
Posted 07 January 2008 - 02:46 AM
I've reported it before but nothing appeared to happen
#14
Posted 07 January 2008 - 05:23 PM
Don't ever let Link pick up items while on Epona though; very, very bad.
//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:
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
I'm going to go post it in Developer's Exchange.
Edited by Joe123, 07 January 2008 - 05:39 PM.
#15
Posted 07 January 2008 - 07:01 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users