Jump to content

Photo

A small item script request


  • Please log in to reply
7 replies to this topic

#1 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 05 November 2007 - 02:34 PM

All I need at the moment is a simple item script that spawns fire 16 pixels away from Link in the direction he is facing (Basically I want it to spawn in front of Link), and then after a couple seconds, disappears. Could somebody please do it for me? I suck at scripting. icon_sweat.gif



EDIT: You know what? I think I'm going to try and script it for myself anyways. I never even attempted to learn ZScript, so let's begin now. I think I know how to spawn the fire, but I have no idea how to make it disappear after that.



CODE
import "std.zh"
item script Link's Awakening Magic Powder
// This item script is basically another version of the Candle.
// It makes fire appear 16 pixels away from Link in the direction he is facing.
// After 90 tics (1.5 seconds), it will disappear.
{
  void run ()
  {
    int sound=59; // You can set that to any sfx you want.
    Weapon Powder= npc->Weapon(9);
    if(Link->Dir == 0)
    {
             Powder->X = Link->X;
             Powder->Y = Link->Y - 16;
    }
    else if(Link->Dir == 1)
    {
             Powder->X = Link->X;
             Powder->Y = Link->Y + 16;
    }
    else if(Link->Dir == 2)
    {
             Powder->X = Link->X - 16;
             Powder->Y = Link->Y;
    }
    else if(Link->Dir == 3)
    {
             Powder->X = Link->X + 16;
             Powder->X = Link->X;




In the script, I'm referring to the weapon fire as Powder because I'm basing it on the Magic Powder from LADX. Also, I set the sfx to 59 because even though that's not the sfx fire uses, it'll end up being the sfx I use. icon_wink.gif


Edited by Beta Link, 05 November 2007 - 09:17 PM.


#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 05 November 2007 - 09:18 PM

Done.

CODE

item script Magic_Powder{
    void run(int use_combo, int ffc_number, int sfx_number){

        ffc dust = Screen->LoadFFC(ffc_number);
        Game->PlaySound(sfx_number);

            if(Link->Dir == 0) {
                dust->X = Link->X;
                dust->Y = Link->Y - 16;
                dust->Data = use_combo;
            }
            if(Link->Dir == 1) {
                dust->X = Link->X;
                dust->Y = Link->Y + 16;
                dust->Data = use_combo;
            }
            if(Link->Dir == 2) {
                dust->X = Link->X - 16;
                dust->Y = Link->Y;
                dust->Data = use_combo;
            }
            if(Link->Dir == 3) {
                dust->X = Link->X + 16;
                dust->Y = Link->Y;
                dust->Data = use_combo;
            }
    }
}



D0 number of combo to use as animation. *HINT* use combo cycling.
D1 the ffc you will not be able to use for anything else while link has the magic powder. Probably 32.
D2 sfx to play when item is used.

void run(int use_combo, int ffc_number, int sfx_number)



#3 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 05 November 2007 - 09:25 PM

Oh... I guess I was a little slow then. Thankyou though, Gleeok. icon_smile.gif

Edit: One question: How do I set the amount of damage it does to an enemy? Also, I was kind of hoping it could use the actual Fire Weapon sprite, because FFCs can't both hurt enemies and activate certain secrets on the screen. Fire can. icon_confused.gif The Magic Powder needs to be able to not only hurt/kill enemies, but also be able to activate the Burn Flag. You know, in LA, when you sprinkle the Magic Powder on the Racoon in the forest, who is stopping you from getting the Tail Key, and the Racoon turns out to be Tarin? That's what you need to do in Island of Dreams.

Edited by Beta Link, 05 November 2007 - 10:42 PM.


#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 07 November 2007 - 02:37 AM

What!? You didn't specify damage as part of the script. Read here why this is currently not available.

http://www.purezc.co...showtopic=30704


Not to mention the damage script crash bug, lanmola and (moldorm?) bug, and leever bug you get with it.
nested and, and else statements with specific enemy damage handling might be necessarry for specail cases.

But I see you've just started those quests in your sig also, so this should be available without too much wait. I can script these as special cases, which is what i'm doing for myself, but I kinda failed at trying to make a damage script that everyone can use. Sorry. I'll give it another go when I have more free time though.

#5 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 07 November 2007 - 05:12 PM

Alright, thanks Gleeok. I realize I should have given more details about what I want. icon_sweat.gif I thought that all you would have to do is spawn the fire "weapon" and then make it disappear. I guess I was wrong though. icon_sweat.gif I guess I should read more about ZScript then.

#6 Aslion

Aslion

    End Fascism

  • Members
  • Real Name:Ryan
  • Location:Plug One's spectacles

Posted 07 November 2007 - 08:07 PM

Couldn't you just make a custom candle with the 'Remove after Use' checked?

Or do I not get what you want?

#7 Joe123

Joe123

    Retired

  • Members

Posted 08 November 2007 - 03:04 AM

You know, that's a very good point. If you can change the reach of the candle to one (which I think you can nowadays) then you could give it a script to put up a counter on pickup, and give it a script to put it back down on usage.

#8 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 08 November 2007 - 05:18 PM

If you can edit how far the candle's flame goes, it'll be perfect. As for the counter, I won't be needing it. I'll just use magic for that. icon_smile.gif I'm not using magic for anything else. There wasn't any magic meter in LA, so there won't be any magic meter in IoD.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users