Aller au contenu

Photo

Merchants!


  • Veuillez vous connecter pour répondre
12 réponses à ce sujet

#1
Blakhawkdown

Blakhawkdown
  • Members
  • 1 messages
 I have followed the tutorial on the Wiki website on creating mercs. I have failed...
I have the script in the dialogue set for the GEN_OPEN_STORE  and my NPC and Merc are tagged
  • NPC = cammie
  • Merc = store_cammie
The npc's convo is set to the convo i have created. The merc object is also placed in the level.

I click on the dialogue option which is supposed to open the store and nothing happens the conversation just ends... Any ideas.....

#2
bowlie1

bowlie1
  • Members
  • 51 messages
have the same problem. a solution would be nice. when you export the script dose it say there is an error on line 3?

#3
CID-78

CID-78
  • Members
  • 1 124 messages
if you have a error , you obviously got a issue. without seeing the script or atleast the error message i can't say what.

#4
Proleric

Proleric
  • Members
  • 2 357 messages
If we are talking about this example from the wiki:
object oStore = GetObjectByTag("store_" + GetTag(oMerchantOwner));
 
if(IsObjectValid(oStore))
{
      ScaleStoreItems(oStore);
      OpenStore(oStore);
}
else
{
      Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), "INVALID STORE OBJECT");
}
be aware it is a code snippet, not a complete script. If you want to use ScaleStoreItems, you'll need to include core_h.

As the article explains, you can just set the plot flag "GEN_OPEN_STORE", which is easier than writing a script.

#5
bowlie1

bowlie1
  • Members
  • 51 messages
ok how dose the plot thing work? i have made the mod from scratch so i dont have all the main scripts and stuff to edit

Modifié par bowlie1, 21 avril 2010 - 02:14 .


#6
Proleric

Proleric
  • Members
  • 2 357 messages
In the conversation line which opens the merchant, Plots & Scripting tab, Action field, set the plot to gen00pt_generic_actions (it's in the Global > Generic folder), then set the plot flag to GEN_OPEN_STORE.

#7
bowlie1

bowlie1
  • Members
  • 51 messages
ok there is already a gen_open_store flag. what do i do from there? do i need to edit the generic actions script?

edit: ive just tried it and now when i talk to the blacksmith he disapears. no store though. looking at the generic actions script is says 

case GEN_OPEN_STORE:            {                object oStore = GetObjectByTag(STORE_PREFIX + GetTag(oConversationOwner));                if (IsObjectValid(oStore))                {                   ScaleStoreItems(oStore);                    OpenStore(oStore);                }                else                {                    Log_Trace(LOG_CHANNEL_SYSTEMS, GetCurrentScriptName(), "INVALID STORE OBJECT");                }                break;            }

do i need to put the STORE_ prefix in front of all my stores or is that automatic? and what dose it meen by + get tag conversation owner. i think this is the bit i am getting wrong. what do i need to link this bit to?

Modifié par bowlie1, 21 avril 2010 - 06:30 .


#8
TimelordDC

TimelordDC
  • Members
  • 923 messages
If the merchant NPC's tag is "merchant", the store should be called "STORE_merchant" and the conversation in which the store is opened should be assigned to the merchant (creature properties -> conversation)
In the conversation, for the node which should open the store, under Plots and Scripting, select the gen00pt_generic_actions plot and select the GEN_OPEN_STORE flag from the drop-down. Make sure the flag is being Set.

Modifié par TimelordDC, 21 avril 2010 - 06:54 .


#9
bowlie1

bowlie1
  • Members
  • 51 messages
no luck. done all of those things and it still wont work. he also still disapears

#10
TimelordDC

TimelordDC
  • Members
  • 923 messages
My mistake on the store tag - it should be "store_merchant" with store in lower case.



If it is still not working, I suggest following the steps in the wiki - http://social.biowar...x.php/Merchant; you could look at the screenshots in there to see what you are missing.

#11
bowlie1

bowlie1
  • Members
  • 51 messages
ive got it working now, thanks for the help. turns out i selected the plot flag above open store by acident in the conversation. thanks to both of you for the help. is there a rep system on these forums?

#12
Proleric

Proleric
  • Members
  • 2 357 messages

bowlie1 wrote...
...is there a rep system on these forums?

No, we generally find that what goes around comes around. Glad to help.

#13
bowlie1

bowlie1
  • Members
  • 51 messages
well if there is anything that i can do for you let me know. i will also be sure to put both your names in the credits if and when i release this mod