Creating a vehicle mod

Hello everybody from the stonehearth discourse,

i want to ask you a question: is it possible to create a script in lua for vehicle’s that can ride and also shoot.

the reason why i ask you this is because there is multiplayer now and i want to give the game the possibilty to let you create great modern/fantasy city’s with many innovation’s like car’s or magical teleporter’s etc, if this can be done than i would like it very much if people would help, because i can’t script but i can create voxel models for this mod idea.

i would like to thank you all,

Hey! As far as i know, vehicles are near impossible, because of the way stonehearth works. The fisher mod has boats, wich is amazing, but they are quite limited. Im not a modder, but i think makeing vehicles are not possible sadly.

Because of the way Stonehearth is made, almost anything is theoretically possible as a mod – the tricky part is that some things will require knowing the entire skill-set you’d need to make a game almost from scratch. At that point, many people would just make their own game rather than make a mod… after all, the amount of work involved + the amount of time and energy investment to learn how to do that is far more than most people have spare to work on a mod like that.

Adding vehicles would be complicated and difficult, sure. It partly depends on how they’re added – the simplest version I can think of is “wearable vehicles” (they’re basically just fancy armour), which has lots of down-sides but is pretty much within reach of a novice modder provided they know/are prepared to learn how to animate and can do some basic scripting beyond what’s required for the animation. The next step in complexity would be “golem vehicles”, which is another fairly simple option but has a lot more work involved. The most extreme option would be adding a whole “service” to the game to handle vehicles – how hearthlings drive them, how their AI adapts when they’re driving a vehicle, options for what the vehicle can do (e.g. can it carry an inventory? Does it require fuel? Does it have/allow attacks, and does it require ammo for them?), tracking the vehicle’s health and so on… the trickiest part of that would be getting the hearthlings to “understand” vehicles and use them in their other tasks.

Teleporters are tricky simply because of the fact that hearthlings would need to understand how to use them, and that requires some custom AI or possibly some very interesting pathfinding shenanigans. It’s probably a good idea to talk to @BrunoSupremo about his boats for that – I’m not sure, but I suspect that whatever he does to get hearthlings to ride those boats might be useful for teleporters that simply go from point A to point B. If there was a network of teleporters instead, then hearthlings would need to be able to “see” the possibility to get in at one teleporter and get out closer to their destination, and that’s where it gets very tricky because that definitely requires customer pathfinder AI.

The boats are what you called (and it is an excellent analogy) wearable vehicle. When hearthlings step on the docks they get the boats attached to them. The part where they go over the water was done with adding an actual bridge, invisible. That is why and how they can cross from one side to the other.
I do want to improve it somehow, but will not be soon. :frowning:

1 Like

Ohh , and suddenly my dream about having some kind of transportation went down the sink :sob:

Guys, i saw these days on Trello Board an idea about Beast Tamer class. Is it difficult to implement some kind of big, very fast and strong inteligent beast that serves the purpose of only hauling stuff (in a very fast way and in one trip only), rescuing (multiple) hearthlings (very fast) and carrying a military party to a distant place?

For example, right now as NA, if i kill a bunch of deer with archers, then i have to place storage nearby in order to hurry that, wait, watch hearthlings go forth and back to eat/drink/sleep, and only then i take that storage and place inside my town . It gets worse if i try to mine far away or build anything far from town - even building roads can be time consuming, specially if you decide to gather the dropped thatch (i usually destroy).

Perhaps having an optional button somewhere (just like gather), but that is used to order that inteligent beast ONLY - so no hearthling does that job in its place.

And we could have “mobile defenses” on that, made by the engineer.

The problem with any kind of logistics that I had faced back when I made the conveyor belts in Zulser (half a decade ago, jesus) was that the pathfinding was not accessible from lua in a way that I would need it to be. There was a real danger there in transporting any kind of good with minecarts or similar, namely that you get a deadlock.

If you assume there’s a “source” of items (i.e. a station where items depart on your vehicle) and a “destination” (i.e. a station where the items arrive), you’re ending up with the weird situations that the AI will move items to the source, it gets transported to the destination, and then picked up again and - if no closer storage is available - it’s put into the source again. Rinse and repeat.

There’s quite a few ways you could avoid that - Zulser for example did multi-stage pathfinding to work around this, but you could probably also tag items for some time - but none of them are really satisfying, neither for the performance nor for the functionality.

For the pathfinding itself, unless they’ve added access to the navigation graph (which I doubt), then most of the things you could do are just flat out not feasible. This includes portals, teleporters, any kind of vehicle to shuttle stuff between A and B, and more. You could implement some of them, but they would have some rather nasty drawbacks.

Ok … so basicaly these animals (from Animal Tamer) will only serve fighting purposes … which is not enough of a reason to justify its implementation since hearthlings are very very strong compared to all enemies except the Titan, and also there is a limit to the ammount of hearthlings you can have.

No no, animals are fine. We have golem already doing a bunch of work, you just need to change the model.
The part we are saying that is not possible is the change of getting an item and dropping into stockpile, or hoping into a vehicle before going somewhere. That is what is locked now, we can’t hijack the pathing to instead first drop the item somewhere else (a minecart, a hauler animal, teleporter, or hop into a vehicle, etc…) and then from there go to the stockpile or final destination.

The animals as helpers are ok to do, it just happens that it kinda defeats the purpose as you need to fill them with so much a.i. that it is better to simple have one more citizens instead lol (golems are simple as in they can only do one thing, but it is easy to add more activities)

1 Like

to add to bruno’s explanation golems are ok BECAUSE they do one thing. they dont have to think about beds, food, rest, safety, running. all they do is DOES SOMETHING HAVE TO GO FROM POINT A>B? IM ON IT!

1 Like

well can’t we just change the model and animation of the golem to a car and and edit the script that says go from point A to B, when you select a item to be transported via a selection menu that you want to go to a far away stockpile or place, so when you select that option the selected hearthling(From the new menu) wil go to a car parkinglot that is available(it doesn’t matter where it is so that it is easier for modding) and then sit in it while the script will use a ghost hearthling with no collision which the car will follow so that we don’t have to recreate a whole pathfinding system to do thar.

i already made a qb model of a engine with different versions.

this is a V4 engine.

this a engineer workshop for the mod, the engineer will craft all the parts for the car’s and other things.