"Cover-up" Script
#1
Posted 23 February 2008 - 07:24 PM
So, all I need is a FFC script that checks for fired projectiles, and "covers" them with a FFC that faces the correct direction that it's going.
#2
Posted 23 February 2008 - 08:16 PM
Not too difficult.
#3
Posted 23 February 2008 - 11:24 PM
Nice workaround method BTW. Kinda like my Press R to shield method.
#4
Posted 24 February 2008 - 05:13 AM
I was thinking about doing it before with the boomerang actually, so that we could have one that cut grass.
Anyway, your code would want to look a bit like this:
item script arrow{
void run(){
int spd = 1; // You'll have to work out what the speed of the arrows are, by leaving graphics on the arrow sprites and sending the ffc along at the same time, until you get it right.
int cmb = 0; // Set here the combotype of the up-facing arrow combo. Combos should be arranged 'Up, Down, Left, Right' on the page.
ffc arw = Screen->LoadFFC(32);
arw->X = Link->X; arw->Y = Link->Y;
if(Link->Dir == 0){
arw->Vy = -spd;
arw->Data = cmb;
}
if(Link->Dir == 1){
arw->Vy = spd;
arw->Data = cmb+1;
}
if(Link->Dir == 2){
arw->Vx = -spd;
arw->Data = cmb+2;
}
if(Link->Dir == 3){
arw->Vx = spd;
arw->Data = cmb+3;
}
}
}
Should work, but you'll have to find out the speed of the arrow yourself.
#5
Posted 24 February 2008 - 04:01 PM
Here's the attempted fix;
import std.zh
item script arrow{
void run(){
int spd = 2; // You'll have to work out what the speed of the arrows are, by leaving graphics on the arrow sprites and sending the ffc along at the same time, until you get it right.
int cmb = 56; // Set here the combotype of the up-facing arrow combo. Combos should be arranged 'Up, Down, Left, Right' on the page.
ffc arw = Screen->LoadFFC(32);
arw->X = Link->X * Link->Y; arw->Y = -Link->Y * Link->X;
if(Counter->CR_RUPEES >= 1){
if(Link->Dir == 0){
arw->Vy = -spd;
arw->Data = cmb;
}
if(Link->Dir == 1){
arw->Vy = spd;
arw->Data = cmb+1;
}
if(Link->Dir == 2){
arw->Vx = -spd;
arw->Data = cmb+2;
}
if(Link->Dir == 3){
arw->Vx = spd;
arw->Data = cmb+3;
}
}
}
}
EDIT: Apparently ZQuest can't copy to the clipboard, and I posted the wrong script.
Edited by Linkus, 24 February 2008 - 04:27 PM.
#6
Posted 24 February 2008 - 05:39 PM
void run(){
int spd = 2;
int cmb = 56;
bool go;
ffc arw = Screen->LoadFFC(32);
arw->X = Link->X; arw->Y = Link->Y; //Why are you multiplying Link's coordinates together?! That's not good...
if(Game->Counter[1] > 0){ //That's how you access counters.
if(Link->Dir == 0){
arw->Vy = -spd;
arw->Data = cmb;
go = true;
}
if(Link->Dir == 1 && !go){
arw->Vy = spd;
arw->Data = cmb+1;
go = true;
}
if(Link->Dir == 2 && !go){
arw->Vx = -spd;
arw->Data = cmb+2;
go = true;
}
if(Link->Dir == 3 && !go){
arw->Vx = spd;
arw->Data = cmb+3;
}
}
}
}
Have a go with that one.
#7
Posted 24 February 2008 - 06:40 PM
Why are you multiplying Link's coordinates together?! That's not good...
Oops. I was merely trying to create a "slope" that the arrow would follow when Z3 movement occurs, which would've corrected the diagonal directions. However, it seems to happen only after you go a diagonal direction.
A few other things I found--
It can only fire "once", where the FFC is made only once for the most recent arrow fired.
It needs to cancel itself when the Smack sprite occurs on the original arrow, instead of keep going.
Finally, it seems that the spd integer doesn't work. No matter what I put in, it still keeps going the same speed.
This is going to be a pain...
#8
Posted 24 February 2008 - 06:46 PM
Oh well urm, you don't really need slopes to correct that.
Did my go boolean correct it?
It can only fire "once", where the FFC is made only once for the most recent arrow fired.
It needs to cancel itself when the Smack sprite occurs on the original arrow, instead of keep going.
Finally, it seems that the spd integer doesn't work. No matter what I put in, it still keeps going the same speed.
What do you mean it can only fire once?
You can't have more than one arrow on the screen at a time can you?
That's not going to be so easy *sigh*
It's do-able though, just require the global script and some checking of the ffc and things.
That is very interesing.
And very wrong.
Oh dear.
#9
Posted 24 February 2008 - 06:57 PM
Did my go boolean correct it?
Not at all. It seems to make LinkDir->0,1,2,3,and 4 diagonal as soon as a diagonal direction is followed.
What do you mean it can only fire once?
You can't have more than one arrow on the screen at a time can you?
Wait... Alright, it seems that the arrow can fire only once, but the FFC doesn't recognize this and can fire again instead of waiting for the arrow sprite to disappear.
I'd help some more, but unfortunately scripting is like a banana yet I'm a ostrich. I'd try, but I'm likely to choke myself trying to eat it.
#10
Posted 24 February 2008 - 07:01 PM
Might be able to check whether Link is pressing a direction key aswell or something.
A ha.
Well yeah, when the global script section is added to sort out the smacking animation, that shouldn't be too hard to do.
That's alright, you did more than most, multiplying Link's coordinates together kept me entertained at least =P
And you did get the syntax right =P
#11
Posted 25 February 2008 - 03:33 AM
Actually, looking at the code now, the ZScript code to create and manipulate weapon sprites doesn't even exist yet... how did I not notice this before? The ZASM is there, but no ZScropt stuff :/
#12
Posted 25 February 2008 - 10:52 AM
Geez, this is precisely the reason I added the ability to spawn weapon spites into the scripting engine. So you wouldn't have to use FFCs for that purpose.
Actually, looking at the code now, the ZScript code to create and manipulate weapon sprites doesn't even exist yet... how did I not notice this before? The ZASM is there, but no ZScropt stuff :/
Wait, ZASM can script weapon sprites!? I didn't know that. That changes everything. Now I just have to learn ZASM.
#13
Posted 25 February 2008 - 11:58 AM
Geez, this is precisely the reason I added the ability to spawn weapon spites into the scripting engine. So you wouldn't have to use FFCs for that purpose.
Actually, looking at the code now, the ZScript code to create and manipulate weapon sprites doesn't even exist yet... how did I not notice this before? The ZASM is there, but no ZScropt stuff :/
=O
I will love you for ever if you add that to ZScript.
#15
Posted 25 February 2008 - 04:07 PM
Geez, this is precisely the reason I added the ability to spawn weapon spites into the scripting engine. So you wouldn't have to use FFCs for that purpose.
Actually, looking at the code now, the ZScript code to create and manipulate weapon sprites doesn't even exist yet... how did I not notice this before? The ZASM is there, but no ZScropt stuff :/
ZASM isn't that popular apparently, given that you can only work with numbers and such, and it has no function for comments, meaning confusion for someone who tries to edit it.
You know, you could claim that the weapon sprites' command lines was accidentally left off of Zscript and add it to the next beta.... But I don't know, it just seems to me that Zscript got cheated out of a very much relevant utility.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users