Jump to content
The Dark Mod Forums

Shop Items


Springheel

Recommended Posts

I'm a bit confused about setting up starting items in a shop.

 

What entity do you use for "startingItem_X_item"? The example in the startpack uses the entity "atdm:weapon_broadhead", but I can't see where in that entity the shop image and description is set.

 

The shop.def file uses this example: //"startingItem_2_0_item" "weapon_shortsword". Can't find a "weapon_shortsword" entity at all, however.

 

The only place I can find shop descriptions and images set is in the "ShopItem_playertools_[type]" entities. Yet those entities don't appear to be used in the shop at all. :blink:

 

I'm a bit confused, and the wiki pages claim to be out of date.

Link to comment
Share on other sites

They are defined in tdm_shopitems.def. In startmap/def/custom.def you can see an example of setting up a custom map that will go in the shop. So for a special item you need an entity def and a shop def for it in your FM pk4. And shop icon of course.

Link to comment
Share on other sites

Ah, I see my error now...I was getting "itemClassname" confused with entity name.

Link to comment
Share on other sites

That sounds like a good idea. Right now the mapper seems (if I'm doing it right) to need to input the information twice...once to add the entities to the map and once to update the shop entity.

Link to comment
Share on other sites

No, they only go in the shop entity.

 

That doesn't put them in the player's inventory though, does it? I thought you had to use a "blue room" for that.

Link to comment
Share on other sites

Yes, if you add them as starting items or as shop items then assuming the player keeps/buys them in the shop then he will automatically have them in the game. No need to actually put them in the map as well. They are spawned automatically into the player inventory.

Link to comment
Share on other sites

Oh, really? What's the purpose of the "blue rooms" full of weapons that seem to be in the FMs then? Is that for when you're skipping the shop screen?

Link to comment
Share on other sites

The ones in the blue room initially are for while developing. When you enter map in the console you don't get the shop. But they can also be used instead of the shop in the actual complete FM. This standard blue room with all the test tools and ammo is in startmap as well as test/start_room.map (as a base for quick tests) and there is a prefab too so most mappers are starting with those. At one time you may recall we just had 30 of all the arrows defined in the player def but as we got nearer Release 1 of course those had to go. Now for development you have to have them in the map until nearing completion when the shop is set up. I've still got the blue room in Heart for example even though it has an empty shop as well. Later I'll set up the shop properly and delete the blue room.

Link to comment
Share on other sites

Ah, ok. So once the shop is set up, all the items in the blue room can be deleted? Thanks, I didn't know that.

Link to comment
Share on other sites

One last thing...how do the lockpicks work? They're the only entity with two classnames. I tried putting one and then both in, but neither seemed to do anything.

 

entityDef ShopItem_playertools_lockpick_set

{

"inherit" "atdm:shopitem_base"

"editor_usage" "Lockpicks"

"displayName" "Lockpicks"

"displayDesc" "A set of tools for opening locks."

"itemClassname" "atdm:playertools_lockpick_triangle"

"itemClassname1" "atdm:playertools_lockpick_snake"

"image" "guis/assets/purchase_menu/lockpicks"

"price" "20"

}

Link to comment
Share on other sites

Yes, they are special. This is what I have in startpack:

 

"atdm:playertools_lockpick_set"

 

But looking in tdm_shopitems.def it's hard to relate several of the names to what is in there. I'm wondering if names have been changed since I last updated startpack. But I think that's what several of us used in the released FMs which all had shops. If the above does not work then try:

 

"ShopItem_playertools_lockpick_set"

 

but let me know as it means I need to check all the defs in startpack.

 

[EDITED] I see you already tried that. It seems the logical name. I cannot find anywhere that "atdm:playertools_lockpick_set" is defined but I think that's what we use.

Link to comment
Share on other sites

This is what I put in the .map file for Too Late (just rename the .map to .txt then pastel it in at the top, then save it and rename it back to .map)

Just under the; "classname" "worldspawn" line in the .map file (now .txt)

 

// the amount of starting gold:
"diff_0_shop_gold_start" "100"
"diff_1_shop_gold_start" "75"
"diff_2_shop_gold_start" "50"
// items the player starts with:
"startingItem_1_item" "atdm:weapon_blackjack"
"startingItem_1_qty" "1"
"startingItem_2_item" "atdm:weapon_shortsword"
"startingItem_2_qty" "1"
"startingItem_3_item" "atdm:playertools_lantern"
"startingItem_3_qty" "1"
"startingItem_4_item" "atdm:playertools_compass"  
"startingItem_4_qty" "1"
"startingItem_5_item" "atdm:playertools_lockpick_snake"
"startingItem_5_qty" "1"
"startingItem_6_item" "atdm:playertools_lockpick_triangle"
"startingItem_6_qty" "1"
"startingItem_7_item" "atdm:playertools_spyglass"
"startingItem_7_qty" "1"
//items available for purchase:
"shopItem_1_item" "atdm:weapon_broadhead"
"shopItem_1_0_qty" "15"
"shopItem_1_1_qty" "10"
"shopItem_1_2_qty" "0"
"shopItem_2_item" "atdm:weapon_waterarrow"
"shopItem_2_0_qty" "7"
"shopItem_2_1_qty" "5"
"shopItem_2_2_qty" "2"
"shopItem_3_item" "atdm:weapon_mossarrow"
"shopItem_3_0_qty" "2"
"shopItem_3_1_qty" "1"
"shopItem_5_item" "atdm:weapon_noisemaker"
"shopItem_5_0_qty" "1"
"shopItem_7_item" "atdm:playertools_health_potion"
"shopItem_7_0_qty" "2"
"shopItem_7_1_qty" "1"
"shopItem_7_2_qty" "1"

 

Or hav a look in the wiki Default_purchasable_items

Edited by Nielsen74
Link to comment
Share on other sites

"startingItem_4_qty" "1"

"startingItem_5_item" "atdm:playertools_lockpick_snake"

 

"startingItem_5_qty" "1"

"startingItem_6_item" "atdm:playertools_lockpick_triangle"

 

And did the lockpicks show up in the shop screen? When I did that the player had them at the start of the game, but they weren't in the list of starting items in the shop screen.

Link to comment
Share on other sites

No thay don´t! and I can´t see way you wan´t to giv the player the option to drop them???

 

It's not about dropping them, it's about making the list of starting equipment accurate.

 

Although protecting people from their own stupidity has never been a big concern of mine.

Link to comment
Share on other sites

No your right, if they drop them it´s there problem rolleyes.gif and it´s a littel wirde that the lockpicks don´t show up as all the other stuff do (blackjack, sword, lamp e.c.t) maby it´s a bug? (probably is!)

Edited by Nielsen74
Link to comment
Share on other sites

Yes, they are special. This is what I have in startpack:

 

"atdm:playertools_lockpick_set"

 

This does actually work, but I can't figure out why. There IS no "atdm:playertools_lockpick_set" entity that I can find, so I have no idea why this works.

Link to comment
Share on other sites

This does actually work, but I can't figure out why. There IS no "atdm:playertools_lockpick_set" entity that I can find, so I have no idea why this works.

 

It is defined in def/tdm_shopitems.def, indirectly, the code replaces "atdm:playertools_lockpick_set" with "ShopItem_playertools_lockpick_set" it seems:

 

// to add this to the shop, you have to use "atdm:playertools_lockpick_set" as the classname
entityDef ShopItem_playertools_lockpick_set
{
   "inherit"           "atdm:shopitem_base"
   "editor_usage"      "Lockpicks"
   "displayName"       "Lockpicks"
   "displayDesc"       "A set of tools for opening locks."
   "itemClassname"     "atdm:playertools_lockpick_triangle"
   "itemClassname1"    "atdm:playertools_lockpick_snake"
   "image"             "guis/assets/purchase_menu/lockpicks"
   "price"             "20"
}

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

So we can also use entity names, but just replace "shopitem_" with "atdm:"? :huh:

Link to comment
Share on other sites

So we can also use entity names, but just replace "shopitem_" with "atdm:"? :huh:

 

Not sure, except if you also have the "shopitem_" definition. But I never used these entities...

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 0 replies
    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
×
×
  • Create New...