Jump to content

Photo

Script Help


  • Please log in to reply
48 replies to this topic

#46 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 07 June 2015 - 01:04 PM

yeah, I edited my last post with a method, for you
 
NOT: If you want an item to appear in your subscreen, it must have "equipment item" checked, regardless of which method you obtain it by. This method just allows pickup scripts to run. If you're using a counter item, you can change 
if (Link->Item[ItemToGive] == false) 
to
//Add an extra argument to the top of  the script: int CR_NMB, and set it to the number of the counter you want to reference 
//use CR_ Constants in std.zh for number reference

if (Game->Counter[CR_NMB] == 0)
Though, I don't know why you'd ever want to give someone something only if their counter is completely empty, so here's another version that adds the item if the counter isn't full

//Add an extra argument to the top of  the script: int CR_NMB, and set it to the number of the counter you want to reference 
//use CR_ Constants in std.zh for number reference

if (Game->Counter[CR_NMB] < Game->MCounter[CR_NMB])

Edited by Binx, 07 June 2015 - 01:45 PM.


#47 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 07 June 2015 - 03:05 PM

The method you gave me should work, but for some reason, Link just doesn't get the item. I've tried it with items like the wallet, but the script just doesn't give him the item. Maybe something else in the script is messing it up? Not sure. Just in case, I'll put my script file here:

Script

It all worked fine before I added the line checking if Link already had the item, and he would get the item fine. Any help is appreicated.



#48 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 07 June 2015 - 03:16 PM

if ( !Link->Item[ItemToGive] == false)

should be 

if ( Link->Item[ItemToGive] == false)


sorry, that's my fault for not checking the lines before copying bits of code.



#49 Frocks7Snee

Frocks7Snee

    Illustrious

  • Members

Posted 07 June 2015 - 03:30 PM

It's fine, not really your fault anyway :P 

It works just as intended now, except I had to throw in a waitframe so Link gets the item after the message plays. Thanks for the help!


  • Binx likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users