1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

Can I make a placeable into an item?

Discussion in 'Neverwinter Nights (Classic)' started by Dice, Jul 24, 2005.

  1. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    I would like to use a CEP placeable of a pie as an item in my game that you can pick up. Is there a way that I can do this. If I make a custom "item" the little graphic that appears for it is a boring treasure bag but if I could use the graphic from the placeable it would be much better. Can anyone help me with this please?

    [ July 26, 2005, 15:08: Message edited by: Taluntain ]
     
  2. Alavin

    Alavin If I wanted your view, I'd read your entrails Veteran

    Joined:
    Aug 26, 2003
    Messages:
    930
    Likes Received:
    0
    Bioware did it in HotU with their Alchemists' Fire barrels, so it's certainly possible. Give this a go:

    object oitem = GetModuleItemLost();
    object oPie = GetObjectByTag("Pie");
    if (oItem = oPie)
    {
    CreateObject(OBJECT_TYPE_PLACEABLE, "pieplaceablestrref", GetLocation(oPie));
    DestroyObject(oPie);
    }

    C&P that to the bottom of the OnUnAcquireItem script in Module Properties, and replace the Pie in GetObjectByTag("Pie") with the tag of the pie inventory item, and pieplaceablestrref with the strref of the pie placeable. Should work, although I haven't tested it or anything.

    EDIT: Oops, that's for dropping the item to get a pie placeable. For a placeable to item, just do:

    CreateItemOnObject("pieitemstrref", GetNearestCreature(PLAYER_CHAR_IS_PC, TRUE));
    DestroyObject(GetObjectByTag("Pie"));

    in the placeable's OnUsed script. Make sure the placeable's set to Useable first. ;) pieitemstrref refers to the item's strref, and Pie is the placeable's tag. I hope I understood this time... it's too early for me.
     
  3. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    Thanks Alavin. I tried the script and made sure my placeable was checked usable but it did not work for me when I compiled. This is what I typed into the "on used" area.

    void main()

    object oitem = GetModuleItemLost();
    object oPie = GetObjectByTag(ZEP_PIE002);
    if (oItem = oPie)
    {
    CreateItemOnObject("pieitemstrref", GetNearestCreature(PLAYER_CHAR_IS_PC, TRUE));
    DestroyObject(GetObjectByTag("ZEP_PIE002"));


    }


    When I tried to save and compile I got this error message:
    PM:Error. 'makepietoitem' did not compile. makepietoitem.nss(3) : ERROR: UNKNOWN STATE IN COMPILER

    So what did I do wrong?
     
  4. Rotku

    Rotku I believe I can fly Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!)

    Joined:
    Apr 13, 2003
    Messages:
    3,105
    Likes Received:
    35
    void main()
    {
    object oPC = GetLastUsedBy();
    if (!GetIsPC(oPC)) return;
    CreateItemOnObject("pieitemstrref", oPC);
    object oTarget;
    oTarget = OBJECT_SELF;
    DestroyObject(oTarget, 0.0);
    }

    That should work. If I understand right you shouldn't need the If command.
     
  5. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    The script compiled successfully. When I sent my PC to pick it up it disappeared nicely. The only problem was that it didn't appear in the inventory. I also realized that it will not replace the custom plot item that I already created so I don't think I'll be able to make this work. I appreciate the script though, and might be able to use it for a different purpose.

    I'm not sure how, but I think I would actually have to replace the 3D graphic of a bag on my "apple pie" item to the graphic that is used by the placeable item of a pie.
     
  6. Rotku

    Rotku I believe I can fly Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!)

    Joined:
    Apr 13, 2003
    Messages:
    3,105
    Likes Received:
    35
    Hmm... prehaps I'm understanding you wrong then. I was just looking at your script, as the other stuff in the first post went right over my head.
    What that script should do is, when the placeable is used:
    • Creates an item with the resref "pieitemstrref"
    • Destroies the placeable that the script was on.
    If you wanted something different, prehaps you could try explaining it again. Might get through my thick skull this time round ;)

    [ July 26, 2005, 11:48: Message edited by: Rotku ]
     
  7. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    You don't have a thick skull, I have a thick tongue.

    I have a custom item that I have created in the game. It is a pie. This pie has to be retrieved and delivered to aquire some gold and xp. I was able to find a small graphic of a pie to use as the image that appears in the inventory screen. It is the 3D image to the left on the item editor screen that I wish to change.

    If I place the item on my map screen it will appear as a loot bag. I have found a graphic of a pie in the "placeables" that would look much better then the loot bag. Your script worked nicely to "pick up" the pie and make it disappear but I realized that instead of altering the placeable maybe there was a way I could alter the custom made item so that it could have the 3D graphic of the pie placeable. The tag I used in the script is the exact tag that the creator of that custom placeable gave it. It is from the CEP.

    I hope I was a little bit more clear about my intentions. Sorry for the confusion.
     
  8. Rotku

    Rotku I believe I can fly Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) New Server Contributor [2012] (for helping Sorcerer's Place lease a new, more powerful server!)

    Joined:
    Apr 13, 2003
    Messages:
    3,105
    Likes Received:
    35
    Ah! Well, I'm afraid I have no idea how that would be done. I'm guessing you'll need a 3D editor and to create a Hak - but don't quote me on that.
     
  9. Dice

    Dice ★ SPS Account Holder Adored Veteran

    Joined:
    Jun 23, 2002
    Messages:
    5,125
    Media:
    24
    Likes Received:
    149
    Gender:
    Female
    Well thanks for getting back to me. I think I can stop worrying about it now and just get over it. I'll just hide the pie in a chest or something. I did like the script you gave me though. Its always good to be able to make things disappear when you touch them. Wish that would work with my bills.
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.