Jump to content

Photo

Pot Script


  • Please log in to reply
19 replies to this topic

#1 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 11 November 2011 - 05:05 AM

So the idea is that when Link slashes the "Slash > Next" combo directly under the FFC's location:
play SFX - D0
drop item - D1

If someone could do this, that'd be awesome.

Edited by Cukeman, 11 November 2011 - 05:06 AM.


#2 Supindahood

Supindahood

    Wizard

  • Members
  • Real Name:Jonathan
  • Location:Sweden

Posted 18 November 2011 - 09:37 AM

This would be really useful, and I would use it!

#3 LinktheMaster

LinktheMaster

    Hey Listen, Kid

  • Members
  • Real Name:Matt
  • Location:United States

Posted 18 November 2011 - 09:47 AM

Simple enough. icon_razz.gif Took me not even 5 minutes. No special extras or anything, though.

CODE
// Script that will check the combo under it
// When the combo changes (be it script, slash->next, etc.)
// It will play the given sfx and give the requested item
    // d0 = Item number
    // d1 = Sound effect
ffc script potScript
{
    void run(int itm, int sfx)
    {
        // Grab the combo under the FFC initially
        int combo = Screen->ComboD[ComboAt(this->X+4, this->Y+4)];

        // While that combo is the same, wait
        while(Screen->ComboD[ComboAt(this->X+4, this->Y+4)] == combo)
            Waitframe();

        // Create the item
        item temp = Screen->CreateItem(itm);
        temp->X = this->X;
        temp->Y = this->Y;
        temp->Pickup |= (IP_TIMEOUT);
        temp->HitWidth = 16;
        temp->HitHeight = 16;

        // Play the given sound effect
        Game->PlaySound(sfx);
    }
}


Note that I swapped the two variables because I felt like the item number is more important than the sound effect (making it easier for people who don't want to have a special SFX). Also note that this doesn't have to be activated by slash->next. You can use this with anything, be it flags, other combo types, whatever. It just checks for when the combo under it changes.

#4 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 18 November 2011 - 09:49 AM

Edit: Dang, I've been ninja'd!

Not sure if this will work, but give it a try...
CODE
ffc script pot
{
    void run ( int sfx, int item )
    {
        int position = ComboAt(This->X, This->Y);
        int potcombo = Screen->comboD[position];
        while(Screen->comboD[position] == potcombo)
        {
            Waitframe();
        }
        Game->PlaySound(sfx);
        
        //Item spawning code stolen from shop script
        item Spawn = Screen->CreateItem(item);
        Spawn->HitWidth = 16; Spawn->HitHeight = 16;
        Spawn->X = This->X; Spawn->Y = This->y;
        
    }
}

Edited by MoscowModder, 18 November 2011 - 11:58 AM.


#5 Supindahood

Supindahood

    Wizard

  • Members
  • Real Name:Jonathan
  • Location:Sweden

Posted 18 November 2011 - 09:55 AM

Wow, 2 different but yet same scripts? I will try out both of these later when i have time. icon_wink.gif

#6 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 November 2011 - 11:04 AM

icon_smile.gif

Hi

Could i also use Pot Script?



#7 LinktheMaster

LinktheMaster

    Hey Listen, Kid

  • Members
  • Real Name:Matt
  • Location:United States

Posted 18 November 2011 - 11:29 AM

I don't mind if you use mine. icon_smile.gif

There's really a better way to do this script, but it'll take a bit longer and will have to wait until I'm off work.

#8 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 November 2011 - 11:34 AM

QUOTE(LinktheMaster @ Nov 18 2011, 07:29 PM) View Post

I don't mind if you use mine. icon_smile.gif

There's really a better way to do this script, but it'll take a bit longer and will have to wait until I'm off work.



Oh thank you

#9 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 18 November 2011 - 11:58 AM

You're also free to use mine... but I'm guessing LTM's is better.

#10 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 November 2011 - 12:01 PM

QUOTE(MoscowModder @ Nov 18 2011, 07:58 PM) View Post

You're also free to use mine... but I'm guessing LTM's is better.


Thank you too. i try them both then i just pick up one


#11 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 18 November 2011 - 03:35 PM

awesome, can't wait to try it out

#12 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 November 2011 - 03:39 PM

QUOTE(Cukeman @ Nov 18 2011, 11:35 PM) View Post

awesome, can't wait to try it out


And Cukeman it was your idea so i ask you also if i can use pot script also?


#13 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 18 November 2011 - 03:46 PM

of course

#14 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 18 November 2011 - 03:48 PM

QUOTE(Cukeman @ Nov 18 2011, 11:46 PM) View Post

of course


And thanks to you also icon_thumbsup.gif


#15 Nightmeres

Nightmeres

    Defender

  • Members

Posted 18 November 2011 - 04:15 PM

can i use it?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users