Author Topic: Forge Daemon/Verb... assistance needed  (Read 10098 times)

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: Forge Daemon/Verb... assistance needed
« Reply #30 on: February 22, 2008, 03:39:00 pm »
Code: [Select]
private mapping Forges = ([
  "components" : ([ "silver sword" : ([ "steel" : 10, "silver" : 5 ]) ]),
                 ([ "emerald dagger" : ([ "steel" : 5, "emerald" : 1 ]) ])
 ]);

Mappings require both a key and a value per element. Here you have this as a
first element:

Code: [Select]
"components" : ([ "silver sword" : ([ "steel" : 10, "silver" : 5 ]) ])
But the next element is:

Code: [Select]
([ "emerald dagger" : ([ "steel" : 5, "emerald" : 1 ]) ])
Where's the key for it?

You probably meant to have this as your mapping:

Code: [Select]
private mapping Forges = ([
  "components" : ([
                  "silver sword" : ([ "steel" : 10, "silver" : 5 ]) ,
                  "emerald dagger" : ([ "steel" : 5, "emerald" : 1  ])
         ]) /*end  components */
 ]); /*end Forges */

-Crat

Offline detah

  • BFF
  • ***
  • Posts: 190
  • Ruler of 2D
    • View Profile
Re: Forge Daemon/Verb... assistance needed
« Reply #31 on: February 22, 2008, 03:54:17 pm »
*del the solo key components. It serves no purpose.
*house the various traits for each item inside of one mapping as a value. Then you can add as many things to it as you wish

Code: [Select]
private mapping Forges =
([ item1: ([silver: 10, req: 8]), item2: ([gold: 10, req: 17]) ])

Offline detah

  • BFF
  • ***
  • Posts: 190
  • Ruler of 2D
    • View Profile
Re: Forge Daemon/Verb... assistance needed
« Reply #32 on: February 22, 2008, 03:58:36 pm »
*shoot*
I wanted to mention.
Make sure that each key is unique. If you have two silver swords, name them each something distinct. Latter keys:values will overwrite earlier keys with the same name.