User Tag List

Results 1 to 4 of 4

Thread: Detecting if an item has been picked up.

  1. #1
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,560
    Level
    30
    vBActivity - Bars
    Lv. Percent
    51.71%

    Detecting if an item has been picked up.

    I was originally detecting a collision between Lnk and the item but this seems to be flawed due to weird item hitboxes. BigJoe's idea is to just check if the item becomes invalid. I am not certain this is full-proof just yet. This seems to work fine in an FFC script but global script would be more complicated. And what about FFCs carrying over?

    Is there another way to do it?

  2. #2
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,815
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,933
    Level
    33
    vBActivity - Bars
    Lv. Percent
    23.45%
    With the first method: If an item disappears then it would count as a pickup, so that's no good for all items but would still work for some. The easiest way would probably be ... *wait for it* ... Item pickup scripts.

    Code:
    //script that when set to an item pickup slot maims Link.
    item script MyNefariousItemPickup
    {
      void fun()
      {
        //item has been picked up already
        Link->HP = 1;
        FunctionThatLetsAScriptKnowTheItemWasPickedUpWowThisIsAReallyLongNameDood();
      }
    }
    I think this is what you were looking for.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  3. #3
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,560
    Level
    30
    vBActivity - Bars
    Lv. Percent
    51.71%
    Unfortunately, no. That could work if it was just one item but the item is set through an ffc argument so it can be any in game item. It would be nice to assign a script to an item on demand. That could get in the way of a already assigned item script though...

    I think i may figure out where the collision actually happens.

  4. #4
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,815
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,933
    Level
    33
    vBActivity - Bars
    Lv. Percent
    23.45%
    Yuck.
    Okay: Plan B Hack: If the item is null then just extend the items hitbox by 16. If there's a collision with that then Link probably picked up the item.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social