Jump to content

Photo

how do u place items in a vendor


  • Please log in to reply
7 replies to this topic

#1
aladarxp

aladarxp

    Newbie

  • Members
  • Pip
  • 15 posts
OK I created two new items but I am unsure how to place them on a vendor so that my pc can purchase them

#2
hdhd

hdhd

    Enthusiast

  • Members
  • PipPip
  • 222 posts
You have to create a script(untested!):
[codebox]
#include "wrappers_h"
void main()
{
object vendor = GetObjectByTag("store_camp_bodahn");
CreateItemOnObject(R"your_item.uti", vendor);
}
[/codebox]
This would give the vendor in the player camp your_item.uti.

#3
aladarxp

aladarxp

    Newbie

  • Members
  • Pip
  • 15 posts
Thank you very much

#4
hdhd

hdhd

    Enthusiast

  • Members
  • PipPip
  • 222 posts
I made a much better script (original script by joshimoo). This one checks if an item was already added to the merchant.
Here's a small tutorial:
1. Create a plot named quickitem000pl_main.
2. Insert a main flag with the name QUICKITEM_ADDED to your plot.
3. Create a script (the name doesn't matter) and paste everything from http://de.pastebin.ca/1814267 in your script.
4. Rename the items in the script.
5. Compile and export the script.
6. Finished.

#5
aladarxp

aladarxp

    Newbie

  • Members
  • Pip
  • 15 posts
lets say i want to add more than one item to the vendor I just add more to this?

#
Item[00]=R"your_item1.uti";
#
Item[01]=R"your_item2.uti";

or would i have to add them to

#
int i = 0; <----- not understanding that this part does other than it is item[00]
#
while (i < GetArraySize(Item))
#
{
#
CreateItemOnObject(Item[i], vendor);
#
i++;

#6
hdhd

hdhd

    Enthusiast

  • Members
  • PipPip
  • 222 posts
You just have to add more numbers to Item[here the number]. For example
Item[00]=R"gen_im_acc_rng_exp.uti";
Item[01]=R"gen_im_qck_book_formari.uti";
Item[02]=R"prm000im_wolf_charm.uti";
Item[03]=R"prm000im_gm_belt.uti";
...

Everytime you add a new item you just have to add Item[number]=R"Item name";

int i = 0 is just a variable which after each itemadd adds 1 (i++;) until there aren't any items to add.

#7
aladarxp

aladarxp

    Newbie

  • Members
  • Pip
  • 15 posts
I am having problems I crated the item and the script and the plot but when i export everything and create the dazip and install it to my game I don't see the weapons on the vendor

#8
hdhd

hdhd

    Enthusiast

  • Members
  • PipPip
  • 222 posts
Have you changed in Manage Modules --> YOUR_ADDON --> Properties --> Script --> modules_core to YOUR_SCRIPT? If you have done this and it still doesn't work try adding some debug things to find the issue. For instance DisplayFloatyMessage(GetHero(),"DEBUG: IT WORKS!",FLOATY_MESSAGE,0xFFFF00,5.0); before object vendor = GetObjectByTag("store_camp_bodahn");. But I don't think that I made a mistake in the code. Maybe you've done something wrong with the plots. Have you exported them?




Page loaded in: 1.219 seconds