Issues with scripts
#1
Posted 18 November 2010 - 11:35 PM
I tried removing the definition in the std.zh file, but it just gave me a different error then and still wouldn't work.
I was hoping to add the Rolling action, then Bombchu, Ball and Chain, Bomb Arrow, Pegasus Boot and Roc's Cape items to my quest if it were possible, so far it wouldn't let me import any of those. I really have no idea how any of this stuff works, though it'd be great if someone could help me compile and add these to my quest.
I'm using the ZC 2.5 Build 1318 Windows and have no scripts used yet. My quest was started on a 2.10 build and then resaved under the build i'm using now if that has any effect on it.
#2
Posted 19 November 2010 - 01:55 AM
Anyway, if it gave you a different error, it's a different problem. What did it say?
#3
Posted 19 November 2010 - 02:17 PM
This is the exact error I get from putting the Bombchu script in. (I don't have any scripts in my quest yet)
"TMP, LINE 38: ERROR S04: FUNCTION NOACTION WAS ALREADY DECLARED WITH THAT TYPE SIG NATURE."
From what I can tell it's the exact same line as the other person had.
I've tried emailing my quest to a different computer and doing it there as well and still gives the same error. I don't suppose this might be the result of a quest rule or something?
#4
Posted 19 November 2010 - 02:19 PM
#5
Posted 20 November 2010 - 07:01 PM
If it's going to be this much of a pain for every script, I might just have to exclude them at this rate.
#6
Posted 20 November 2010 - 09:16 PM
InputA=false
... ... ...
}
Edited by MoscowModder, 20 November 2010 - 09:16 PM.
#7
Posted 20 November 2010 - 11:34 PM
bool ComboFI(int x,int y, int combotype){
The error is this:
TMP, LINE 22: ERROR S04: FUNCTION COMBOFI WAS ALREADY DECLARED WITH THAT TYPE SIG NATURE.
#8
Posted 21 November 2010 - 10:15 AM
#9
Posted 22 November 2010 - 02:46 PM
This is what is in the script right now for the Bombchu counter, what would I put for it to use counter #7?
Game->Counter[CR_SBOMBS]--;
(If counter 7 won't work, I assume I could also use [CR_BOMBS] for the regular bomb counter if needed as well, right?)
#10
Posted 22 November 2010 - 02:52 PM
#11
Posted 22 November 2010 - 04:42 PM
I'll see if I can get some of the other scripts compiled with it now, thanks!
EDIT 1 - Actually scratch that, tried to compile the bomb arrow script with it, and apparently broke it. Now when I compile the bombchu script, the bombchu item doesn't work at all ingame. Even tried with just the Bombchu script now with no Bomb Arrow script attached and still nothing.
EDIT 2 - I've gotten the Bombchu re-enabled, but the Bomb Arrows still do nothing? I have both Arrows and Bombs in the counter, as well as the regular bow and arrow enabled, but nothing happens.
Edited by HylianGlaceon, 22 November 2010 - 05:45 PM.
#12
Posted 22 November 2010 - 06:16 PM
#13
Posted 22 November 2010 - 06:35 PM
//Constants
const int CF_BCHU = 104; //Flag the Bombchu can pass through (even if solid)
const int T_BCHU = 1342; //ID number of first Bombchu tile. Tiles should be organised : Up, Down, Left, Right
const int BChuNumFrames = 2; //Number of frames of bombchu animation
const int BChuASpeed = 10; //Animation speed of bombchu
const int BChuCSet = 7; //CSet for bombchu
const int BChuDamage = 4; //Damage for Bombchu to deal. The wooden sword deals 2 damage
const int BChuSpeed = 150; //Speed Bombchu moves at, in hundredths of pixels per frame
const int BChuExpType = 1; //Type of explosion. 0 for a normal bomb, 1 for a superbomb
//Variables
int UseBChu;
int BChuDir;
int BChuX;
int BChuY;
int StoreHP;
//Input constants
const int ArrowDamage = 2; //Damage for Arrow to deal. Wooden sword deals 2 damage
const int BombDamage = 8; //Damage for explosion to deal
const int ArrowSpeed = 300; //Speed arrow moves at, in hundredths of pixels per frame
const int T_BOMBARROW = 855; //Arrange tiles in the order 'Up,Down,Left,Right' on the tilesheet. Set up-facing bomb arrow tile here
//Variables
int UseBombArrow;
int ArrowX; int ArrowY;
//Functions
//Check inherent and regular flags at the same time
//Solidity Check, by Saffith
bool isSolid(int x,int y){
if(x<0 || x>255 || y<0 || y>175) return false;
int mask = 1111b;
if(x%16<8) mask &= 0011b;
else mask &= 1100b;
if(y%16<8) mask &= 0101b;
else mask &= 1010b;
int ret = Screen->ComboS[ComboAt(x,y)]&mask;
return ret != 0;
}
global script Slot_2{
void run(){
while(true){
//Call Bombchu functions
if(UseBChu > 0) Bombchu();
Waitframe();
}
}
//Bombchu functions
void Bombchu(){
if(UseBChu == 1){
int X; int Y;
if(Link->Dir>1) X = (Link->Dir-2)*32-16;
if(Link->Dir<2) Y = Link->Dir*32-16;
if(Link->X > 16 && Link->X < 240 && Link->Y > 16 && Link->Y < 152){
lweapon BChu = Screen->CreateLWeapon(LW_SCRIPT1);
BChu->X = Link->X+X;
BChu->Y = Link->Y+Y;
BChuDir = Link->Dir;
BChu->Dir = BChuDir;
BChu->Step = BChuSpeed;
BChu->OriginalTile = T_BCHU+Link->Dir*BChuNumFrames;
BChu->Tile = T_BCHU+Link->Dir*BChuNumFrames;
BChu->NumFrames = BChuNumFrames;
BChu->ASpeed = BChuASpeed;
BChu->CSet = BChuCSet;
Link->Action = LA_ATTACKING;
Game->PlaySound(SFX_PLACE);
Game->Counter[CR_SCRIPT1]--;
UseBChu++;
}else{
Explosion(BChuX,BChuY,BChuExpType);
UseBChu--;
}
}else{
bool Found;
for(int i=1;i<=Screen->NumLWeapons();i++){
lweapon BChu = Screen->LoadLWeapon(i);
if(BChu->ID == LW_SCRIPT1){
if(Link->InputUp) BChuDir = DIR_UP;
if(Link->InputDown) BChuDir = DIR_DOWN;
if(Link->InputLeft) BChuDir = DIR_LEFT;
if(Link->InputRight) BChuDir = DIR_RIGHT;
if((BChuDir == DIR_UP && BombchuCheck(BChu->X+8,BChu->Y+4))
|| (BChuDir == DIR_DOWN && BombchuCheck(BChu->X+8,BChu->Y+12))
|| (BChuDir == DIR_LEFT && BombchuCheck(BChu->X+4,BChu->Y+8))
|| (BChuDir == DIR_RIGHT && BombchuCheck(BChu->X+12,BChu->Y+8))) BChu->DeadState = 0;
BChu->Dir = BChuDir;
BChu->OriginalTile = T_BCHU+BChuDir*BChuNumFrames;
BChu->Tile = T_BCHU+BChuDir*BChuNumFrames;
BChuX = BChu->X;
BChuY = BChu->Y;
if(Link->HP < StoreHP) BChu->DeadState = 0;
NoAction();
Found = true;
break;
}
}
if(!Found){
Explosion(BChuX,BChuY,BChuExpType);
UseBChu-=2;
}
}
StoreHP = Link->HP;
}
//Create an explosion
void Explosion(int x, int y, int type){
int BombType;
if(type == 0) BombType = LW_BOMBBLAST;
else BombType = LW_SBOMBBLAST;
lweapon Exp = Screen->CreateLWeapon(BombType);
Exp->X = BChuX;
Exp->Y = BChuY;
Exp->Damage = BChuDamage;
}
//Check whether the bombchu can enter a tile
bool BombchuCheck(int x,int y){
if((isSolid(x,y) && !ComboFI(x,y,CF_BCHU))
|| ComboFI(x,y,CF_BOMB) || ComboFI(x,y,CF_SBOMB)
|| Screen->ComboT[ComboAt(x,y)] == CT_WATER) return true;
}
}
//bomb arrow functions
void BombArrow(){
if(UseBombArrow == 1){
lweapon Arrow = Screen->CreateLWeapon(LW_ARROW);
int x; int y;
if(Link->Dir > 1) x = (Link->Dir-2)*16-8;
else y = Link->Dir*16-8;
Arrow->X = Link->X+x;
Arrow->Y = Link->Y+y;
Arrow->Dir = Link->Dir;
Arrow->Tile = T_BOMBARROW;
Arrow->Tile += Link->Dir;
Arrow->Damage = ArrowDamage;
Arrow->Step = ArrowSpeed;
Game->PlaySound(SFX_ARROW);
Link->Action = LA_ATTACKING;
UseBombArrow++;
}else{
lweapon Arrow;
bool Found;
for(int i=1;i<=Screen->NumLWeapons();i++){
Arrow = Screen->LoadLWeapon(i);
if(Arrow->ID != LW_ARROW) continue;
Found = true;
}
if(Found){
ArrowX = Arrow->X;
ArrowY = Arrow->Y;
for(int j=-4;j<=4;j+=4){
for(int k=-4;k<=4;k+=4){
if(isSolid(Arrow->X+8+j,Arrow->Y+8+k)
|| ComboFI(ComboAt(Arrow->X+8+j,Arrow->Y+8+k),CF_BOMB)) Arrow->DeadState = 0;
}
}
}else{
lweapon Exp = Screen->CreateLWeapon(LW_BOMBBLAST);
Exp->Damage = BombDamage;
Exp->X = ArrowX;
Exp->Y = ArrowY;
UseBombArrow = 0;
}
}
}
global script Slot_3{
void run(){
UseBChu = 0;
}
}
item script Bombchu{
void run(){
if(Game->Counter[CR_SCRIPT1] > 0) UseBChu++;
}
}
item script BombArrows{
void run(){
if(Game->Counter[CR_BOMBS] > 0 && Game->Counter[CR_ARROWS] > 0 && UseBombArrow == 0){
UseBombArrow++;
Game->Counter[CR_BOMBS]--;
Game->Counter[CR_ARROWS]--;
}
}
}
#14
Posted 26 November 2010 - 08:32 PM
Nevermind, I think I fixed it, it appears to be working, hopefully nothing else breaks..
Edited by HylianGlaceon, 27 November 2010 - 03:39 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users