Jump to content

Photo

Item Action Scrtipt Request (SFX)


  • Please log in to reply
79 replies to this topic

#31 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 04 April 2016 - 03:21 PM

Could turn off Link's bombs hurt link rule. Run a global script that looks for lweapon bomb blast and drops an eweapon bomb blast in the same spot with the appropriate damage set.

 

That sounds promising, but I wonder if the explosions would occur at the same time. Another possibility might be to place both an lbomb and an ebomb at the same time- but the lbomb would need to be drawn on top.



#32 justin

justin

    Adept

  • Members

Posted 04 April 2016 - 09:23 PM

the idea is to wait for the bomb to explode, and just drop another explosion in the exact same place. so ya, both explosions happen at the same time. one is meant to hurt enemys, one is meant to hurt link. 

 

here's the code. Set the constants. call BombBlastFlake(); in your global loop before Waitdraw();

 

totally untested.

superbombs could be added easily if you're faking those too.

const int LW_MISC_MARKED = 0;   // index to the misc array for an lweapon. value 0-15. choose something unused by other scripts.
const int BOMB_DAMAGE_TO_LINK = 0;  // the damage that Link's own bomb should hurt him. 
 
void BombBlastFake()
{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}

Edited by justin, 04 April 2016 - 09:23 PM.

  • Cukeman likes this

#33 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 06 April 2016 - 09:12 PM

 

the idea is to wait for the bomb to explode, and just drop another explosion in the exact same place. so ya, both explosions happen at the same time. one is meant to hurt enemys, one is meant to hurt link. 

 

here's the code. Set the constants. call BombBlastFlake(); in your global loop before Waitdraw();

 

totally untested.

superbombs could be added easily if you're faking those too.

const int LW_MISC_MARKED = 0;   // index to the misc array for an lweapon. value 0-15. choose something unused by other scripts.
const int BOMB_DAMAGE_TO_LINK = 0;  // the damage that Link's own bomb should hurt him. 
 
void BombBlastFake()
{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}

 

 


