VoidExpanse > Help section

Destructible stations - NPC spawn location x and y rounded?

(1/2) > >>

Hi, I just wanted to know if when using the generator.AddNPCShipToSystem if the position x and y are actually rounded instead of using the exact location where i want them spawned.

Below picture shows why i am asking. I am able to create destructible parts from Blender and then from the destructible parts, i am creating "turrets" without AI to drive them, and I put their weapon invisible, which makes it so that i have static Walls in place for the station and those walls are destructible. Although I set the correct pivot location for every object in Blender and double checked they were correctly aligned, they aren't spawned where i want them to in Void Expanse. Any ideas why?

EDIT: Nevermind about my question.... I just printed to console and the correct position is supposed to be set. That is confusing me.


So they're spawned in the correct location...I'm not sure why they're not displayed exactly as they spawned. Are you sure the location is not changed after spawn? If you're using physical shapes for these objects they might pull each other away. Have you tried spawning them without physical colliders? Also, have you tried using simple 3D cube models to check that the issue is not related to 3D models?


Hi ai_enabled, i'm going to try different models in Blender. I think that "maybe" the issue is related to the pivot point again... Although they are all at the perfect axis Z location, their pivot point in axis X and axis Y are different.

I had to learn to code a bit of Python in 3 days to make all of this work. The models are all exported by code, the XML files by code, the png's by code, the floor are decorations but the walls are turrets... Lol it was a lot of work but python is interesting for sure. It must've taken me 4-5 hours just to insert the XML nodes in code so that the xml files load in Void Expanse, but the nice thing is that it now works. I can use Python with models of Blender that I export from code and everything is done automatically for, in this case, over 100+ models.

I will try to align all of the pivot points so that they are aligned all with the same distance from each other if i can... Im not sure yet how to do this as manipulating pivot point from code in Python is not super user friendly, unless you know the API functions. I mean blender python code is scarce compared to unity c# and unity javascript.

Python skills are certainly useful :-)

So, I would suggest simply using a 1*1*1 cube model and spawning it as multiple turrets on exact 1 unit distance between them. This should work properly if your units conversion is done properly, otherwise, there will be regular intervals between all objects.


So, I manually set each Pivot to be exactly the same X as any other objects in the same X axis row of walls..

It looks like this in blender. But when I export to .obj, i set the position of each object to x=0 and y=0. The original position of the object is kept in memory and used in the name of the XML file so that I can use that ingame to spawn turrets to the offset where they are supposed to be just like in Blender. I output the names of the XMLs by code to a notepad and just copy paste them to the library in Void Expanse for spawning them. Super fast instead of manually doing everything, and with the number of times that I gotta rebuild them in Void Expanse to test if they are aligned, it sure helps to have an automation on the workflow.

But again, it gives me this result in Void Expanse lol. They are now aligned with the axis X but not with the axis Y... haha wth am i doing wrong. Geez. Blender and the pivot is annoying me ;)

Im gonna try next the same distance between each walls.

And now with an offset of 2.25 units in the Y axis from blender for every model's pivot point gives this... Like... Huh?

OH... there is a detail you mentioned and I am not sure that i got it right. The unit conversion. I am using the exact units from blender without any changes. You can see in the void expanse screenshots that something is wrong where the wall tiles are "spawned" a little bit short in distance compared to the floor tiles which isnt supposed to happen, the floor tiles to the left extremity should be aligned with the last wall too. So definitely, it must be the unit conversion the issue. I'm gonna look for some fix on this.

Funny thing it works when i actually remove 2.25 units from the first wall at each extremity in Void Expanse Javascript when spawning the walls. Example, i take the Y position from the xml file name of the most right or most left wall, than I add or remove 2.25 units in Javascript when spawning the walls. It works like that but it means that the units that i get from Blender aren't working. Im not sure if I already asked you ai_enabled in some other post what the units of Void Expanse are compared to those in Blender. Please enlightened me when you get the chance, otherwise, this whole thing will be a pain to make offsets in code for everything to line up .Thank you


[0] Message Index

[#] Next page

Go to full version