Zelda three scrolling! Do my eyes deceive me, or did I really read that post right? Post a demo jman, please post a demo!
Printable View
Zelda three scrolling! Do my eyes deceive me, or did I really read that post right? Post a demo jman, please post a demo!
He said he'd post the script as soon as the beta required is out, so hopefully soon.
Jman, I'm ambivalent toward you right now. I can [hypothetically] hug you for implementing the first signs of Z3 scrolling, but I can also [hypothetically] smack you for possibly making quest-making 100 times more difficult. :p
I really don't care if it gets more dificult! Zelda Three Screen Scrolling!
No... not exactly. All we can do now is draw tiles to the screen to simulate Z3 scrolling, if I follow Jman's demo correctly. (Perhaps warp the player when the screen moves enough, too). We can't yet do collision or combos or enemies or... anything else in true Z3 scrolling style.
In other words, Jman's teasing us all pretty badly.
There wouldn't be a problem if you guys actually read Youtube video descriptions >_>
New beta out, so as promised, the script!
It's a bit dirty and not commented, but I'll leave it as an exercise to the reader to interpret its meaning. If you have any questions though, I'll answer them.Code:import "std.zh"
int screenX;
int screenY;
int LinkX;
int LinkY;
int screenOriginX;
int screenOriginY;
global script freescroll {
void run(){
Initialize();
while(true)
{
int changeX = 0;
int changeY = 0;
if(Link->X < 64)
{
int temp = screenX;
screenX -= 64-Link->X;
if(screenX < 0) screenX=0;
Link->X += temp-screenX;
changeX = screenX-temp;
}
if(Link->X > 176)
{
int temp = screenX;
screenX += Link->X-176;
if(screenX > 256) screenX=256;
Link->X -= screenX-temp;
changeX = screenX-temp;
}
if(Link->Y < 32)
{
int temp = screenY;
screenY -= 32-Link->Y;
if(screenY < 0) screenY=0;
Link->Y += temp-screenY;
changeY = screenY-temp;
}
if(Link->Y > 128)
{
int temp = screenY;
screenY += Link->Y-128;
if(screenY > 176) screenY=176;
Link->Y -= screenY-temp;
changeY = screenY-temp;
}
LinkX = screenX+Link->X;
LinkY = screenY+Link->Y;
int i;
int j;
float k;
lweapon tmpwpn;
for(k=0; k < Screen->NumLWeapons(); k++)
{
tmpwpn = Screen->LoadLWeapon(k);
tmpwpn->X += changeX;
tmpwpn->Y += changeY;
}
//Render code
int screenX1 = screenX % 256;
int screenX2 = Floor(screenX/256);
screenX2 = (screenX2+1)*256;
int screenY1 = screenY % 176;
int screenY2 = Floor(screenY/176);
screenY2 = (screenY2+1)*176;
int startX = screenX1-(screenX1%16);
int startY = screenY1-(screenY1%16);
int originI = Floor(screenY1/16); int originJ = Floor(screenX1/16);
int origScreen = Game->GetCurScreen();
int temp1 = Floor(screenY/176); int temp2 = Floor(screenX/256);
int cmbscr = ((screenOriginY+temp1)*16)+(screenOriginX+temp2);
for(i=0;i<11&&(startY+(i*16))<screenY2;i++)
{
for(j=0;j<16&&(startX+(j*16))<screenX2;j++)
{
Screen->DrawCombo(1,-(screenX1 % 16)+(j*16),-(screenY1 % 16)+(i*16),
Game->GetComboData(0,cmbscr,((originI+i)*16)+(originJ+j)),1,1,
Game->GetComboCSet(0,cmbscr,((originI+i)*16)+(originJ+j)),1,0,0,0,0,0,0,256);
}
}
cmbscr = ((screenOriginY+temp1)*16)+(screenOriginX+temp2+1);
for(i=0;i<11&&(startY+(i*16))<screenY2;i++)
{
for(j=0;j<16&&(j*16)<screenX1;j++)
{
Screen->DrawCombo(1,(256-screenX1)+(j*16),-(screenY1 % 16)+(i*16),
Game->GetComboData(0,cmbscr,((originI+i)*16)+j),1,1,
Game->GetComboCSet(0,cmbscr,((originI+i)*16)+j),1,0,0,0,0,0,0,256);
}
}
cmbscr = ((screenOriginY+temp1+1)*16)+(screenOriginX+temp2);
for(i=0;i<11&&(i*16)<screenY1;i++)
{
for(j=0;j<16&&(startX+(j*16))<screenX2;j++)
{
Screen->DrawCombo(1,-(screenX1 % 16)+(j*16),(176-screenY1)+(i*16),
Game->GetComboData(0,cmbscr,(i*16)+(originJ+j)),1,1,
Game->GetComboCSet(0,cmbscr,(i*16)+(originJ+j)),1,0,0,0,0,0,0,256);
}
}
cmbscr = ((screenOriginY+temp1+1)*16)+(screenOriginX+temp2+1);
for(i=0;i<11&&(i*16)<screenY1;i++)
{
for(j=0;j<16&&(j*16)<screenX1;j++)
{
Screen->DrawCombo(1,(256-screenX1)+(j*16),(176-screenY1)+(i*16),
Game->GetComboData(0,cmbscr,(i*16)+j),1,1,
Game->GetComboCSet(0,cmbscr,(i*16)+j),1,0,0,0,0,0,0,256);
}
}
Waitframe();
}
}
void Initialize(){
screenX = 60;
screenY = 0;
LinkX = 100;
LinkY = 32;
Link->X = 100;
Link->Y = 32;
screenOriginX = 2;
screenOriginY = 1;
}
}
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 = 0; // Set here the combotype of the up-facing arrow combo. Combos should be arranged 'Up, Down, Left, Right' on the page.
//if(Screen->D[0] != 0)
//{
//lweapon tmp = Screen->LoadLWeapon(Screen->D[0]);
//if(tmp->isValid())
//{
//Quit();
//}
//}
if(Screen->NumLWeapons() > 0) Quit();
lweapon arw = Screen->CreateLWeapon(WPN_ARROW);
Screen->D[0] = arw->ID+1;
arw->X = Link->X; arw->Y = Link->Y; arw->Z = Link->Z;
arw->Dir = Link->Dir;
arw->Step = 2.5;
arw->NumFrames = 4;
arw->Frame = 0;
arw->Damage = 4;
arw->ASpeed = 6;
arw->Tile = 21951;
arw->OriginalTile = 21951;
arw->CSet = 6;
arw->OriginalCSet = 6;
arw->Flash = 0;
arw->Flip = 0;
if(arw->Dir == 0){
arw->Y = arw->Y-16;
}
if(arw->Dir == 1){
arw->Y = arw->Y+16;
arw->Flip = 2;
}
if(arw->Dir == 2){
arw->X = arw->X-16;
arw->OriginalTile = arw->OriginalTile+4;
arw->Tile = arw->Tile+4;
arw->Flip = 1;
}
if(arw->Dir == 3){
arw->X = arw->X+16;
arw->OriginalTile = arw->OriginalTile+4;
arw->Tile = arw->Tile+4;
}
Game->PlaySound(SFX_ARROW);
}
}
O_O;
jman, now I guess it's time for me to pester you about adding this. <3
I'm a bit confused on some of the weapon handling functions.
Do all these variables have to be set for it to work fully?
Also with the angle and angular, is this necessary to achieve diagonal movement or simply to simulate the boomerang return effect?Code:arw->NumFrames = 4;
arw->Frame = 0;
arw->Damage = 4;
arw->ASpeed = 6;
arw->Tile = 21951;
arw->OriginalTile = 21951;
arw->CSet = 6;
arw->OriginalCSet = 6;
arw->Flash = 0;
arw->Flip = 0;
What I'm trying to experiment with is lweapons and eweapons to replace ffcs. For lweapons I really only need the basics, just 8-12 sprites fired upward, but how could I go about mimicing the pattern of enemy ffc projectiles such as Vx and Vy? For example, something like a simple bullet spread fired from an npc:
Would it be possible to reproduce this with eweapons? To eliminate the problems with lag and use the built in zc hit detection, What i'm doing is sort of dependant on the use of trajectories or integers that behave like them and trying to cram as many sprites as possible on screen before I get lag from it.Code:{
ffc1->Vy=2;Waitframe();
ffc2->Vy=2;ffc2->Vx=-0.1;Waitframe();
ffc3->Vy=2;ffc3->Vx=-0.2;Waitframe();
ffc4->Vy=2;ffc4->Vx=-0.3;Waitframe();
ffc5->Vy=2;ffc5->Vx=-0.4;Waitframe();
ffc6->Vy=2;ffc6->Vx=-0.5;Waitframe();
ffc7->Vy=2;ffc7->Vx=-0.6;Waitframe();
ffc8->Vy=2;ffc8->Vx=-0.7;Waitframe();
}