Line 27: syntax error, unexpected lparen, expecting assign, on token (
fatal error p00: can’t open or parse input file!

 

 

Line 27 is: void BombBlastFake()

 

In context:

import "std.zh"
import "string.zh"
import "ffcscript.zh"
import "ghost.zh"
import "tango.zh"


const int BOMB_DAMAGE = 4;
const int LW_MISC_MARKED = 0;
const int BOMB_DAMAGE_TO_LINK = 2;


global script Combined
{
    void run()
    {
        StartClock();
        
        while(true)
        {
            UpdateEWeapons();
            UpdateClock();
            CleanUpGhostFFCs();
            Tango_Update1();


void BombBlastFake()
{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}

            
            Waitdraw();
            
            AutoGhost();
            Tango_Update2();
            
            Waitframe();
        }
    }
}

Edited by Cukeman, 06 April 2016 - 09:17 PM.


#34 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 06 April 2016 - 09:26 PM

Every opening brace needs a closing brace to match. It looks like you cut out the entire second half of your global script for some reason.
  • ywkls likes this

#35 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 06 April 2016 - 10:53 PM

Huh? There seem to be the same number of left and right braces...

 

I pasted the script before waitdraw as instructed. *confused*


Edited by Cukeman, 06 April 2016 - 10:54 PM.


#36 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 06 April 2016 - 10:56 PM

Oh, I didn't notice that "void BombBlastFake" bisects your entire global script. You want to not do that. That entire bit should be somewhere else, and the line "BombBlastFake();" should be in its place in the global.
  • Cukeman likes this

#37 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 06 April 2016 - 10:58 PM

Oh, I didn't notice that "void BombBlastFake" bisects your entire global script. You want to not do that. That entire bit should be somewhere else, and the line "BombBlastFake();" should be in its place in the global.

global script Combined
{
    void run()
    {
        StartClock();
        
        while(true)
        {
            UpdateEWeapons();
            UpdateClock();
            CleanUpGhostFFCs();
            Tango_Update1();
 
 
void BombBlastFake()
 
            
            Waitdraw();
            
            AutoGhost();
            Tango_Update2();
            
            Waitframe();
        }
    }
}

{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}

like so?



#38 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 06 April 2016 - 11:01 PM

No, I put "BombBlastFake();" in quotation marks for a reason. Take this:

void BombBlastFake()
{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}
Move it entirely outside the global script. Put the quoted phrase in the spot you just moved it from.
  • Cukeman likes this

#39 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 06 April 2016 - 11:09 PM

So:
 

global script Combined
{
    void run()
    {
        StartClock();
        
        while(true)
        {
            UpdateEWeapons();
            UpdateClock();
            CleanUpGhostFFCs();
            Tango_Update1();
 
 
BombBlastFake();
 
            
            Waitdraw();
            
            AutoGhost();
            Tango_Update2();
            
            Waitframe();
        }
    }
}
 

void BombBlastFake()
{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}


#40 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 06 April 2016 - 11:15 PM

Yes. Although now that I'm looking at it more closely...who put this global together for you? It has a completely outdated ghost.zh setup.
  • Cukeman likes this

#41 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 06 April 2016 - 11:17 PM

Yes. Although now that I'm looking at it more closely...who put this global together for you? It has a completely outdated ghost.zh setup.

 

Thank you for your patient help. Wrapping my head around this easily frustrates me.

 

As for the global. It's an old version of Saffith's ghost.zh I know, but it's a version that I custom edited (with help). I did look at the newest ghost.zh but I couldn't see how to update it with the custom edit, so I'm still running the old one.


Edited by Cukeman, 06 April 2016 - 11:18 PM.


#42 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 06 April 2016 - 11:23 PM

The global you have now might still work. It's still missing the data update functions. I don't know what the "custom edit" was supposed to have been for, though.

Never mind, they're in there, just buried further in nested function calls. I still don't understand why it needed to be this way, though.

Edited by Lejes, 06 April 2016 - 11:25 PM.


#43 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 06 April 2016 - 11:36 PM

If you wanna know-

 

http://www.purezc.ne...e=3#entry794636

 

^ This is the custom edit to ghost.zh (2.3.1) that I pasted in the section labeled:

 

// |||| OTHER ||||
 
It's a mod that lets me make 32x32 enemies with custom hitboxes.
 
As for where the global framework came from, Saffith himself made it for me (to combine the current tango.zh with ghost.zh 2.3.1):
 

Edited by Cukeman, 06 April 2016 - 11:38 PM.


#44 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 06 April 2016 - 11:41 PM

Oh, you're using a Mac. That's why your directories were different and Saffith put that together for you.
  • Cukeman likes this

#45 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 07 April 2016 - 04:31 AM

 

the idea is to wait for the bomb to explode, and just drop another explosion in the exact same place. so ya, both explosions happen at the same time. one is meant to hurt enemys, one is meant to hurt link. 

 

here's the code. Set the constants. call BombBlastFlake(); in your global loop before Waitdraw();

 

totally untested.

superbombs could be added easily if you're faking those too.

const int LW_MISC_MARKED = 0;   // index to the misc array for an lweapon. value 0-15. choose something unused by other scripts.
const int BOMB_DAMAGE_TO_LINK = 0;  // the damage that Link's own bomb should hurt him. 
 
void BombBlastFake()
{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}

 

So anyway, we finally got it to compile-

 

I went into the quest rules and unchecked "Link's Bombs Hurt Link", but as far as I can tell, the script doesn't do anything. Link isn't taking any damage from the blast.

 

My script file:

import "std.zh"
import "string.zh"
import "ffcscript.zh"
import "ghost.zh"
import "tango.zh"


const int BOMB_DAMAGE = 4;
const int LW_MISC_MARKED = 0;
const int BOMB_DAMAGE_TO_LINK = 2;


global script Combined
{
    void run()
    {
        //Before while
        StartClock();
        
        while(true)
        {
            //Before Waitdraw
            UpdateEWeapons();
            UpdateClock();
            CleanUpGhostFFCs();
            Tango_Update1();
            BombBlastFake();
            
            Waitdraw();
            
            //After Waitdraw
            AutoGhost();
            Tango_Update2();
            
            Waitframe();
        }
    }
}


void BombBlastFake()
{
 lweapon w;
 eweapon ew;
 for (int i = Screen->NumLWeapons(); i > 0; i--)
 {
  w = Screen->LoadLWeapon(i);
  if (w->ID == LW_BOMBBLAST && w->Misc[LW_MISC_MARKED] != 1)
  {
   w->Misc[LW_MISC_MARKED] = 1;
   ew->X = w->X;
   ew->Y = w->Y;
   ew->Damage = BOMB_DAMAGE_TO_LINK;
  }
 }
}


//D0: SFX to play

item script SpawnLWeaponBomb{
     void run(int sound){
          //You have more than one bomb and there are no bombs on screen.
          if(Game->Counter[CR_BOMBS] >0 && NumLWeaponsOf(LW_BOMB)==0){
	        Game->PlaySound(sound);//Play the sound.
                //Spawn the bomb in front of Link and set the damage.
	        lweapon bomb = Screen->CreateLWeapon(LW_BOMB);
		bomb->X = Link->X+ InFrontX(Link->Dir,0);
		bomb->Y = Link->Y+ InFrontY(Link->Dir,0);
	        bomb->Damage = BOMB_DAMAGE;
                //Reduce in-game counter.
		Game->Counter[CR_BOMBS]--;
	   } 
     }
}



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users