Item that floats.
#1
Posted 27 April 2010 - 06:59 PM
... I had another but I forgot.. so maybe ask about that later..
#2
Posted 28 April 2010 - 03:57 AM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
if(perm == 0) return;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Waitframe();
}
SetScreenDBit(d,perm,true);
}
}
Works as 'More than one Item per Screen' from the database does, but there is now an extra argument on the end which control it's 'Z' coordinate on the screen.
#3
Posted 28 April 2010 - 11:46 AM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
if(perm == 0) return;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Waitframe();
}
SetScreenDBit(d,perm,true);
}
}
Works as 'More than one Item per Screen' from the database does, but there is now an extra argument on the end which control it's 'Z' coordinate on the screen.
ok and the Do - D1 arguments and such is same as that script?
Thanks
and the other was a script that changes Links tile set to a swimming one, As in links awakening there are a few screens where he is underwater.. so if I could just change the tiles he is using to swimming ones.. other wise I maybe able to use a hidden item that is disabled on every Dmap but one for underwater areas and be like a "ring" and simply changes him to the correct tiles( But this would less flexible). (I just thought up that solution I didn't test it though)
#4
Posted 28 April 2010 - 12:33 PM
Yeah, the ring method should work.
#5
Posted 28 April 2010 - 12:46 PM
Everything else is the same, but the argument after all of the other ones in the database's explanation adjusts the item's Z height.
Yeah, the ring method should work.
I still able to pick it up off the ground even with D6 set to 99 (and D7 on 10 tried after the other just in case it was that but d1-5 are used on the other)
#6
Posted 28 April 2010 - 12:48 PM
#7
Posted 28 April 2010 - 01:24 PM
void run(int itm, int dly, int enemies, int holdup, int perm, int d,
int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
if(perm == 0) return;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Waitframe();
}
SetScreenDBit(d,perm,true);
}
}
that.
Edited by caprontos, 28 April 2010 - 01:24 PM.
#8
Posted 28 April 2010 - 09:08 PM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
while(i->isValid()) { i->Z = z; i->Jump = 0; }
if(perm == 0) return;
while(i->isValid()) Waitframe();
SetScreenDBit(d,perm,true);
}
}
See if that works. I merely moved the isValid pointer before the second return function, which should work. I think your earlier script would've worked as well, if the integer perm was not equal to zero, maybe. But, I've taken such a long break, I gotta get warmed up to scripting again! SoulSilver held my attention for longer than I expected! lol
Edited by AgentLym, 28 April 2010 - 09:09 PM.
#9
Posted 28 April 2010 - 09:27 PM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
while(i->isValid()) { i->Z = z; i->Jump = 0; }
if(perm == 0) return;
while(i->isValid()) Waitframe();
SetScreenDBit(d,perm,true);
}
}
See if that works. I merely moved the isValid pointer before the second return function, which should work. I think your earlier script would've worked as well, if the integer perm was not equal to zero, maybe. But, I've taken such a long break, I gotta get warmed up to scripting again! SoulSilver held my attention for longer than I expected! lol
It seems to freeze the game when I enter the screen... (using D6, at value 1 2 and 0)
#10
Posted 28 April 2010 - 10:04 PM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
if(i->isValid()) {i->Z = z; i->Jump = 0;}
if(perm == 0) return;
while(i->isValid()) Waitframe();
SetScreenDBit(d,perm,true);
}
}
Ah, right, I should've seen that. When the item is created, the engine will constantly place the item at Z height, not allowing anything else to work. Try the code again.
Edited by AgentLym, 28 April 2010 - 10:14 PM.
#11
Posted 29 April 2010 - 02:14 AM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Waitframe();
}
if(perm != 0) SetScreenDBit(d,perm,true);
}
}
Oh, it only worked properly for temporary items. Should be ok now.
#12
Posted 29 April 2010 - 01:35 PM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Waitframe();
}
if(perm != 0) SetScreenDBit(d,perm,true);
}
}
Oh, it only worked properly for temporary items. Should be ok now.
that works and for referance
if on your rocs feather your Height modifier is "2" it needs to be at height "32" to get it (I assume *1 height modifier is equal to 16 pixels*)
Thanks again (also link still appears above it.. I tried putting it on a different layers but doesn't work, if it can't be helped that's fine.)
Edited by caprontos, 29 April 2010 - 02:23 PM.
#13
Posted 29 April 2010 - 01:46 PM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Screen->DrawTile(3,i->X,i->Y+2,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);
Waitframe();
}
if(perm != 0) SetScreenDBit(d,perm,true);
}
}
That should put the graphic on layer 3.
#14
Posted 29 April 2010 - 02:22 PM
No, 1 doesn't equal 16 don't say that! 1 height modifier is equal to 16 pixels worth of jump is not the same as 1 equals 16!
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Screen->DrawTile(3,i->X,i->Y+2,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);
Waitframe();
}
if(perm != 0) SetScreenDBit(d,perm,true);
}
}
That should put the graphic on layer 3.
Sorry, I meant that but can see how it could confuse some one.. I'll edited it out..(case someone else uses this )
and.. one more problem (sorry..) its drawing two of the item (one is on layer three and hte other is not and the one thats not is 2 tiles above the tile you jump from and the other is directly above
Is it because of the
"item i = CreateItemAt(itm,this->X,this->Y);"
and
"Screen->DrawTile(3,i->X,i->Y+2,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);" being in there? so its doing both? (I'm not really sure if I know what they mean I'm guessing..)
#15
Posted 29 April 2010 - 02:26 PM
void run(int itm, int dly, int enemies, int holdup, int perm, int d, int z){
if(enemies != 0) dly = 4;
Waitframes(dly);
if(perm > 0 && GetScreenDBit(d,perm)) return;
while(enemies != 0 && Screen->NumNPCs() > 0) Waitframe();
item i = CreateItemAt(itm,this->X,this->Y);
if(holdup) i->Pickup |= IP_HOLDUP;
while(i->isValid()){
i->Z = z; i->Jump = 0;
Screen->DrawTile(3,i->X,i->Y+2-i->Z,i->Tile,1,1,i->CSet,-1,-1,-1,1,0,0,true,128);
Waitframe();
}
if(perm != 0) SetScreenDBit(d,perm,true);
}
}
Drawing two sprites is intentional, I just got one of the in the wrong place. Try that, it might be one or two pixels out but I think it's right.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users