Jump to content

Photo

[Solved] A (Possible) ZC Bug?

Help Question

  • Please log in to reply
6 replies to this topic

#1 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 05 September 2017 - 07:27 PM

I've run into a rather odd issue. I'm using Nick's Bundle Script item as follows:

// This script is a pickup script that will give some items.
// This was mostly made to bundle the Bow and Arrows into one item,
// but it could have other uses.
// Bundle this with an item that increases a counter to also increase counters.
//         D0-D7: Items to give.
//        D0: If D0 is negative, it will display an item pickup message containing the positive version of the number entered...
item script itemBundle{
    void run(int item1, int item2, int item3, int item4, int item5, int item6, int item7, int item8)
    {
        if(item1 > 0)
            Link->Item[item1] = true;
        if(item2 > 0)
            Link->Item[item2] = true;
        if(item3 > 0)
            Link->Item[item3] = true;
        if(item4 > 0)
            Link->Item[item4] = true;
        if(item5 > 0)
            Link->Item[item5] = true;
        if(item6 > 0)
            Link->Item[item6] = true;
        if(item7 > 0)
            Link->Item[item7] = true;
        if(item8 > 0)
            Link->Item[item8] = true;
            
        // Display Item pickup message?
        if(item1 < 0)
        {
            Screen->Message(item1 * -1);
        }
    }//!End void run()
}//!End item script itemBundle

I'm using it to bundle the Bow, Arrow, and Quiver (Small) items into one. I have the quiver set to give an amount of 30 arrows when picked up and set the Arrow Counter Max to 30 as well. However, when testing it, it just doesn't work... The dummy item that has this script attached does give me all three items, but it doesn't give me the arrows (the ammo of 30, the "Arrow" Item is given), nor does it set the counter max to 30 (I verified this by using cheats and checking Link Data).

 

But, if I disable the Quiver (Small) item, continue the game, re-enable it and continue the game (all of this by using cheats), the counter max is set to 30, but still no arrows...

 

I have no effin idea what's going on, and I can confirm that my idea works, because I tested it on Hylian's Legacy and it works just fine. I even doubled checked my settings on both quests and both are the exact same thing. So... why is it that it works on one quest but it doesn't on another? Can anybody give me an inside on what the hell is going on!? 

 

Thank you very much. :)


Edited by Demonlink, 05 September 2017 - 10:51 PM.


#2 cavthena

cavthena

    Apprentice

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

Posted 05 September 2017 - 07:56 PM

Items given via string codes or scripts will not affect counters or max counters. If you want to change the counter you either need to make the item you actually pickup change the counters or change the counters via script manually.
  • Demonlink likes this

#3 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 05 September 2017 - 07:59 PM

Items given via string codes or scripts will not affect counters or max counters. If you want to change the counter you either need to make the item you actually pickup change the counters or change the counters via script manually.

Is that so? But my question remains. How is it possible that the script gives the item, and the item at the same time does increase the counter/max counter in one quest, and in the other, doesn't? Or is this the case of an unexplained answer?

 

... Still, I'll have to script a fix for this it seems. Thanks for an insight cavthena! :)



#4 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 05 September 2017 - 10:54 PM

Everyone forget it, turns out I was wrong. As cavthena pointed, counters can't be increased via SCC or scripts in an indirect manner. What I didn't notice, was that in Hylian's Legacy, the dummy item that had the script attached was the item that also increased the counters, not the quiver. So basically, I solved my own issue.

 

... ... ...

 

Geez, this is really embarrasing. :P


  • Naru likes this

#5 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 06 September 2017 - 04:32 AM

When giving the player items through a script, you can also make sure all associated actions are triggered by spawning the item directly on top of Link, instead of manually setting the item to true.


  • Demonlink likes this

#6 Demonlink

Demonlink

    Lurking in the shadows...

  • Members
  • Real Name:Miguel
  • Location:Wouldn't you like to know?

Posted 06 September 2017 - 10:24 PM

When giving the player items through a script, you can also make sure all associated actions are triggered by spawning the item directly on top of Link, instead of manually setting the item to true.

Basically setting the item's coordinates the same as Link's position? Yes, that should also work... Hmmm... still, I find it curious how some stuff differs from doing it manually and by scripting.



#7 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 07 September 2017 - 03:46 AM

Yes, you spawn an item and set its position to Link->X and Link->Y. And if you disable holding up the item and set its collection sfx to 0, the player won't even notice anything.


  • Naru likes this



Also tagged with one or more of these keywords: Help, Question

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users