User Tag List

Results 1 to 3 of 3

Thread: Duplicating an item class?

  1. #1
    Octorok Binx's Avatar
    Join Date
    Feb 2006
    Age
    36
    Posts
    157
    Mentioned
    9 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,220
    Level
    11
    vBActivity - Bars
    Lv. Percent
    95.45%

    Duplicating an item class?

    Ok, it seems to me this should be really simple, but thus far, even the most basic of scripts seem to be above my head. I'm looking for an item script that will simply clone an existing item class and set it to a custom class. The basic idea is that if I want, say, a fire or ice rod, existing scripts (the ones I've seen, at least) would have me attach it to a wand, so I wouldn't be able to place both into different slots on the subscreen. What I'm specifically wanting to do is to clone the Potions item class, so that I can have different types of potion (HP, MP, HP/MP) occupy different slots. But I'm sure I'd find other uses for it down the line. New things to try occur to me all the time.
    Last edited by Binx; 04-27-2013 at 03:24 PM. Reason: forgot three crucial words

  2. #2
    Admiral Zim's Avatar
    Join Date
    Oct 2012
    Posts
    388
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    1,699
    Level
    13
    vBActivity - Bars
    Lv. Percent
    82.77%
    Quote Originally Posted by lineas View Post
    Ok, it seems to me this should be really simple, but thus far, even the most basic of scripts seem to be above my head. I'm looking for an item script that will simply clone an existing item class and set it to a custom class. The basic idea is that if I want, say, a fire or ice rod, existing scripts (the ones I've seen, at least) would have me attach it to a wand, so I wouldn't be able to place both into different slots on the subscreen. What I'm specifically wanting to do is to clone the Potions item class, so that I can have different types of potion (HP, MP, HP/MP) occupy different slots. But I'm sure I'd find other uses for it down the line. New things to try occur to me all the time.
    Code:
    item script Potion
    {
    void run(int a,int b, int c)
     {
     if(a==0){Link->HP+=b;}
     if(a==1){Link->MP+=c;}
     if(a==2){Link->HP+=b;Link->MP+=c;}
     }
    }
    Set this script to your custom item script slot.
    Arg D0 set to 0 is HP potion, 1 is MP potion, 2 is HP/MP.
    Arg D1 is amount of HP it will recover.
    Arg D2 is amount of MP it will recover.
    Place the item script outside your global.

  3. #3
    Octorok Binx's Avatar
    Join Date
    Feb 2006
    Age
    36
    Posts
    157
    Mentioned
    9 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,220
    Level
    11
    vBActivity - Bars
    Lv. Percent
    95.45%
    Ok, so the attributes in the item editor can all be set in a script the way you did here, then? Thanks a lot for the script. I'll implement it right away


    EDIT: Thanks a lot, it works perfectly!
    Last edited by Binx; 04-27-2013 at 06:01 PM.

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