QUOTE(linktopower @ Jul 5 2011, 09:51 PM)
sure i'll pm it to you
Several problems here:
1. For the mana sword a & b they should be equipment items.
2. There should be no magic cost for the item. If you want it to take magic we'll need to redo this a little.
3. You MUST use custom item slots. Not the zz# slots. Those are for expansion.
4. The problem seems to be that link isn't picking up the item automatically we can fix that by having us change the tile being used by the item to a blank one.
5. Change the pickup sound for swords a & b to 0. That will get rid of the annoying pickup sound playing over and over again.
6. For some reason the item is not being added to links inventory. Not sure why though. I'll look into it later.
CODE
const int blank = ?; //define this at the start of the script and set the number to the number of a blank tile.
itm->Tile = blank; //add this line before setting the items position and after creating it.
EDIT: Tested something out and it seems using Link->Item[Item_ID] = true; does worked. I'm going to recombine the two global scripts a different way this time and see if that fixes it.
EDIT: Okay the script works find by itself but when you try to combine them it doesn't work.
CODE
import "std.zh"
const int SWORD3 = 143;
const int SWORD3A = 144;
const int SWORD3B = 145;
int SaveX;
int SaveY;
bool WasOnLadder = false;
bool HookGrab(){
int HSFor;
for(HSFor = 1; HSFor <= Screen->NumLWeapons(); HSFor++){
lweapon HSCheck = Screen->LoadLWeapon(HSFor);
if(HSCheck->ID == LW_HOOKSHOT && Screen->ComboT[ComboAt (HSCheck->X, HSCheck->Y)] == CT_HSGRAB || Screen->ComboT[ComboAt (HSCheck->X+15, HSCheck->Y)] == CT_HSGRAB || Screen->ComboT[ComboAt (HSCheck->X, HSCheck->Y+15)] == CT_HSGRAB || Screen->ComboT[ComboAt (HSCheck->X+15, HSCheck->Y+15)] == CT_HSGRAB){
return(true);
}
}
return(false);
}
bool OnLadder()
{
if(Screen->ComboT[ComboAt (Link->X, Link->Y+8)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X+15, Link->Y+8)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X, Link->Y+15)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X+15, Link->Y+15)] == CT_SCRIPT1){
return(true);
}
return(false);
}
bool OnLadderDown()
{
if(Screen->ComboT[ComboAt (Link->X, Link->Y+8)] != CT_SCRIPT1 && Screen->ComboT[ComboAt (Link->X+15, Link->Y+8)] != CT_SCRIPT1 && (Screen->ComboT[ComboAt (Link->X, Link->Y+15)] == CT_SCRIPT1 || Screen->ComboT[ComboAt (Link->X+15, Link->Y+15)] == CT_SCRIPT1)){
return(true);
}
return(false);
}
bool isLSolidHorz(int y)
{
int x;
for(x=Link->X; x<=Link->X+16; x+=8)
{
if(x==Link->X+16) x--;
if(Screen->isSolid(x, y)) return(true);
}
return(false);
}
bool isFiringHS(){
int HSFor;
for(HSFor = 1; HSFor <= Screen->NumLWeapons(); HSFor++){
lweapon HSCheck = Screen->LoadLWeapon(HSFor);
if(HSCheck->ID == LW_HOOKSHOT){
return(true);
}
}
return(false);
}
bool isJumping(){
if((GetEquipmentA() == I_ROCSFEATHER && Link->InputA == true) || (GetEquipmentB() == I_ROCSFEATHER && Link->InputB == true) || Link->Jump > 1){
return(true);
}
return(false);
}
global script Slot2{
void run(){
while(true){
onladder();
checksword3();
Waitframe();
}
}
void onladder(){
if(OnLadder() == true && HookGrab() == false && isJumping() == false){
if(WasOnLadder == false){
Link->Jump = 1;
if(OnLadderDown()){
Link->Y++;
SaveY = Link->Y;
}
}
else{
Link->Jump = 0;
}
if(!isFiringHS()){
if(Link->InputUp == true && !isLSolidHorz(Link->Y+7)){
SaveY--;
}
else if(Link->InputDown == true && !isLSolidHorz(Link->Y+16)){
SaveY++;
}
if(Link->InputLeft == true && !Screen->isSolid(Link->X-1, Link->Y+8) && !Screen->isSolid(Link->X-1, Link->Y+15)){
SaveX--;
}
else if(Link->InputRight == true && !Screen->isSolid(Link->X+16, Link->Y+8) && !Screen->isSolid(Link->X+16, Link->Y+15)){
SaveX++;
}
}
Link->X = SaveX;
Link->Y = SaveY;
WasOnLadder = true;
}
else{
if(WasOnLadder == true){
Link->Jump = 0;
WasOnLadder = false;
}
SaveX = Link->X;
SaveY = Link->Y;
}
}
void checksword3(){
if(Link->Item[SWORD3] == true){
if(Link->MP > 0){
Link->Item[SWORD3A] = true;
Link->Item[SWORD3B] = false;
}
else{
Link->Item[SWORD3A] = false;
Link->Item[SWORD3B] = true;
}
}
}
}
item script Roc{
void run(){
if(OnLadder() == true){
Link->Jump = 3;
}
}
}
I'm going to recruit saffith and see if he will be willing to help us get this working. Because honestly have no idea what is going on or why it doesn't work. If you
Edited by blackbishop89, 06 July 2011 - 10:07 AM.