Jump to content
Sign in to follow this  

Question how to approach vehicle inventory for logistic script

Recommended Posts

Hi, I'm looking for some help in figuring something out. 

I am currently trying to create a logistic script with the help of the ACE3 interaction framework. My goal is to create something similar to R3F and igiLoad.
Attaching the actual cargo objects to the vehicle, but instead of a one-dimensional manner I want to have it 2D.
What I mean is: Take for example an Offroad and look at the truckbed. Now devide that into a grid lets say it is 3 units wide by 8 units long and define every loadable object as taking up x,y amount of grid space. 
There are many ways you fit things in there and attach them to the vehicle. An object that is 1x2 will fit in rows and columns. 

So my question really is : what would possibly be the best way to go at this problem?
What might be the best approach, are there some functions I can use to make things easier?
The inventory system in general? 

I can imagine some kind of tetris logic that would be able to accomplish this, but I'm afraid my approach would be very bulky and ugly.
Also I don't really know what the best way of keeping track of the vehicles inventory would be.

So I want to pose those questions to anyone here, who has more experience and knowledge, and might be able to help me figure this one out.
Any pointers or thoughts would be apprechiated!

If anyone wants to look at what I already have, nothing special just able to load/unload one object at the moment: https://pastebin.com/cHxknQdQ


Share this post

Link to post
Share on other sites
3 hours ago, Grumpy Old Man said:

Take a look at the library from glorious @rübe, holds a plethora of cool stuff, the rectangle packer might contain some info on how to approach what you want.






Some awesome functions there. Wondering what RUBE does for a living.

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this