| Scripted Shopkeeper [message #24168] |
Wed, 15 August 2007 23:55  |
 |
Keshire Messages: 1175 Registered: July 2005 |
Administrator
|
|
|
Along the lines of my experience pedestool, and Customizable NPC. Here is a stand alone shopkeeper where you can define his stock through scripts.
Random Empty traders fixed by Sean_s.

Relevant tng code:
DefinitionType "CREATURE_TRADER_STOCKED_SCRIPTED"; or "SCRIPTED_SHOP"
ThingGamePersistent FALSE;
ThingLevelPersistent FALSE;
StartCTCShop;
StockItemDefsKeys[0] "OBJECT_KESHIRE_SICKLE";
StockItemDefsQuantity[0] 1.0;
StockItemDefsMaxStock[0] 1.0;
EndCTCShop;
by leaving the Persistent to FALSE, the shopkeeper will not be stored within the save game. Meaning you can continually edit his stock even after saving. (This probably works with chests too. Not sure.)
Also, obviously the [#] works the same as all ctc's that use that syntax.
StockItemDefsKeys[0] "OBJECT_KESHIRE_SICKLE";
StockItemDefsQuantity[0] 1.0;
StockItemDefsMaxStock[0] 1.0;
StockItemDefsKeys[1] "OBJECT_";
StockItemDefsQuantity[1] 1.0;
StockItemDefsMaxStock[1] 1.0;
StockItemDefsKeys[2] "OBJECT_";
StockItemDefsQuantity[2] 1.0;
StockItemDefsMaxStock[2] 1.0;
StockItemDefsKeys[3] "OBJECT_";
StockItemDefsQuantity[3] 1.0;
StockItemDefsMaxStock[3] 1.0;
[Updated on: Thu, 16 August 2007 01:02]
Apathy Cannot Inspire.
Ambivalence cannot lead.
Loved me. Feared me.
Changed me. Killed me.
Anything would be something.
But nothing is worst of all.
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Scripted Shopkeeper [message #25623 is a reply to message #24168 ] |
Fri, 31 August 2007 10:13   |
 |
Satan Messages: 1048 Registered: September 2005 Location: Hades |
Administrator
|
|
|
|
If you can spawn chests you can do this, and if you can't it's a good way to get into tng editing.
[Updated on: Fri, 31 August 2007 10:13]

There is nothing in the Void.
There is no point to it's being.
I wish there was a reason.
There is nothing in the Void,
But what we put there.
|
|
|
|
|
|
|
|
| Re: Scripted Shopkeeper [message #25705 is a reply to message #24168 ] |
Sun, 02 September 2007 13:33   |
|
edit: futurama right?
[Updated on: Sun, 02 September 2007 13:33] "All of the work, and none of the play, will surely provide for a speedy decay"
|
|
|
|
|
| Re: Scripted Shopkeeper [message #27422 is a reply to message #24168 ] |
Mon, 17 September 2007 03:15   |
 |
Sean_s Messages: 576 Registered: June 2007 Location: Ohio |
|
|
|
Ok thanks, but like I said in the morning, I wasn't kidding about it being 6 here (6:15 am now).
Edit
Never mind, here it is, I couldn't stand needing to sleep to fix it (the FMP only has two entry's and I only needed to change one thing, so yeah, easy fix).
[Updated on: Mon, 17 September 2007 03:22] New? Or looking for information? Look here before posting.
Help the community by adding this to your sig!
Assistant for Conquest
By the way, call me Searyan
|
|
|
|
|
|
| Re: Scripted Shopkeeper [message #27999 is a reply to message #27465 ] |
Thu, 20 September 2007 10:05   |
|
Ok, I've been trying to use the scripted shopkeeper in combination with a couple of new weapons and new clothing objects.
So far weapons work just fine, but the clothing sometimes does and sometimes doesn't work.
Example:
I load these mods:
I use this script:
SCRIPT USEDNewThing AICreature;
Player 2;
UID 18446712341011018629;
DefinitionType "CREATURE_TRADER_STOCKED_SCRIPTED";
ScriptName NULL;
ScriptData "NULL";
ThingGamePersistent FALSE;
ThingLevelPersistent FALSE;
StartCTCPhysicsNavigator;
PositionX 14.5;
PositionY 124.0;
PositionZ 26.5;
RHSetForwardX 1.000000;
RHSetForwardY 0.000000;
RHSetForwardZ 0.000000;
RHSetUpX 0.000000;
RHSetUpY 0.000000;
RHSetUpZ 1.000000;
EndCTCPhysicsNavigator;
StartCTCTargeted;
Targetable TRUE;
EndCTCTargeted;
StartCTCContainerRewardHero;
EndCTCContainerRewardHero;
StartCTCEnemy;
FriendsWithEverythingFlag FALSE;
EnableFollowersEnemyProxy TRUE;
FactionName "";
EndCTCEnemy;
StartCTCShop;
StockItemDefsKeys[0] "OBJECT_HERO_MASK_STEALTH";
StockItemDefsQuantity[0] 5.0;
StockItemDefsMaxStock[0] 10.0;
StockItemDefsKeys[1] "OBJECT_HERO_HAT_NIHILUS_MASK";
StockItemDefsQuantity[0] 5.0;
StockItemDefsMaxStock[0] 10.0;
StockItemDefsKeys[2] "OBJECT_HERO_BOOTS_JACK";
StockItemDefsQuantity[0] 5.0;
StockItemDefsMaxStock[0] 10.0;
StockItemDefsKeys[3] "OBJECT_HERO_SHIRT_JACK";
StockItemDefsQuantity[0] 5.0;
StockItemDefsMaxStock[0] 10.0;
StockItemDefsKeys[4] "OBJECT_HERO_TROUSERS_JACK";
StockItemDefsQuantity[0] 5.0;
StockItemDefsMaxStock[0] 10.0;
EndCTCShop;
Health 200.0;
EnableCreatureAutoPlacing FALSE;
EndThing;
Now in-game, when I look at the traders merchandise only the Assassin Mask and Jack's Trousers are there.
I've been searching through the CDefs for an answer... but no luck so far.
Who's more lucky or knows the answer???
-Also: as stated before, weapons work fine so far-
-If you spawn Thunder's helmet (from Buetooth suits) in the traders inventory, it crashes the game-
|
|
|
| Re: Scripted Shopkeeper [message #28014 is a reply to message #24168 ] |
Thu, 20 September 2007 12:26   |
 |
Satan Messages: 1048 Registered: September 2005 Location: Hades |
Administrator
|
|
|
Don't know if this'll help but this guy sells the JOB outfit fine in my game. His coords are for GuildExterior.tng.
Shopkeeper script
NewThing AICreature;
Player 2;
UID 18446741874686298880;
DefinitionType "CREATURE_HERO_RIVAL_GOOD_01";
ScriptName NULL;
ScriptData "NULL";
ThingGamePersistent FALSE;
ThingLevelPersistent FALSE;
StartCTCPhysicsNavigator;
PositionX 9.583252;
PositionY 120.747100;
PositionZ 27.176630;
RHSetForwardX 0.714565;
RHSetForwardY 0.699569;
RHSetForwardZ 0.000000;
RHSetUpX 0.000000;
RHSetUpY 0.000000;
RHSetUpZ 1.000000;
EndCTCPhysicsNavigator;
StartCTCRandomAppearanceMorph;
Seed -859535768;
EndCTCRandomAppearanceMorph;
StartCTCTargeted;
Targetable TRUE;
EndCTCTargeted;
StartCTCTalk;
EndCTCTalk;
StartCTCEditor;
EndCTCEditor;
StartCTCVillageMember;
VillageUID 0;
EndCTCVillageMember;
StartCTCHeroMorph;
Strength 1.0;
Will 0.5;
Skill 1.0;
Age 0.5;
Morality 0.0;
Fatness 0.0;
Tan 1.0;
EndCTCHeroMorph;
StartCTCHeroAttachableAppearanceModifiers;
HairModifierNames[0] "OBJECT_HERO_TASHKHG_01";
HairModifierNames[1] "OBJECT_HERO_BEARD_LONG_01";
HairModifierNames[2] "OBJECT_HERO_HORNS";
HairModifierNames[3] "OBJECT_HERO_BOOTS_LEATHERARMOUR_EVIL";
HairModifierNames[4] "OBJECT_HERO_TROUSERS_LEATHERARMOUR_EVIL";
HairModifierNames[5] "OBJECT_HERO_SHIRT_LEATHERARMOUR_EVIL";
HairModifierNames[6] "OBJECT_HERO_GLOVES_LEATHERARMOUR_EVIL";
EndCTCHeroAttachableAppearanceModifiers;
StartCTCShop;
StockItemDefsKeys[0] "OBJECT_HERO_HAT_JOB_MASK";
StockItemDefsQuantity[0] 1.0;
StockItemDefsMaxStock[0] 1.0;
StockItemDefsKeys[1] "OBJECT_HERO_SHIRT_JACK";
StockItemDefsQuantity[1] 1.0;
StockItemDefsMaxStock[1] 1.0;
StockItemDefsKeys[2] "OBJECT_HERO_TROUSERS_JACK";
StockItemDefsQuantity[2] 1.0;
StockItemDefsMaxStock[2] 1.0;
StockItemDefsKeys[3] "OBJECT_HERO_BOOTS_JACK";
StockItemDefsQuantity[3] 1.0;
StockItemDefsMaxStock[3] 1.0;
StockItemDefsKeys[4] "OBJECT_SWORD_OF_AEONS";
StockItemDefsQuantity[4] 1.0;
StockItemDefsMaxStock[4] 1.0;
EndCTCShop;
StartCTCContainerRewardHero;
EndCTCContainerRewardHero;
StartCTCEnemy;
FriendsWithEverythingFlag FALSE;
EnableFollowersEnemyProxy TRUE;
FactionName "";
EndCTCEnemy;
Health 10000.0;
OverridingBrainName NULL;
HasInformation FALSE;
WanderWithInformation FALSE;
WaveWithInformation FALSE;
ContinueAIWithInformation FALSE;
EnableCreatureAutoPlacing FALSE;
AllowedToFollowHero FALSE;
RegionFollowingOverriddenFromScript FALSE;
RespondingToFollowAndWait TRUE;
CanBeCourted FALSE;
CanBeMarried FALSE;
InitialPosX 1899.038574;
InitialPosY 2110.61084;
InitialPosZ 31.511845;
EndThing;
[Updated on: Thu, 20 September 2007 12:30]

There is nothing in the Void.
There is no point to it's being.
I wish there was a reason.
There is nothing in the Void,
But what we put there.
|
|
|
|
|
|
|
| Re: Scripted Shopkeeper [message #46777 is a reply to message #24168 ] |
Thu, 30 October 2008 13:55   |
cdgfx84 Messages: 10 Registered: October 2008 |
|
|
|
|
is there a way to fix it so the trader does not move
|
|
|
|
| Re: Scripted Shopkeeper [message #47019 is a reply to message #47018 ] |
Fri, 07 November 2008 11:05   |
JohnDoe Messages: 2922 Registered: October 2007 |
Administrator
|
|
|
You didn't just throw the code in there like that, did you? You're missing stuff.
Try this, all you need to do is edit UID and coordinates.Toggle SpoilerNewThing Object;
Player 4;
UID 00000000000000000000;
DefinitionType "CREATURE_TRADER_STOCKED_SCRIPTED";
ScriptName NULL;
ScriptData "NULL";
ThingGamePersistent FALSE;
ThingLevelPersistent FALSE;
StartCTCPhysicsStandard;
PositionX 0.000000;
PositionY 0.000000;
PositionZ 0.000000;
RHSetForwardX 0.000000;
RHSetForwardY 1.000000;
RHSetForwardZ 0.000000;
RHSetUpX 0.000000;
RHSetUpY 0.000000;
RHSetUpZ 1.000000;
EndCTCPhysicsStandard;
StartCTCTargeted;
Targetable TRUE;
EndCTCTargeted;
StartCTCShop;
StockItemDefsKeys[0] "OBJECT_KESHIRE_SICKLE";
StockItemDefsQuantity[0] 1.0;
StockItemDefsMaxStock[0] 1.0;
StockItemDefsKeys[1] "OBJECT_SILVER_KEY";
StockItemDefsQuantity[1] 30.0;
StockItemDefsMaxStock[1] 30.0;
StockItemDefsKeys[2] "OBJECT_IRON_ODACHI";
StockItemDefsQuantity[2] 1.0;
StockItemDefsMaxStock[2] 1.0;
StockItemDefsKeys[3] "OBJECT_STEEL_ODACHI";
StockItemDefsQuantity[3] 1.0;
StockItemDefsMaxStock[3] 1.0;
StockItemDefsKeys[4] "OBJECT_OBSIDIAN_ODACHI";
StockItemDefsQuantity[4] 1.0;
StockItemDefsMaxStock[4] 1.0;
StockItemDefsKeys[5] "OBJECT_MASTER_ODACHI";
StockItemDefsQuantity[5] 1.0;
StockItemDefsMaxStock[5] 1.0;
StockItemDefsKeys[6] "OBJECT_STAFF_IRON";
StockItemDefsQuantity[6] 1.0;
StockItemDefsMaxStock[6] 1.0;
StockItemDefsKeys[7] "OBJECT_STAFF_STEEL";
StockItemDefsQuantity[7] 1.0;
StockItemDefsMaxStock[7] 1.0;
StockItemDefsKeys[8] "OBJECT_STAFF_OBSIDIAN";
StockItemDefsQuantity[8] 1.0;
StockItemDefsMaxStock[8] 1.0;
StockItemDefsKeys[9] "OBJECT_STAFF_MASTER";
StockItemDefsQuantity[9] 1.0;
StockItemDefsMaxStock[9] 1.0;
StockItemDefsKeys[10] "OBJECT_TANTO_IRON";
StockItemDefsQuantity[10] 1.0;
StockItemDefsMaxStock[10] 1.0;
StockItemDefsKeys[11] "OBJECT_TANTO_STEEL";
StockItemDefsQuantity[11] 1.0;
StockItemDefsMaxStock[11] 1.0;
StockItemDefsKeys[12] "OBJECT_TANTO_OBSIDIAN";
StockItemDefsQuantity[12] 1.0;
StockItemDefsMaxStock[12] 1.0;
StockItemDefsKeys[13] "OBJECT_TANTO_MASTER";
StockItemDefsQuantity[13] 1.0;
StockItemDefsMaxStock[13] 1.0;
StockItemDefsKeys[14] "OBJECT_ICE_STAFF";
StockItemDefsQuantity[14] 1.0;
StockItemDefsMaxStock[14] 1.0;
StockItemDefsKeys[15] "OBJECT_CHICKEN_LONGBOW";
StockItemDefsQuantity[15] 1.0;
StockItemDefsMaxStock[15] 1.0;
EndCTCShop;
StartCTCEditor;
EndCTCEditor;
Health 1.0;
EndThing;
|
|
|
|
| Re: Scripted Shopkeeper [message #47037 is a reply to message #47031 ] |
Sat, 08 November 2008 11:11   |
JohnDoe Messages: 2922 Registered: October 2007 |
Administrator
|
|
|
The only other thing I can think of is the existence of the OBJECT entries. With a chest, it doesn't matter, since if it doesn't exist, it is skipped. With this, though, it might matter.
But that's only with the assumption that you either didn't install the mods or that you screwed up the mods.
Other than that, I've got no clue. Can't spot a problem with the script.
|
|
|
| Re: Scripted Shopkeeper [message #47058 is a reply to message #47037 ] |
Sun, 09 November 2008 07:05   |
|
| JohnDoe wrote on Sat, 08 November 2008 11:11 | The only other thing I can think of is the existence of the OBJECT entries. With a chest, it doesn't matter, since if it doesn't exist, it is skipped. With this, though, it might matter.
But that's only with the assumption that you either didn't install the mods or that you screwed up the mods.
Other than that, I've got no clue. Can't spot a problem with the script.
|
I don't understand the first thing you said O.O
All i did what replace the silver key there with the script.
It's hard to screw up a copy and paste job really.
Ugh i hate it when things go wrong and mo mistake seems to be there 
EDIT: I do understand the first thing you said, lol
So i changed NewThing Object; to NewThing AICreature;
And no luck. Still crashes. I still don't understand.
[Updated on: Sun, 09 November 2008 07:14]
|
|
|
| Re: Scripted Shopkeeper [message #47060 is a reply to message #47058 ] |
Sun, 09 November 2008 08:41   |
JohnDoe Messages: 2922 Registered: October 2007 |
Administrator
|
|
|
I missed the NewThing Object; thing because, well, that one's my fault. That's what I put there. That aside, that wasn't what I was talking about, good eyes though.
When you spawn a chest and put in items that don't exist, such as "OBJECT_NOMNOMNOM", it will be skipped. What I was saying earlier is that this could be a different problem with the trader, and instead of him skipping the item, the game crashes. This can happen if you misspelled an item or if you screwed up while installing the mods (or did any combination of any number of user errors that could cause this). That said, go in FE and see if the mods are installed correctly.
Another thing, you could see if it is even the trader causing the crash. Take out the trader script and run the game. If it works, the script is screwed up somewhere (somewhere else I mean) and we just haven't spotted it yet. If it doesn't work, it's not the script, and you screwed up somewhere else.
Also, try changing the UID, something that doesn't start with a string of zeroes.
[Updated on: Sun, 09 November 2008 08:41]
|
|
|
| Re: Scripted Shopkeeper [message #56886 is a reply to message #24168 ] |
Sat, 17 April 2010 12:37   |
naast Messages: 1 Registered: April 2010 |
|
|
|
Hi guys. Can someone explain how to spawn a shopkeeper?
I'm new to modding so I don't understand everything about scripting.
As far as I understood, I have to load the .fmp file on FE, and make a script to spawn a shopkeeper, and that's all? Or do I need to add an entry for that shop on FE?
|
|
|
|
| Re: Scripted Shopkeeper [message #65411 is a reply to message #25652 ] |
Thu, 08 December 2011 09:21   |
 |
madmerlin420 Messages: 7 Registered: December 2011 |
|
|
|
| groo wrote on Sat, 01 September 2007 12:08 | oh god, now im gonna have to have a secret shopkeeper in the Bowerstone Graveyard in Darkened Souls
|
lolz imma have one in The Secret Haven in rose cottage ^^
|
|
|