Page 1 of 1
The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 2:49 am
by vorebane
I am trying to create a custom anvil, cloning off of the altar. As it's currently sized, the position of items resting on it is entirely misplaced. I understand that to change where the items are placed, I need to use the fields of anchorPos and anchorRotation in the define object script. I don't know what is meant by '3d vector' though, and searching the internet and the forums hasn't solved it for me yet. Has anyone figured this one out yet, or is there a standard notation I've missed?
Re: The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 4:05 am
by Komag
the position is an X Y X system where it's in 3D space as you look forward (not down from above), X is left and right (right +), Y is up and down (up +) and Z is forward and back (forward +), with 0,0,0 being on the floor in the middle of the tile (IIRC)
Re: The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 6:22 am
by vorebane
This makes sense, but it does not seem to be working for me. When I write anchorPos = 0, 50, 0, hopefully getting some amount off the ground, I get an error loading the dungeon in question, stating a table was expected where the editor got a number. Whether I use square, curly or pointy brackets, I get an unexpected error. When I use round brackets, it just doesn't change anything. Based on Grimwold's custom note hook, I discovered that the accepted format seems to be 'vec(0,0,0)' but even this seems to have absolutely no effect on where the item rests, so I still have a very nice anvil shaped object with astounding powers of levitation. Given that the editor only seems to load up custom scripts the first time it loads a dungeon with such scripts, and it demands I open the client proper before I open the editor, I am really wishing this was documented somewhere instead of making me guess and scour the internet trying to make a floating object move an inch. I'm going to beat my head against a wall for awhile, that seems more productive.
Re: The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 11:41 am
by Grimwold
Yeah, the correct format for anchorPos is as follows:
and tiles are 3x3x3.
If you want to be able to place items on the anvil, and remove them, you will also need to adjust
targetPos and
targetSize in the same way.
EDIT - I think there might be slight differences between how Altars and Alcove's work, so if you have defined your Anvil with class="Altar" that might explain why it's not acting how we expect.
I was working on something using this stone crab:
viewtopic.php?f=14&t=3411&start=270#p41503 but after repeatedly reloading my project after changing the anchor and then trying to get the target right, I gve up.
Re: The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 12:27 pm
by Neikun
Altars have no anchorPos/anchorRotation
Lets hope the devs implement it
-though it would be difficult, I have faith in them!-
Re: The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 1:49 pm
by Grimwold
Neikun wrote:Altars have no anchorPos/anchorRotation
Lets hope the devs implement it
-though it would be difficult, I have faith in them!-
Is it possible to use a logical alcove to achieve the desired effect?
Re: The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 5:15 pm
by Komag
I don't see why not. Just make an object that is a blocker or something, with the altar model, then set up custom socket()
Re: The format of 3D vectors in custom assets
Posted: Mon Nov 05, 2012 11:42 pm
by Neikun
That is how the Metal junk blockage works. Unfortunately, the player can't grab things that are too close to the center/other side of the square.