Author Topic: Blender Help  (Read 763 times)

Trying my hand at modeling. I'm using the newest version of Blender and Port's DTS exporter.
A few questions/problems:

1. I can't get my texture to work. It just appears as a black box in game.
2. I want this to function as a bot like the rowboat(but it's not actually going to move or rotate or have mount points or anything). How do I add collision to it?

What it's supposed to look like:

Blend file:

For the textures: Create a material with a texture applied to it, then apply that material to the faces and make sure the material in the final blockland addon folder is actually the texture. The texture has to have a dimension that is square and a power of 2 (i.e. 8x8, 16x16, 32x32 etc etc).

Create a material with a texture applied to it
That second part is only necessary for viewing the texture in Blender, the material just has to be named after the texture for it to appear in game

Okay. I got the texture to show up correctly in game, but the collision is off. Besides sinking halfway into the ground the collision is accurate, but I'm just using the bounding box variable on the player type for that. There's no collision as part of the model.

Your model needs to be positioned on the grid in Blender as if it were an actual floor

Also, i fixed your texture so that it shouldn't have that black outline to it
« Last Edit: February 01, 2019, 10:08:38 AM by Masterlegodude »

Thanks, it worked.
I'll post here if I have any more trouble.

welcome back jes00! if you need further help, you can also find it on the blockland content creator discord - i wrote two short basic tutorials to blender which are pinned under #classroom-discussion there

How do I make the mountpoint and muzzle point for an item using Port's DTS exporter?

I found this on the FAQ but I'm still not sure what to do.

Create an Empty and rename it to mountPoint, then create another one and name it muzzlePoint, then position the mountPoint where you would like the player to hold the item from, and muzzlePoint to where you want the item to fire from, in most cases, rotating the nodes isn't necessary

And for future reference, that hierarchy in the FAQ can be achieved by parenting objects to other objects by selecting one object, then selecting another object to be the parent, and pressing Ctrl P to bring up the parenting menu

Parenting isn't necessary for weapons though, only when you want to animate parts of the weapon, and/or other nodes that you have on the weapon
« Last Edit: February 02, 2019, 08:43:21 AM by Masterlegodude »

Can you have two muzzle points on a weapon or do you have to do a bunch of math for one?

Also, how can I get the projectile to fire down instead of forward? It always fires forward no matter which direction I face the arrow.
« Last Edit: February 02, 2019, 10:07:02 AM by jes00 »

You can only have one muzzle node. Nodes don't have directions, they are just a point in 3d space. So changing the arrow will do nothing. In order to modify the trajectory of your projectile you have to manually modify that in the onFire function of your weapon. See: bullet spread. Uses velocity vectors

Since you'd need to instantiate a projectile you can make it spawn from an offset of the muzzle point, replicating more than one muzzle node. This is helpful for guns like the wave gun that have multiple barrels in a line and you need a bunch of bullets to spawn along each barrel
« Last Edit: February 02, 2019, 10:18:56 AM by PhantOS »

Link to the wave gun?

EDIT: Okay. So I've got this weapon. The muzzle point is the orange dot. I'm trying to get projectiles to fire down out of the red dots. All I can do is get a projectile to fire down out of the orange dot.

Code: [Select]
%left = vectorNormalize(vectorCross(%player.getForwardVector(), %player.getUpVector()));

%up = vectorNormalize(vectorSub(%player.getSlotTransform(2), %player.getHackPosition()));
%up = vectorNormalize(vectorCross(%left, %player.getMuzzleVector(%slot)));

%projectile = FLUDD_SquirtProjectile;

%vector = vectorScale(%up, -1);
%objectVelocity = %player.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1, %vector2);
%x = 3.1415926;
%y = 3.1415926;
%z = 3.1415926;
%mat = MatrixCreateFromEuler(%x SPC %y SPC %z);
%velocity = MatrixMulVector(%mat, %velocity);

%p = new projectile()
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %player.getMuzzlePoint(%slot);
sourceObject = %player;
sourceSlot = %slot;
client = %player.client;

« Last Edit: February 03, 2019, 07:28:21 AM by jes00 »

I don't actully know how possible it is to fire multiple projectiles from different points of a weapon, but maybe with the 'new projectile()' script, it's somehow possible to set the 'initialPosition' parameter to a custom node? Maybe someone more knowledgeable on this matter knows how that could work

In the mean time, how would I go about adding an animation to my box, which is technically a player type?

A cyclic animation exported as a dsq probably. Like I'm sure you could even just make the root animation a sequence of it spinning and then by default in-game it will always spin. Idk if root can cycle though