Jump to content

how do u place items in a vendor


aladarxp

Recommended Posts

You have to create a script(untested!):

#include "wrappers_h"
void main()
{
object vendor = GetObjectByTag("store_camp_bodahn");
CreateItemOnObject(R"your_item.uti", vendor);
}

This would give the vendor in the player camp your_item.uti.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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, vendor);

#

i++;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...