Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Something Wrong with AddUseItemCallback?
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Something Wrong with AddUseItemCallback?

PHP Code: (Select All)
for(int i 1<= 3i++)
{
    if(
asItem != "bucket_"+i)
    {
            
AddDebugMessage("Item not the bucket, no interaction occurs."false);
            return;
    }


This could potentially be an issue. Here you loop 3 times where i = 1, 2 and 3, but when you do the check for "bucket_1" and it passes, return is called, which ends the entire function, so you never get to try for "bucket_2" or 3.

Other than that, this is a fairly long snippet of code, so it's hard to visualize exactly what you're doing (or trying to do) with just this text. If you can explain what you want to happen and what actually happens, then we can go from there.
I suspect the script could be simplied a lot, and in doing so avoid a lot of confusing bugs like these.

Edit: Well I see you got it fixed. Ah well Smile

(This post was last modified: 03-16-2018, 07:50 PM by Mudbill.)
03-16-2018, 07:49 PM
Find


Messages In This Thread
Something Wrong with AddUseItemCallback? - by AGP - 03-16-2018, 07:59 AM
RE: Something Wrong with AddUseItemCallback? - by Mudbill - 03-16-2018, 07:49 PM



Users browsing this thread: 1 Guest(s)