Hmm, I don’ see what you mean with the not being able to do switches and I hope you don’t mind explaining what is wrong with what I was thinking. Anyway taking from the first bit monkey posted which had
if (iuseName == “weed”) return &iuse::weed;
else if (iuseName == “coke”) return &iuse::coke;
I was thinking that you could just
switch (iuseName)
{
case “weed”:
return &iuse::weed;
case “coke”:
return &iuse::coke;
}
If this is wrong whats wrong about it? Also I saw the formatting but its not one to one. The weapon example you give is so
[
{ “id”:“HATCHET”,
“symbol”: “;”,
“color”: “blue”,
“name”:“hatchet”,
“description”:“A one-handed hatchet. Makes a great melee weapon, and is useful both for cutting wood, and for use as a hammer.”,
“rarity”: 60,
“material”: [“WOOD”, “IRON”],
“weight”: 7,
“volume”: 6,
“damage”: 12,
“cutting”: 12,
“to_hit”: 1
}
]
and in the itypedef.cpp file the hatchet goes like so (I know what the numbers are so thats not the problem)
MELEE(“hatchet”, “hatchet”, 10, 95,’;’, c_ltgray, IRON, WOOD,
6, 7, 12, 12, 1, 0, “
A one-handed hatchet. Makes a great melee weapon, and is useful both for\n
cutting wood, and for use as a hammer.”);
1.First of all the id is in all caps, do you want this pattern continued from now on as the instruments had the same thing.
2.the hatchet has a manually input new line in the description and the json one doesn’t have it, is this because the game will do it as needed now or should I keep any instances of \n?
- the color is just a color and it doesn’t match up, for the hatchet if I had done the conversion the color would end up as c_ltgray or maybe just lightgray or some variation of it. Do you have some predefined colors I can go off of for the conversion or what?
Also something I noticed is that some items have a line under them going something like so (example from steel chain)
TECH(‘chain’, mfb(TEC_GRAB) );
what is this, is it defining something that is separate but kept with the chain because it goes with it or what?