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.)

Gaining items script

Discussion in 'BG2: Shadows of Amn (Classic)' started by Cold_Hawaiian, Sep 26, 2005.

  1. Cold_Hawaiian Gems: 2/31
    Latest gem: Fire Agate


    Joined:
    Sep 16, 2005
    Messages:
    28
    Likes Received:
    0
    So I have looked on 3 different forums before posting, so don't say I'm lazy or nothing. Anyway, what do I put, and where do I put it, if I want the party to "Gain an item" like during a quest dialog? In the .D? What do I input, the CLUA stuff?
     
  2. magpie Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Sep 20, 2005
    Messages:
    3
    Likes Received:
    0
    Go look round the walkthroughs on this site, dan simpson has done a fantastic walkthrough and the several I down loaded it gave excellant info on what your looking for... beware tho once you start creating items... its addictive
     
  3. olimikrig

    olimikrig Cavalier of War Distinguished Member ★ SPS Account Holder Resourceful Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) BoM XenForo Migration Contributor [2015] (for helping support the migration to new forum software!)

    Joined:
    Aug 20, 2004
    Messages:
    1,876
    Media:
    472
    Likes Received:
    21
    Gender:
    Male
    @ Cold, do this:

    In your .d file set up something like this:
    Code:
    IF ~Global("something","GLOBAL",0)~ THEN BEGIN 0
      SAY ~Do you want this item?~
      IF ~~ THEN REPLY ~Yes please.~ DO ~SetGlobal("something","GLOBAL",1)~ EXIT
    END
    replace something with whatever you want to.
    you could also just replace the "IF ~Global("something","GLOBAL",0)~ THEN BEGIN 0" with "IF ~~ THEN BEGIN 1"

    Make a new file called "something" (whatever):
    Code:
    IF
    Global("something","GLOBAL",1)
    HasItem("MISC52",Myself)
    THEN
    RESPONSE #100
    GiveItem("MISC52",Player1)
    SetGlobal("something","GLOBAL",2)
    END
    Save this as a .baf file and compile it with WeiDU (or the script compiler).

    For this to work, you have to first Give the creature, NPC whatever the item via ShadowKeeper or CreatureMaker or whatever. Also note that you will have to assign the script itself to the .cre using CreatureMaker, or some such.

    In the above mentioned example, the NPC will give whomever he talks to a Wyvern head, if he has this item.

    If you're still confused, then try to post some more of your dialog, then I'll put in the reference to gain the item in that.

    [ September 27, 2005, 13:30: Message edited by: olimikrig ]
     
  4. Cold_Hawaiian Gems: 2/31
    Latest gem: Fire Agate


    Joined:
    Sep 16, 2005
    Messages:
    28
    Likes Received:
    0
    Gotcha, so it needs a new .baf file with the above commands and item code. Thanks, lots of dialog tutorials online, not to many script tutorials.

    btw, I am assuming that in the line:

    HasItem("MISC52",Myself)

    Myself = NPC name
     
  5. olimikrig

    olimikrig Cavalier of War Distinguished Member ★ SPS Account Holder Resourceful Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) BoM XenForo Migration Contributor [2015] (for helping support the migration to new forum software!)

    Joined:
    Aug 20, 2004
    Messages:
    1,876
    Media:
    472
    Likes Received:
    21
    Gender:
    Male
    Well, no. You can put it into the creatures already existing script. As you set it to a global variable the give item will only occue if you select the right dialog options.

    No, myself should just be "Myself".
     
  6. Cold_Hawaiian Gems: 2/31
    Latest gem: Fire Agate


    Joined:
    Sep 16, 2005
    Messages:
    28
    Likes Received:
    0
    Ah, I see. The .baf is the NPC's .baf, either a new one for a new NPC or appending an old one. Ok then, if I want them to take an item I would put down: TakeItem("MISC52",Player1)?
     
  7. olimikrig

    olimikrig Cavalier of War Distinguished Member ★ SPS Account Holder Resourceful Veteran Pillars of Eternity SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) Torment: Tides of Numenera SP Immortalizer (for helping immortalize Sorcerer's Place in the game!) BoM XenForo Migration Contributor [2015] (for helping support the migration to new forum software!)

    Joined:
    Aug 20, 2004
    Messages:
    1,876
    Media:
    472
    Likes Received:
    21
    Gender:
    Male
    If you want your player to "take"/get the item the NPC has, then you will put it like I wrote above.

    You could also simply create the item in the Inventory of your char, though it would still be on the NPC though.

    [ September 28, 2005, 12:29: Message edited by: olimikrig ]
     
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.