Jump to content

Photo

Learning to combine scripts


  • Please log in to reply
69 replies to this topic

#61 grayswandir

grayswandir

    semi-genius

  • Members

Posted 13 July 2016 - 07:30 PM

Well, you can only have a total of 32 ghosted enemies at one time. (Less if you're using ffcs for some other reason as well)

8,9,23, and 24 seem unnecessary. 8 and 9 are saving the position, and then 23 and 24 are restoring it, but nothing inbetween is actually affecting the position at all.

11 and 12 are saving Link's collision box size, and then 13 and 14 are changing it to 15x15. 19 and 20 are changing the size back to what 11 and 12 saved it as. So it's temporarily changing Link's collision box, testing to see if the likelike is touching link with that changed box (17 & 18), and then changes it back.

 

 

(As an aside, I'm not sure if you can actually change Link's collision box like that, as far as the engine is concerned, it might not do anything. The LinkCollision function that the script is using apparently takes it into account, though, even if the engine doesn't.)


Edited by grayswandir, 13 July 2016 - 07:32 PM.


#62 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 14 July 2016 - 02:04 AM

Well, you can only have a total of 32 ghosted enemies at one time. (Less if you're using ffcs for some other reason as well)


32 ghosted per type, right? 'cause there's more than 32 ghosted gibdos here:
 
zyd9xg.jpg
 
As far as I'm concerned there's no reason for more than 32 enemies total anyway.
I just don't want to limit the user to a tiny number of enemies if they're using lots of FFC slots.
 

8,9,23, and 24 seem unnecessary. 8 and 9 are saving the position, and then 23 and 24 are restoring it, but nothing inbetween is actually affecting the position at all.

11 and 12 are saving Link's collision box size, and then 13 and 14 are changing it to 15x15. 19 and 20 are changing the size back to what 11 and 12 saved it as. So it's temporarily changing Link's collision box, testing to see if the likelike is touching link with that changed box (17 & 18), and then changes it back.
 
 
(As an aside, I'm not sure if you can actually change Link's collision box like that, as far as the engine is concerned, it might not do anything. The LinkCollision function that the script is using apparently takes it into account, though, even if the engine doesn't.)

 

Thanks for this, I believe that the position saving and restoring was meant to keep the Like Like from being knocked out of place, because i wanted a stationary enemy at the time. I'm just looking to make an oridinary Like Like at the moment.

 

Dunno what the purpose of changing Link's hitbox is, that seems unnecessary.



#63 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 14 July 2016 - 02:12 AM

32 ghosted per type, right? 'cause there's more than 32 ghosted gibdos here:
zyd9xg.jpg

As far as I'm concerned there's no reason for more than 32 enemies total anyway.
I just don't want to limit the user to a tiny number of enemies if they're using lots of FFC slots.

One ffc can control up to 255 (active) npcs. It depends entirely on how it's designed.

It's easier to do that for user-specific purposes, rather than a general-use script for the database.

Link hitbox adjustment for a custom LikeLike? Migh tbe to restrain the 'grab' area sothat the enemy doesn't Kirby Link into it. Ordinary LikeLike npcs don't use the full Link hitbox to determine if he is swallowed.

There are quite the many reasons to have more than 32 npcs on the screen, and other things need ffc slots, including some item scripts, and some global scripts. The thing is, that autoghosted enemies run ffcs from ordinary placed npcs on the screen, so you have ten of those to use, not 32.

That doesn't mean that they might not need more ffcs, but it'd be pretty bad design for a ghosted enemy to runother ffcs from within itself, save in exceptional cases.

Edited by ZoriaRPG, 14 July 2016 - 02:16 AM.


#64 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 14 July 2016 - 02:29 AM

Okay so, if ghosting isn't the best way to script an enemy, what do you suggest?

 

I was avoiding FFCs because I thought I was using less FFC slots by ghosting (guess I was wrong), and I didn't want the user to have to go through the tedium of setting up a FFC for each enemy on each screen.

 

EDIT:


Link hitbox adjustment for a custom LikeLike? Migh tbe to restrain the 'grab' area sothat the enemy doesn't Kirby Link into it. Ordinary LikeLike npcs don't use the full Link hitbox to determine if he is swallowed.
 

 

I think you're right. Since it was stationary I didn't want Link to get eaten unless he really touched it.


Edited by Cukeman, 14 July 2016 - 02:30 AM.


#65 cavthena

cavthena

    Apprentice

  • Members
  • Real Name:Clayton
  • Location:I wish I knew

Posted 14 July 2016 - 09:08 AM

Ghost is the best method to script custom enemies. You do use an ffc but in all honesty who cares? If you were to script an enemy without using ghost you'd still end up using an ffc. Also remember that it's not only how many enemies you can fit on screen but how many can you fit before you start sending frames to their doom.

P.s. Why are you worried about using ffcs in the first place?

#66 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 14 July 2016 - 02:32 PM

Ghost is the best method to script custom enemies. You do use an ffc but in all honesty who cares? If you were to script an enemy without using ghost you'd still end up using an ffc. Also remember that it's not only how many enemies you can fit on screen but how many can you fit before you start sending frames to their doom.

P.s. Why are you worried about using ffcs in the first place?

 

Because people keep telling me it's not a good idea, I guess.



#67 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 12 August 2016 - 02:05 PM

Trying some simple scripting today:

item script FullMagicMeterSFX{
    void run()
    {


    if ( Link->MP = Link->MaxMP ) {
        Game->PlaySound(82);
        }
    }
}
 
ERROR: unexpected assign, expecting RParen on token =

Edited by Cukeman, 12 August 2016 - 02:08 PM.


#68 cavthena

cavthena

    Apprentice

  • Members
  • Real Name:Clayton
  • Location:I wish I knew

Posted 12 August 2016 - 02:13 PM

Error: if(Link->MP = Link->MaxMP)

Fix: if(Link->MP == Link->MaxMP)

You need compare link's MP with his max not set it.
Try making a constant to replace the 82. So you have a discription of what kind of sound is played. In case you need to come back later.

Edit: for the love of... In done posting today. Ninja'd again! Grr!

Edited by cavthena, 12 August 2016 - 02:14 PM.

  • Cukeman likes this

#69 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 12 August 2016 - 02:14 PM

Error: if(Link->MP = Link->MaxMP)

Fix: if(Link->MP == Link->MaxMP)

You need compare link's MP with his max not set it.
Try making a constant to replace the 82. So you have a discription of what kind of sound is played. In case you need to come back later.

Edit: for the love of... In done posting today. Ninja'd again! Grr!

 

Thanks, I found the error, but didn't know how to fix it

 

Note to self: "is" (to set) versus "is equal" (for 'if's)


Edited by Cukeman, 12 August 2016 - 02:43 PM.


#70 cavthena

cavthena

    Apprentice

  • Members
  • Real Name:Clayton
  • Location:I wish I knew

Posted 12 August 2016 - 04:10 PM

Remember that the = and == operators never change no matter where you use them.

"=" is to assign, while "==" is to compare if two values are equal to each other.

For example. Link has a max of 40mp.
Then the following would set is current MP to 40.
Link->MP = Link->MaxMP;

Here is an extra example. If Link has 20mp and his max is 40 then "full" is false.
bool full = Link->MP == Link->MaxMP;


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users