User Tag List

Results 1 to 5 of 5

Thread: Item pickup Scripts?

  1. #1
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.39%

    Item pickup Scripts?

    How do you access them? Are they implemented in b14?

    I'm asking this because I saw this in the documentation.
    Avatar: Just who the SPAAAACE do you think I am?

  2. #2
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.39%

    Re: Item pickup Scripts?

    How do you use/make them in b15, now that it's out?
    Avatar: Just who the SPAAAACE do you think I am?

  3. #3
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: Item pickup Scripts?

    The code to give Link an item is just:

    Link->Item[#];

    The # is going to be a number that matches the item you want to give Link. Open the std_lib.z file that comes with b15, you'll find a list of item numbers there. Don't use itemclass - use item numbers (further down).

    Picking apart that command for you:
    Link = This is the "Link" object. He carries around a whole bunch of information regarding his inventory and health.
    -> = This is a pointer command. It tells the engine to look at the Link object, and then specifically look at a particular piece of information he's carrying around.
    Item[#] = This is a piece of information Link is carrying around. It's true if Link has the item numbered #, and false if he does not. So set it to true to give him an item, set it to false to take it away. Or you can check if he has an item or not: if(Link->Item[#])

    I think it works a little differently for items like small hearts and bombs, that have counters, however.

  4. #4
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,710
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.39%

    Re: Item pickup Scripts?

    No, I think it means a script that runs when you pick up an item. That's what I want to know.
    Avatar: Just who the SPAAAACE do you think I am?

  5. #5
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.9%

    Re: Item pickup Scripts?

    Same answer.
    1. Set a variable to zero.
    2. Check Link->Item[#] to see if Link has that item.
    3. When Link has the item and the variable is zero, run the script you want to activate on pickup.
    4. Then, set the variable to a nonzero value to prevent it from happening again.

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