Jump to content

Photo

Uuhhg...Shop Script


  • Please log in to reply
36 replies to this topic

#1 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 05:15 PM

Hello people. since Joe123 is busy right now, i thought i'd come to some of you guys.
okay, so i put his fcc gameboy styled shop script in my .z file. link to script and it compiled just fine. but, it did not show up in the "assign compiled script" thing. dose any one
know whats going on?

#2 XMSB

XMSB

    Furry Friends Furever

  • Members
  • Real Name:Joseph Watson
  • Location:San Antonio, Texas

Posted 13 July 2010 - 07:18 PM

Try removing these two variables:
CODE

void NoAction(){
    Link->InputUp = false; Link->InputDown = false;
    Link->InputLeft = false; Link->InputRight = false;
    Link->InputA = false; Link->InputB = false;
    Link->InputL = false; Link->InputR = false;
}
void WaitNoAction(){
    NoAction();
    Waitframe();
}


They are now in the std.zh header file.

As for me, it gave me a compilation error message, until I removed those two variables altogether.

#3 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 07:28 PM

QUOTE(XMuppetSB @ Jul 13 2010, 06:18 PM) View Post

Try removing these two variables:
CODE

void NoAction(){
    Link->InputUp = false; Link->InputDown = false;
    Link->InputLeft = false; Link->InputRight = false;
    Link->InputA = false; Link->InputB = false;
    Link->InputL = false; Link->InputR = false;
}
void WaitNoAction(){
    NoAction();
    Waitframe();
}


They are now in the std.zh header file.

As for me, it gave me a compilation error message, until I removed those two variables altogether.

it gave the error message.

Edited by cremeens1000, 13 July 2010 - 07:29 PM.


#4 XMSB

XMSB

    Furry Friends Furever

  • Members
  • Real Name:Joseph Watson
  • Location:San Antonio, Texas

Posted 13 July 2010 - 07:32 PM

What build are you using?
I'm using build 1281, and I had to remove those two variables in order for it to compile successfully.

Edited by XMuppetSB, 13 July 2010 - 07:33 PM.


#5 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 07:56 PM

QUOTE(XMuppetSB @ Jul 13 2010, 06:32 PM) View Post

What build are you using?
I'm using build 1281, and I had to remove those two variables in order for it to compile successfully.

i am using the same build. i don't know whats going wrong.
want me to send you my .z file?
i really wish i could do this myself...

Edited by cremeens1000, 13 July 2010 - 07:57 PM.


#6 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 13 July 2010 - 08:36 PM

Or you could just say the exact, specific error message it gave you so we can tell you how to fix it. Go ahead and post the contents of your .z file in [code=auto:0] tags too.

#7 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 08:41 PM

QUOTE(Plissken @ Jul 13 2010, 07:36 PM) View Post

Or you could just say the exact, specific error message it gave you so we can tell you how to fix it. Go ahead and post the contents of your .z file in [code=auto:0] tags too.

okay, here is the error message.
TMP, LINE 56: ERROR S10: FUNCTION WAITNAACTION IS UNDECLARED.
TMP. LINE 59: ERROR S10: FUNCTION WAITNAACTION IS UNDECLARED.



#8 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 13 July 2010 - 08:43 PM

NAACTION? Weird, can you post your .z file?

#9 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 08:45 PM

QUOTE(Plissken @ Jul 13 2010, 07:43 PM) View Post

NAACTION? Weird, can you post your .z file?


okay. and i ment noaction, sorry.

here it is


import "std.zh"

//========================================================
// FFC SCRIPT TRIGGER SECRETS (no pun intended) hah;)
// D0 - Item neccesary. Check std.zh for values
// Gleeok was here-
//========================================================
ffc script trigger_secrets{

void run(int have_item){

if (Link->Item[have_item] == true && Screen->NumNPCs() >= 1){
npc enemy_trig = Screen->LoadNPC(1);
enemy_trig->HP = 0;

}
}
}

const int CMB_AUTOWARPA = 0; //Set this to the combo ID of a transparent Autowarp A type combo
ffc script Boss{
void run(int health,int sfx,int ffcnum,int warp){
ffc f = this;
if(ffcnum > 0) f = Screen->LoadFFC(ffcnum);
while(health > 0){
for(int i=0;i<Screen->NumLWeapons();i++){
lweapon l = Screen->LoadLWeapon(i);
if(Collision(f,l) && DamagingLWeapon(l)){
health--;
if(sfx > 0) Game->PlaySound(sfx);
Waitframes(10);
}
}
Waitframe();
}
if(warp == 0) Screen->TriggerSecrets();
else{
ffc warper = Screen->LoadFFC(warp);
warper->Data = CMB_AUTOWARPA;
}
}
bool DamagingLWeapon(lweapon l){
return l->ID != LW_BOMB && l->ID != LW_SBOMB && l->ID != LW_BAIT && l->ID != LW_SPARKLE;
}
}

const int S_NORUPEES = 0; //Message saying 'Not enough rupees'
const int S_THANKS = 0; //Message saying 'Thanks for buying'

