Training dummy (working on one at this moment) where do i put the XP?

As you said, experiments will need to be done, but I don’t believe the game can function this way as of now. If there’s any scent of anything hostile, your soldiers will rush it.

Yeah, that’s another good way of approaching this problem. As you’ve said, though, you will need a special button that actually spawns the attackable dummy. This is something I’ve done before, and I can give you a bird’s eye overview of the things you’ll need to do to add a new button to an item. Spawning an enemy itself isn’t too hard, either, you can check out on my Personal Thread, I had an experiment where I spawned a Giant Enemy Skeleton in a microworld test. I guess at this point, the hardest bit would be making a selectively-hostile monster, so that your h’lings don’t run away from it, and your soldiers don’t auto-kill it immediately.

1 Like

am i assuming correctly, because those files do have an XP component, that i could actually ignore the tuning files, not write one at all, and put the xp in the monster file itsself, that the xp would be the same across all difficulties, this would also stop the game from spawning a deployed training dummy as a monster unintentionally?

edit:
because the monster file has:
},
“exp_reward”: {
“type”: “basic”,
“value”: 0
}

and the tuning file also has
“attributes”: {
“max_health”: 60,
“muscle”: 0,
“menace”: 20,
“courage”: 40,
“speed”: 80,
“additive_armor_modifier”: 0,
“exp_reward”: 3 <<<<<this one.

Yes, of course. :slightly_smiling_face:

1 Like

yeah this would be the tricky bit but it would be a good place to start at least.

i saw that one, fully intended checking that one out, yes :smiley: (thanks for the documentation on that)

1 Like

BTW I think your idea of a potion that is equippable and auto-consumes itself should be doable.
Though I would try to make it auto-unequip and destroy itself once that happens, for the first attempt.
Otherwise, you’ll really have to write custom code for a belt that can store potions and create AI actions to deal with it (since it’s an equipped item, not sure if restocking with the current code would work, but you can always try - actually, you could define a special storage filter and have that belt only have that filter, so that no other items get restocked to it).

For the dummy, could we cheat even more? Like, you know you can add exp while talking with a hearthling with the professor trait. You could have a custom AI action that does something like: search for dummy / “attack dummy” (just an animation) / reduce some counter on the dummies attributes when this animation loops / when it reaches 0, add exp to footman, and destroy the dummy if you want, too. You could try have an engineer repairing it, though that could require more code. This could be considered a different AI group than combat, so that real combat always has priority for the footman.

Doesn’t really have to be actual combat. That way you skip the hostile checks.
There’s a hearth that spawns undead, you could check that too if you want.

1 Like

this is indeed my plan, but i’d thought i’d cut my teeth on the training dummy first, as an excersize. so far it seems to be going quite well :slight_smile: thanks for all the feedback btw!

this sounds cleaner…but harder to do, ill concider this plan B (the less i have to fiddle with animations and AI, the better for me, at least to start with i dont mind slightly more files for my jack-in-the-box style training plan)

EDIT:
what does a “ghost form” for a potion do btw? i just fully took over the structure of a potion so far but i dont get that bit yet.

1 Like

The ghost represents the semi-transparent item that we see when we order to place an item in the ground. Some tonics have it and some others don’t.

If your item isn’t going to be placeable, you don’t need the ghost.

If you’re gonna make it equippable, copy an existing gear and add the missing components from the potion to it.
(never tried a command on an equipped item, mainly because it’s tricky to select it once equipped, but feel free to experiment).

ah, the “its going to be put HERE” ghost. what you also get for beds and chairs and things before you heartling puts it down somewhere, and recently, when you are going to plant trees, got it!

seeing as my box that deploys the training dummy will be placable: its going to need a ghost form :slight_smile:

this thread is going to be an excelent Q&A source for someone down the line, lol.

1 Like

right, ive got a box with a button (potion style) ive removed the buff from it, so there wont be an icon in the left bottom corner for four hours saying that there is a potion.
ive made a new lua with

local DeployDummy = class()

function function MicroWorld:place_enemy(x, z)
– Item despawns self, spawns attackable dummy that gives XP on destruction
local pop = stonehearth.population:get_population(LOCAL_ENEMY)
local foe = pop:create_new_citizen(‘Training dummy’)

local town = stonehearth.town:get_town(‘player_1’)

radiant.terrain.place_entity(foe, Point3(x, 1, z))
return foe
end

return DeployDummy

in it, based around @Moai 's giant skeleton spawn code, removed this bits of it that would make it REALLY BIG and the stuff that gives it a weapon (its a dummy, it doesnt have to fight back)

now for the coordinate system… how does that work?

X and Z are the flat planes, going forward/backward, left/right. Y is the vertical plane, up/down. You’ll need to experiment to figure out the rest, my work with the coordinate system is limited to making cubemitters so far.

1 Like

good to know (used to X/Y being horizontal and Z vertical…)
i was more thinking in the terms of are coordinates relative to the source calling the code, or is it an absolute thing, that kinda stuff :confused:

Check out my personal thread for more info, I did write a bit about it. Point 0,0,0 is the exact central voxel of where you clicked the the map when disembarking, the exact center of your map. 0,1,0 is 1 voxel above the center. 0,-1,0 is 1 voxel below the center, and possibly, depending on the map and generation type, below the ground. If you use Microworld, then -1 on the Y axis corresponds to 1 block below the ground.

e: Allow me to link you some resources that I know and have used around this site. Reading through them should give you a very broad overview of some of the game’s systems.

Stonehearth official modding guide
In-depth look at AI
RepeatFeed

And you are familiar with my thread.

e2: Now that I’ve re-read it, my thread is pretty barren when it comes to usable content. :\ I’ll need to post more often to that.

1 Like

@Moai thanks for the links, that repeat feed one is bloody insane, the man made a train? What the hell XD.

I think the coords thing will indeed be a trail and error. Got a free day tomorrow, then, its testing time :smile:

1 Like

I am honored and slightly upset at the same time.

2 Likes

Concider it maximum respect, you indeed are a wizzard. With an extra z, for extra magic

quick suggestion/question (unless you have this part already sorted)

About how to stop/keep attacking etc -

Why not make the dummy togable in the sense of force attack/attack move command? That way you can toggle/untogle at leasiure?

Please note - i have no mod background and might be talking out of my -cottage pie- also could not stand to read past the first few posts (all the code hurts my eyes :stuck_out_tongue: )

  • just thought i would suggest regardless because in early post you said you also had this issue on how to stop attacking/read as training etc???

Sounds pretty nice. Put a component on the dummy that can be toggled using commands, then have some AI methods that are dealing with the go_to/use approach of it.

Bonus points if the component has some sort of filtering system, i.e. a list of hearthlings (or rather entity ids) that are allowed to use it. That way you could even have “personal dummies”. I think beds are somewhat personal these days, so a quick look on how to do it there could be useful.

If you have the component control the AI a bit too, you could have various things as well. For example, the component could define an effect to be played - that way, a knight dummy would see the unit beating it, whereas a refrigerator could improve the stamina using a freeze-effect on the hearthling, or something like that.

1 Like

To be fair this is still out of my depth but it’s a good idea. Hell I haven’t gotten past the coordinate problem yet :’), but if you have inspiration and or the skill, give it a try! May the best dummy win :stuck_out_tongue: anyone reading this here especially gifted with the modeling programs? I haven’t made a dummy yet and could probably wrangle something up but at this point we might as well make it a board thing because I think I’ve seen every single modder on the entire board say hello by now…

When you’re lacking a model, my usual approach is to either use something extremely ridiculous (say, sheeps as christmas tree baubles), or something that already exists and fits closely (i.e. some mannequin or something in this case). Or maybe just the hearthling model in this case. Or a goblin one?

1 Like

Yeah I did that too, my current stand in is one of those little wooden buggers. :stuck_out_tongue: