Author Topic: Taking a vehicle's model and applying it to a bot  (Read 658 times)

I'm trying to change a vehicle into a bot, due to the issue with vehicles going through bricks.

I have the .dts file, all the textures, and the code that defines what properties the bot has. However, when I try spawning it in my server, the game freezes up and gives me an error message.

After looking at similar bot(Armor) type add-ons, I think the issue may be that there is no animations. I was wondering if there is a way around this, as the bot will not be used for playertype purposes or anything, so the animations (I think there's thirtysomething animations total that are defined in BL) will simply be the same as current model with no changes.

Thank you in advance.

Animations would be one of the problems.

Another problem being the difference in points on the players and vehicles.

Vehicles have points for wheels and seats.
Players have points for equipment and the viewpoint.

Animations would be one of the problems.

Another problem being the difference in points on the players and vehicles.

Vehicles have points for wheels and seats.
Players have points for equipment and the viewpoint.
The vehicle I'm using, as far as i know, has no seats, nor wheels.
As for equipment/viewpoints, i'm not sure.

So is there no way to get by with no animations?
or would it need to be re-created?

The first datablock is what you're missing I think.
Code: [Select]
// Load dts shapes and merge animations
datablock TSShapeConstructor(DogDts)
{
baseShape  = "./dog.dts";
};

datablock PlayerData(DogArmor)
{
//blah blah blah. You should have this already.
};

You should be able to substitute in your own stuff. I think the important part is the first datablock, DogDts. Since you have no animations it would make sense that you only need the baseShape defined.
« Last Edit: July 15, 2011, 09:06:20 PM by Greek2me »

The first datablock is what you're missing I think.
Code: [Select]
// Load dts shapes and merge animations
datablock TSShapeConstructor(DogDts)
{
baseShape  = "./dog.dts";
};

datablock PlayerData(DogArmor)
{
//blah blah blah. You should have this already.
};

You should be able to substitute in your own stuff. I think the important part is the first datablock, DogDts. Since you have no animations it would make sense that you only need the baseShape defined.
That worked.
Now the problem is that the place where a normal player would have the bottom of their feet is the exact center of the bot/player.
I'm fairly sure this has to do with the bounding box, but it seems like bounding boxes only go upward from the standard foot area.
Is there any way around that?

Here's some code I copy-pasted from my version
Code: [Select]
rideable = true; //Doesn't this need to be true for it to appear on vehicle spawns?
canRide = true;
paintable = true;

boundingBox = vectorScale("3 3 3", 4);
crouchBoundingBox = vectorScale("3 3 3", 4); //Bot should not change the size if they crouch
I'm a bit new to working with physical space on blockland, so this piece is borrowed from the horse and edited. Is there another way that would calculate the volume, starting from the X/Y/Z Axis's origin?

Also, spawning the bot on a vehicle spawn still crashes me, yet using the changedatablock event to test it works fine. Other than those two things, there's no major problems.

Still need help with the new issue...


With calculating volume, it's probably just a hit'n'miss tactic.