bool CanBuy(ffc buy,int input){
return (Abs(Link->X-buy->X) < 8 && Abs(Link->Y-(buy->Y+icon_cool.gif) < 8 && SelectPressInput(input) && Link->Dir == DIR_UP);
}
void ShopItemThanks(int itm){
Screen->Message(S_THANKS);
Game->PlaySound(SFX_SCALE);
WaitNoAction();
CreatePickupItem(Link->X,Link->Y,itm);
Game->PlaySound(SFX_PICKUP);
WaitNoAction();
}
void CreatePickupItem(int x, int y, int itm){
item Spawn = Screen->CreateItem(itm);
Spawn->Pickup |= (IP_TIMEOUT|IP_HOLDUP);
Spawn->HitWidth = 16; Spawn->HitHeight = 16;
Spawn->X = x; Spawn->Y = y;
}

void DeductRupees(int amount){
FreezeScreen();
for(int i=0;i<amount;i++){
Game->PlaySound(SFX_MSG);
Game->Counter[CR_RUPEES]--;
Waitframe();
}
UnFreeze();
}

int FreezeID;
void FreezeScreen(){
FreezeID = Screen->ComboT[0];
Screen->ComboT[0] = CT_SCREENFREEZE;
}
void UnFreeze(){
Screen->ComboT[0] = FreezeID;
}

//These functions should only be included in your script file once
bool SelectPressInput(int input){
if(input == 0) return Link->PressA;
else if(input == 1) return Link->PressB;
else if(input == 2) return Link->PressL;
else if(input == 3) return Link->PressR;
}
void SetInput(int input, bool state){
if(input == 0) Link->InputA = state;
else if(input == 1) Link->InputB = state;
else if(input == 2) Link->InputL = state;
else if(input == 3) Link->InputR = state;
}


const int WSP_FALLING = 88; //Weapon/Misc. sprite for Link falling down a hole
const int WSP_LAVA = 89; //Weapon/Misc. sprite for Link drowning in lava
const int SFX_FALLING = 64; //SFX for falling down a hole
const int SFX_LAVA = 76; //SFX for drowning in lava
const int CMB_AUTOWARP = 29; //Combo ID of a transparent AutoWarp A combotype

const int CT_HOLELAVA = 11; //Combotype to give hole functionality to (default is Left Statue)

ffc script HoleLava{
void run(int lava, int warpto, int damage){

this->Misc[0] = WSP_FALLING; this->Misc[1] = SFX_FALLING; //Set up correct graphic and sound effect
if(lava){
this->Misc[0] = WSP_LAVA;
this->Misc[1] = SFX_LAVA;
}
//Find return point when falling in lava. (this->X,this->Y) used if ffc is not at (0,0)
if((this->X == 0 && this->Y == 0) || this->Flags[FFCF_CHANGER]){
Waitframes(5);
this->X = Link->X; this->Y = Link->Y;
}
this->Misc[2] = warpto;
if(damage) this->Misc[3] = damage;
else this->Misc[3] = 8;

while(true){
while(!OnPitCombo()) Waitframe(); //Idle while not on pit
int pitclk = 0;
while(OnPitCombo() && pitclk++ < 4) Waitframe(); //Wait for four frames whilst on pit
if(pitclk >= 5) Fall(this); //Fall
}
}
void Fall(ffc Info){
Screen->ClearSprites(SL_LWPNS);
Game->PlaySound(Info->Misc[1]);
int wait = CreateGraphic(Info->Misc[0]);

Link->Invisible = true; Link->CollDetection = false;
for(int i=0;i<wait+30;i++) WaitNoAction();
Link->Invisible = false; Link->CollDetection = true;

if(Info->Misc[2]) Warp(Info);

Link->X = Info->X; Link->Y = Info->Y;
Link->HP -= Info->Misc[3];
Game->PlaySound(SFX_OUCH);
}
void Warp(ffc Warp){
int orig = Warp->Data;
Warp->Data = CMB_AUTOWARP;
Warp->Flags[FFCF_CARRYOVER] = true;
Waitframe();
Warp->Data = orig;
Warp->Flags[FFCF_CARRYOVER] = false;
Link->Z = Link->Y;
Quit();
}
bool OnPitCombo(){
return (Screen->ComboT[ComboAt(Link->X+8,Link->Y+icon_cool.gif] == CT_HOLELAVA && Link->Z <= 0 && Link->Action != LA_FROZEN);
}
int CreateGraphic(int sprite){
lweapon l = Screen->CreateLWeapon(LW_SCRIPT1);
l->HitXOffset = 500;
l->UseSprite(sprite);
l->DeadState = l->NumFrames*l->ASpeed;
l->X = Link->X; l->Y = Link->Y;
return l->DeadState;
}
}

ffc script FFCJumpCliff{

void run(int verticalmovement, int horizontalmovement, int directiontopress) {

int directiontopressmoreleft;
int directiontopressmoreright;
int LinkHmovementdone = 0;
bool ffcsentlinkjumping = false;

if (directiontopress==DIR_DOWN) {
directiontopressmoreleft = DIR_RIGHTDOWN;
directiontopressmoreright = DIR_LEFTDOWN;
}

else {
if (directiontopress==DIR_UP) {
directiontopressmoreleft = DIR_LEFTUP;
directiontopressmoreright = DIR_RIGHTUP;
}
else {
if (directiontopress==DIR_LEFT) {
directiontopressmoreleft = DIR_LEFTDOWN;
directiontopressmoreright = DIR_LEFTUP;
}
else {
if (directiontopress==DIR_RIGHT) {
directiontopressmoreleft = DIR_RIGHTUP;
directiontopressmoreright = DIR_RIGHTDOWN;
}
else {
if (directiontopress==DIR_LEFTDOWN) {
directiontopressmoreleft = DIR_DOWN;
directiontopressmoreright = DIR_LEFT;
}
else {
if (directiontopress==DIR_RIGHTDOWN) {
directiontopressmoreleft = DIR_RIGHT;
directiontopressmoreright = DIR_DOWN;
}
else {
if (directiontopress==DIR_LEFTUP) {
directiontopressmoreleft = DIR_LEFT;
directiontopressmoreright = DIR_UP;
}
else {
if (directiontopress==DIR_RIGHTUP) {
directiontopressmoreleft = DIR_UP;
directiontopressmoreright = DIR_RIGHT;
}
}
}
}
}
}
}
}
while (true){

if (Link->Z==0) {
LinkHmovementdone=0;
ffcsentlinkjumping = false;
}

if ( (ffcsentlinkjumping)&&(LinkHmovementdone<Abs(horizontalmovement)) ) {
if (horizontalmovement<0) {Link->X--;}
if (horizontalmovement>0) {Link->X++;}
LinkHmovementdone++;
}

if ( (LinkCollision(this))
&& ( (Link->Dir==directiontopress)
||(Link->Dir==directiontopressmoreleft)
||(Link->Dir==directiontopressmoreright) ) ) {

if (Link->Z==0){
Game->PlaySound(SFX_JUMP);
Link->Action=LA_HOPPING;
}
ffcsentlinkjumping=true;
Link->Y=Link->Y+verticalmovement;
Link->Z=Link->Z+verticalmovement;
}

Waitframe();
}
}
}

ffc script OrbReact
{
void run(int a,int b,int c, int m)
{
if(Link->Item[a] && Link->Item[b] && Link->Item[c])
{
Screen->TriggerSecrets();
}
else
{
Screen->Message(m);
}
}
}

item script Give
{
void run(int i)
{
Link->Item[i] = true;
}
}

item script Message{
void run(int m){
Screen->Message(m);
}
}


#10 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 13 July 2010 - 08:49 PM

EDIT: Hold on, I used an older build, gimme a moment and I'll try it on 1281.

Edited by Plissken, 13 July 2010 - 08:52 PM.


#11 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 08:53 PM

QUOTE(Plissken @ Jul 13 2010, 07:49 PM) View Post

EDIT: Hold on, I used an older build, gimme a moment and I'll try it on 1281.

thanks, i compiled now. but, it did not appear in the assign compile page.
dammit! why dose this happen to me!?

#12 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 13 July 2010 - 08:59 PM

Ok, I just looked at the file, it's cause you didn't put the script in there...

There's no shop script in there. Also, if you are using build 1281 then you need to NOT have those functions XMuppetSB put in his first post, just like he originally said. If you are using a build lower than 1281 then you need to have those in there.

#13 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 09:11 PM

QUOTE(Plissken @ Jul 13 2010, 07:59 PM) View Post

Ok, I just looked at the file, it's cause you didn't put the script in there...

There's no shop script in there. Also, if you are using build 1281 then you need to NOT have those functions XMuppetSB put in his first post, just like he originally said. If you are using a build lower than 1281 then you need to have those in there.

...what do you mean i don't have the script in there? i put it in there. did i copy the wrong thing or something? or did i forget to copy
something?

#14 Plissken

Plissken

    What's with these homies dissing our girls?

  • Members

Posted 13 July 2010 - 09:13 PM

Well, you only copied the functions, you didn't actually copy the scripts. Go back to that post and add in the first two code sections Joe123 posted.

#15 Tree

Tree

    Everything must go away

  • Members
  • Real Name:Mundy Fumple McStroodlestein
  • Location:The Milky Way Galaxy

Posted 13 July 2010 - 11:50 PM

QUOTE(Plissken @ Jul 13 2010, 08:13 PM) View Post

Well, you only copied the functions, you didn't actually copy the scripts. Go back to that post and add in the first two code sections Joe123 posted.

oh, ok thanks. i will tell you if it works in a bit.

QUOTE(Plissken @ Jul 13 2010, 08:13 PM) View Post

Well, you only copied the functions, you didn't actually copy the scripts. Go back to that post and add in the first two code sections Joe123 posted.

okay, now all my scripts are not working. gah!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users