Jump to content

Photo

Simple Item Script


  • Please log in to reply
6 replies to this topic

#1 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 17 March 2018 - 02:36 AM

I think this should be the last script I need, a button item that plays String 2 when you press the button it's assigned to.



#2 Quanta

Quanta

    King of Thieves

  • Members
  • Real Name:Willem
  • Location:Earth

Posted 17 March 2018 - 02:48 AM

//D0: id of the item
//D1: string # of the string to play

item script itemstring {
    void run(int itemid, int string) {
        if(Link->PressA && (GetEquipmentA() == itemid)) {
            Screen->Message(string);
        }
        else if(Link->PressB && (GetEquipmentB() == itemid)) {
            Screen->Message(string);
        }
    }
}

Not at all tested, but should still work.


Edited by Ganondorf, 17 March 2018 - 02:54 AM.

  • Cukeman likes this

#3 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 17 March 2018 - 08:09 AM

You may be able to put the item pickup message in the action slot.

I haven't tried it yet. But I was planning on trying it.

#4 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 17 March 2018 - 08:37 AM

Thank you Ganondorf!



#5 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 17 March 2018 - 10:24 AM

Not at all tested, but should still work.

You didn't have to check for pressing the button. The action script only happens when you use the item anyway.

#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 17 March 2018 - 10:32 AM

Aye:

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


#7 Cukeman

Cukeman

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

  • Banned
  • Location:Hyrule/USA

Posted 11 April 2018 - 05:25 AM

//D0: id of the item
//D1: string # of the string to play

item script itemstring {
    void run(int itemid, int string) {
        if(Link->PressA && (GetEquipmentA() == itemid)) {
            Screen->Message(string);
        }
        else if(Link->PressB && (GetEquipmentB() == itemid)) {
            Screen->Message(string);
        }
    }
}

Not at all tested, but should still work.

 

 

What are the possibilities of putting it on L? It would be the only thing possible to be on L (and be there from the start).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users