» Sat Feb 19, 2011 5:45 am
Note: I realize that "z" is a very common prefix. However I made this only to test out the companion, so it won't matter. Once I get everything working, I'll probably change the prefix to something more unique--assuming I actually decide to release this mod...
zMerchant
Script: (none)
Combat Style: DefaultArcher
Death Item: (none)
Respawn
PlayerFaction Rank 0
Aggression: 20 Confidence: 100 Energy Level: 100 Responsibility: 0 (So I can steal stuff right in front of her and then fence it to her.)
Buys/Sells: All (Auto-Calc from her custom class, with "Playable" and "Guard" unchecked.)
Auto-Calc Other: Repair, only (Also from class.)
Barter Gold: 65000
Packages (In this order from top to bottom):
zMerchantReturn (This is for making her return to the tower where you find her.)
- Package Type: Travel
- Door Flags: (none)
- Schedule: Any, Duration 0
- Conditions: (No targets)
1) GetQuestVariable Quest: 'zMerchantFollow', MerchantFollow == 0.00 AND
2) GetIsID NPC: 'zMerchant' == 1.00 AND
- Location: Near Editor Location (Radius 0)
- Target: N/A
- Flags:
Must Reach Location
Offers Services
Must Complete
Always Run
zMerchantStay (This is for making her stay when ordered.)
- Package Type: Travel
- Door Flags: (none)
- Schedule: Any, Duration 0
- Conditions: (No targets)
1) GetQuestVariable Quest: 'zMerchantFollow', MerchantOrder == 0.00 AND
2) GetQuestVariable Quest: 'zMerchantFollow', MerchantFollow == 1.00 AND
3) GetIsID NPC: 'zMerchant' == 1.00 AND
- Location: Near Current Location (Radius 0)
- Target: N/A
- Flags:
Offers Services
Defensive Combat
zMerchantFollows (This is for making her follow you around.) (Also, I messed up when adding the name for the associated quest, which is why this has the "s".)
- Package Type: Follow
- Door Flags: (none)
- Schedule: Any, Duration 0
- Conditions: (No targets)
1) GetQuestVariable Quest: 'zMerchantFollow', MerchantOrder == 1.00 AND
3) GetIsID NPC: 'zMerchant' == 1.00 AND
- Location: (none)
- Target: Any Object, Object ID: Player, Count 0
- Flags:
Offers Services
Allow Swimming
Allow Falls
Defensive Combat
MerchantFollow is for whether or not she's coming with you at all. 1.00 is coming with you, 0.00 is return/stay home.
MerchantOrder is for whether she's literally following you or staying put. 1.00 for follow, 0.00 for stay.
I have a quest (zMerchantFollow) that handles the dialogue for her, which does nothing but change variables and "EvaluatePackage" afterwards for each order. When you talk to her, you have the option of giving an order, asking about rumors, and persuasion/trading/etc. Each order (zFollow, zStay, and zReturn) has the "Goodbye" flag. The quest is Start Game Enabled and Priority 95. The only condition is: GetIsPlayableRace == 1.00 AND
Here's the quest script:
ScriptName zMerchantScript
short MerchantFollow
short MerchantOrder
She has a merchant container (ChestVendorSmithAllI01 [sic]) in the same interior cell. The container is persistent, owned by her and has her reference as its parent. (I think I had to do that last part to get her to use it as a merchant container at all.) It never moves from its original place, but whenever I successfully trade with her, it still works no matter where we are.
If I've left anything else out, let me know and I'll add it. I will say, however, that the area I've created to put her in currently has no pathgrids. However, the same behavior occurs even in other (normal) areas.
It MIGHT be possible that it has to do with the merchant container, although the same thing happens even when she doesn't have one (and I give her a random leveled food item to sell). It seems more like it has to do with the AI checking its position, or something, and not allowing transactions when on the move. Once it thinks it's staying put, however, it allows them. Then once it thinks it's on the move, again (even if it's not technically moving), it disallows them until it thinks it's stopped, again. The part that bugs me the most is that she'll offer any other service I want at any time, except for the main one I want her to offer.
So frustrating... :brokencomputer:
Perhaps if I move the container, anyway, it might help. How did you do that before?