Torchmodders

Modding => Modding Questions => Topic started by: TwinkleToes on April 09, 2017, 04:12:21 am


Title: moving model positions
Post by: TwinkleToes on April 09, 2017, 04:12:21 am
this is specific request for my fellows here that know more 3d than me

im trying to create a skill that summons 2 floating pets attached to the character (kinda like the outlanders repulsion hex)
i did some quick file cloning and xml editing and managed to make 2 summons which float by my side, the problem im having is making skills the summons use fire from their reoriented positions

heres a preview (http://i.imgur.com/AsiEjp4.gifv)
those little floaty turrets are the summons, as seen here the skills dont fire from the right positions
im using the gun portion of the gunbot model in media/models/pets/gunbot

the only thing i did to the model skeletons, was edit the x and y position of its "root" bone
im guessing more has to be done to let skills fire from the correct position, i tried to reorient all the animation skeletons with retimer but had no success.

any idea on how this can be done?
Title: Re: moving model positions
Post by: doudley on April 09, 2017, 04:34:22 am
Maybe I'm way off about this but if you're basing this skill from Repulsion Hex then repulsion sentry's skill already does this, right?
Spoiler (hover to show)
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 04:49:03 am
im basing it on repulsion sentry but im tweaking the skill to be more specific to the aesthetic im aiming for, im not a proponent of straight up cloning a skill, and besides it would look janky with the feel and theme im trying to convey with the skill.

to put it simply, the problem im having is basically with 3d instead of the skill itself.
i want to make the gun bot (guns) behave like a repulsion sentry but have them be floating in a different positions (one on the left and right) like i said i was able to achieve this by cloning the model and editing the root bones for both in the bind skeleton

if i set the skill to attaches it should fire from the center of the model, but obviously something is up with the orientation of the edited models.
Title: Re: moving model positions
Post by: doudley on April 09, 2017, 05:24:18 am
Oh I see, thank you for clarifying it! :D

I made a 3 sentry-repulsion hex skill back in 2013, nothing to do with 3d and their orientations :-[
Title: Re: moving model positions
Post by: Anarch16sync on April 09, 2017, 06:08:26 am
Hey @TwinkleToes would you add a screenshot of your edited model on the mesh viewer, and make it show the bones position. I have an idea of what could be the issue, but knowing where the bones are in the model will tell me if I'm right or now.

For what I can see the particles seems to fire from the root bone, or the center of the model, have you tried using "Fire from Bone" with the bone that's in the turrets position?
Title: Re: moving model positions
Post by: Phanjam on April 09, 2017, 06:41:05 am
heyya Twinkle! So the skill has a "fire from bone" line somewhere, most likely "center" for those turrets? Maybe it's still treating their "centers" as the origin-point of the model (instead of their relocated root bones).

Instead of relocating them via moving their root-bones, can they be relocated via an "offset" command in relation to the summoner (I believe this is how Alch's Ember Sentry is setup)
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 07:19:22 am
Instead of relocating them via moving their root-bones, can they be relocated via an "offset" command in relation to the summoner (I believe this is how Alch's Ember Sentry is setup)

offset? which editor is that in? as far as i know you cant force something to offset if its attached to its master via the unit editor, you can however attach the summons to a specific bone on your model, but this method is not ideal for what im pursuing.
alchemists crystal is exactly the same as repulsion hex, both seem to be models that are offset based on their bone positions.
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 07:25:16 am
Hey @TwinkleToes would you add a screenshot of your edited model on the mesh viewer, and make it show the bones position. I have an idea of what could be the issue, but knowing where the bones are in the model will tell me if I'm right or now.

For what I can see the particles seems to fire from the root bone, or the center of the model, have you tried using "Fire from Bone" with the bone that's in the turrets position?

not familiar with a model viewer that shows bone positions lol
but heres the raw code as an XML file
ive only edited the bind skeleton

Code: [Select]
<skeleton>
    <bones>
        <bone id="0" name="gun">
            <position x="1.13994e-009" y="-0.191959" z="0.24724" />
            <rotation angle="0">
                <axis x="1" y="0" z="0" />
            </rotation>
        </bone>
        <bone id="1" name="head">
            <position x="0" y="0" z="0" />
            <rotation angle="0">
                <axis x="1" y="0" z="0" />
            </rotation>
        </bone>
        <bone id="2" name="root">
            <position x="2" y="-2.5" z="0" />
            <rotation angle="1.5708">
                <axis x="-1" y="-0" z="-0" />
            </rotation>
        </bone>
    </bones>
    <bonehierarchy>
        <boneparent bone="gun" parent="head" />
        <boneparent bone="head" parent="root" />
    </bonehierarchy>
    <animations>
        <animation name="Bind" length="0">
            <tracks />
        </animation>
    </animations>
</skeleton>

the other one is basically just position x="-2" and y="-2.5" on the root bone
fire from bone doesnt do much, with what ive done here it still interprets the models as being in the center but shows them flying around visually.

Title: Re: moving model positions
Post by: Anarch16sync on April 09, 2017, 07:35:53 am
not familiar with a model viewer that shows bone positions lol
but heres the raw code as an XML file
ive only edited the bind skeleton


Is the one runic gave us on the TL2 tools and assets pack, in one the tabs you can turn the visibility of the bones. I'm not really that good a reading .xml files haha but I see what you did there.
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 07:43:49 am
dont have that lol, but im downloading it as of this moment
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 08:16:12 am
@Anarch16sync
so heres the comparison of the normal model and my edited one
the bones are in the same place but the model flies off somewhere else
Spoiler (hover to show)
Title: Re: moving model positions
Post by: Phanjam on April 09, 2017, 08:24:35 am
Hey Twinkle, by "offset" I meant like how the ember sentry summon layout (EMBERSENTRY.LAYOUT) does it (I believe it's those RADIUS and ANGLE lines)...

Code: [Select]
[PROPERTIES]
<STRING>DESCRIPTOR:Unit Spawner
<STRING>NAME:Unit Spawner0
<INTEGER64>PARENTID:-1
<INTEGER64>ID:5788177699228422622
<STRING>MIN RADIUS:0,0.01
<STRING>MAX RADIUS:0,0
<STRING>ANGLE:0,140
<UNSIGNED INT>COUNT:1
<BOOL>SPAWN ON CREATE:false
<FLOAT>DURATION:0
<BOOL>SPAWN IN CENTER:true
<STRING>RESOURCE:EMBER SENTRY
[/PROPERTIES]

because if you look a the sentry mesh bones, they are not offset from the origin-point (the point with the red, green and blue arrows at the bottom), yet the sentry floats a little in front and at an angle from you. 

(http://i.imgur.com/x78v4OD.png)

This led me to believe it's the .LAYOUT which does the positioning, not anything with the bones...
Title: Re: moving model positions
Post by: Anarch16sync on April 09, 2017, 08:25:49 am
Yeah, just what I tough, when you moved the root the mesh got the right location, but the other bones keep their relative distance from the root bone, you would want to make the other bones move to where your model is. Now I don't know if you can make it work right editing the XML file, you can try anyway of
 course, and I don't mess around so much with skeleton on blender to say if it's easy or not. Maybe @Kva3imoda or @Vkoslak will come around and have a say on it.
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 08:35:02 am
@Phanjam
the radius and angle are to control the aoe of the unit spawner lol
ive used that to make the vanquishers arrow rain particles with a unit spawner that spawns particles instead of missiles or pets

@Anarch16sync
yea, i checked out the repulsion hex model and it seems like the whole thing is just a large connected bone. that shows the mesh at one of its points 
while the right hand bone is on the tip, to determine where to fire the particles from
Spoiler (hover to show)

maybe i could restructure the bones for the gun bot to be like repulsion hex, but it seems like a huge task using just xml files.
Title: Re: moving model positions
Post by: Phanjam on April 09, 2017, 08:39:22 am
maybe i could restructure the bones for the gun bot to be like repulsion hex, but it seems like a huge task using just xml files.

Yeah it would be, because of all the trial-and-error! You need 2 models, 1 each for the left and right, with looks like a 1meter offset more or less? gimme a few and I'll try to make them for you...

EDIT

or send me the .mesh.xmls you were working with; I'll just convert them back to .MESH to see what you wre after...

Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 08:44:21 am
thanks for the offer phan :D
(and GL if you decide to do it)

you should have the original in your media folder
media/models/pets/gunbot

just convert the skeleton files to XML with the orge command line tools
Title: Re: moving model positions
Post by: Phanjam on April 09, 2017, 09:04:11 am
hey @TwinkleToes pls let me know if these work; am not sure if these have the "offset" from center/floor you were after (which is why I was asking for the .xmls you had edited ;) )
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 09:27:23 am
thanks phan
i tested them out
but the monster cant use any animations so they wont fire any skills
i also looked at the bone positions and they are still in the center, so its unlikely they will work like repulsion hex does.


if all else fails, i have a ghetto work around as a back up plan lol
Title: Re: moving model positions
Post by: Anarch16sync on April 09, 2017, 10:14:32 am
Hey @TwinkleToes I finished with what I was doing so I take a moment to make you this.

I edited the gun model to use the sentry skeleton, so I works with it's animations. I have attached it all in the rar file. Tell me if it works for you.
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 11:21:12 am
thanks anarch :D
works perfectly.
if i roll with this one i need a second sentry thats facing the other way around, in this case its backwards since this one positions the gunbot slightly infront of the character
Title: Re: moving model positions
Post by: Phanjam on April 09, 2017, 04:18:57 pm
Hey @TwinkleToes I finished with what I was doing so I take a moment to make you this.

I edited the gun model to use the sentry skeleton, so I works with it's animations. I have attached it all in the rar file. Tell me if it works for you.

Ah the SKELETON had to be right too! My bad :D
Title: Re: moving model positions
Post by: Anarch16sync on April 09, 2017, 07:26:04 pm
@TwinkleToes remember that the sentry will rotate to face the enemy it's attacking, If you want two sentry try if you can get the effect from attaching two and controling the position in the layout because if you want two that always face opposite directions it may need to make both a simple unit.
Title: Re: moving model positions
Post by: TwinkleToes on April 09, 2017, 11:58:17 pm
dw i figured it out :D

i did my ghetto work around and eventually built it up to a legitimate solution lol
i dont have to do any XML editing, just pure unit file manipulation.
it involves some hidden tricks with GUTS

if anyone wants i can chuck up a quick tutorial.
Title: Re: moving model positions
Post by: Phanjam on April 10, 2017, 03:45:13 am
ooh i'm always game for new "hidden tricks"! no rush Twinkle, whenever you have time ;)
Title: Re: moving model positions
Post by: TwinkleToes on April 11, 2017, 07:24:53 am
ill try summarize it as shortly as possible 

i exploited the way the engineers gun bots are "constructed" as a unit
the actual gun bot is made of 2 units stuck together
one is the main body that moves around, its given a caster ai that likes to run around
two is the gun attached on top, thats given an aggressive ai

the way to stick them together is to use these hidden options

   <STRING>ATTACHED_UNIT:[unit name]
this is on the main body, and specifies which unit will be attached, and
   <STRING>ATTACH_BONE:[bone name]
this along with attaches to master, is on the gun, which specifies which bone the gun will be attached to, in this case its the head bone of the main body

with this new found information
first i created an invisible unit to serve as a main body, this was also done in a particular way, i didnt use the unit invisible effect, instead i cloned a unit file and stripped it down to just an idle and bind animation, then edited the dds file it uses to mask the entire models alpha channel and make it invisible, if i used the other method the attached units would also become invisible.

i can use any model with two arms as a good basis, by attaching a unit to the arms of the invisible main body and i can scale the size model via its unit file to effectively increase the distance of where the attached unit will float around

but... you can only attach one unit to another, so i simply cloned the unit again and made my skill summon another main body with a unit attached on the other hand.

so basically i have two invisible units attached to me, with visible units attached to them, one has a visible unit attached to the right hand and the other on the left hand.

the result is awesome! lol.
http://i.imgur.com/j4Q7U1D.gifv

the attached units inherit their damage from the main body, if the damage they deal is set to 0.
one limitation though, is that skills used by the attached units cannot be used with the "use master for attacks" option
but there are ways to circumvent that and make the minions damage scale with your own.

Title: Re: moving model positions
Post by: Phanjam on April 11, 2017, 06:25:35 pm
ABSOLUTELY that is Awesome Twinkle :D This is just amazing! Hmm, attached units eh? Let's see what else we can make with these  :o 8)
Title: Re: moving model positions
Post by: Kva3imoda on April 11, 2017, 11:08:21 pm
Hey Twinkle. I think you need a flying turret. Something like that:

(http://i.imgur.com/uX6w84D.png)
Title: Re: moving model positions
Post by: TwinkleToes on April 11, 2017, 11:18:06 pm
 :o
WOW!, does that come with animations?
would be cool if the gun bots are animated to float around.
Title: Re: moving model positions
Post by: Phanjam on April 12, 2017, 02:20:51 am
Youre attaching them to units with just bind and idle animations right? What if the idle anim was kinda "floaty" like the estherian shade?
Title: Re: moving model positions
Post by: TwinkleToes on April 12, 2017, 02:38:32 am
Youre attaching them to units with just bind and idle animations right? What if the idle anim was kinda "floaty" like the estherian shade?

i tried to look for something appropriate but most of the models have misaligned distances between their arms when they get animated so it makes it look really awkward or they simply move too much so the bots look like they are spazing out lol

i ended up chosing the the ezro_brute as my invisible model since its idle anim is minimal but still makes the guns move in an appropriate manner and doesn't make the distances and elevation of each gun bot look janky, there are some other candidates ive tested out, but they either move too much or their arms are not aligned properly when they are moving.

the most ideal setup is to have a static main body and have the attached units themselves be floaty imo.
Title: Re: moving model positions
Post by: Phanjam on April 12, 2017, 06:52:13 am
the most ideal setup is to have a static main body and have the attached units themselves be floaty imo.

You mentioned the original gunbots had 2 skeletons; 1 each for the base and the turret. Why not let your invisible unit stay on bind, then use the Alch's sentry crystal .SKELETON for the gun? It has a floaty animation...
Title: Re: moving model positions
Post by: TwinkleToes on April 12, 2017, 07:39:23 am
its already an offset model, so the crystals will fly all over the place, and the way those things move will destroy the whole look im going for.
the crystal and repulsion hex "models" are actually elongated skeletons, with a models attached on the highest bone, i think i showed it before in this thread with screen shots of the bone positions.
Title: Re: moving model positions
Post by: Kva3imoda on April 12, 2017, 05:20:35 pm
does that come with animations?
Not yet. Now it's just a concept. But I have a plan to finish it.
Title: Re: moving model positions
Post by: Phanjam on April 12, 2017, 08:47:29 pm
Yeah that flying turret looks really great Kva!
Title: Re: moving model positions
Post by: Kva3imoda on April 16, 2017, 11:42:54 pm
would be cool if the gun bots are animated to float around.
(http://i.imgur.com/zKqjEDs.gif)
Title: Re: moving model positions
Post by: TwinkleToes on April 17, 2017, 03:11:50 am
(http://i.imgur.com/orZCO56.png)
Title: Re: moving model positions
Post by: Kva3imoda on April 17, 2017, 04:33:52 am
Twinkle, tomorrow I'll try to make a test flybot for you. We need to find out what the skeleton/bones and animations you need.
Title: Re: moving model positions
Post by: Phanjam on April 17, 2017, 04:48:13 am
would be cool if the gun bots are animated to float around.
(http://i.imgur.com/zKqjEDs.gif)

фантастика!!!

(did I get that right Kva?)
Title: Re: moving model positions
Post by: TwinkleToes on April 17, 2017, 04:52:19 am
Twinkle, tomorrow I'll try to make a test flybot for you. We need to find out what the skeleton/bones and animations you need.
ooo, thanks :D
all i need is a bind, idle and attack animation

but... if you really want to, you can give the model extra weapons (side mounted rocket launchers and a cannon)
since my skill has the bot use 3 attacks
i put up the example on my other post. but ill put it here for convenience
http://imgur.com/c2oZYY0






Title: Re: moving model positions
Post by: Kva3imoda on April 17, 2017, 05:13:29 am
(did I get that right Kva?)
Yeah!  :D

but... if you really want to, you can give the model extra weapons (side mounted rocket launchers and a cannon)
Something like Inspector Gadget?  :D
Title: Re: moving model positions
Post by: Kva3imoda on April 17, 2017, 06:49:49 am
Twinkle, what is the duration of the minimum automatic firing?

Do you need special animations for the gun and rockets?
I think the cannon is not needed. We can use gatling gun for a special "burst attack".

Title: Re: moving model positions
Post by: TwinkleToes on April 17, 2017, 06:57:26 am
0.333333
would love to have the extra anims :D
but just 1 attack anim will be fine, its up to you if you want to take the extra time for more animations.

all three attacks come from 1 skill and animation, to save time over making 3 new skills.
but if you do animations for the other attacks i will re code the bot to use multiple animations

heres the 3 attacks individually, so you can get a better sense of how to animate them(if you choose to)

http://i.imgur.com/Jl82HMT.gifv
grenade launch (fired from a cannon)

http://i.imgur.com/ve6WBtZ.gifv
homing rockets (fired from the shoulders)

http://i.imgur.com/6rGPf6o.gifv
bullet spray (fired from the gattling gun)
Title: Re: moving model positions
Post by: Kva3imoda on April 17, 2017, 10:22:25 pm
Twinkle, tomorrow I'll try to make a test flybot for you.
It's ready: https://yadi.sk/d/ZDnWZrlS3H5pDe
Title: Re: moving model positions
Post by: TwinkleToes on April 18, 2017, 10:36:13 am
thanks kva :D
i just tested it, is it possible to "center" the model and make it be on the ground instead?

what i mean by this is that the root bone is away from the rest of the model, which offsets the model upward miss aligning the whole thing.

(http://i.imgur.com/c232dNH.jpg)

the green thing is a unit theme i attached to what i was using before to enhance the look.
but basically i want the gunbots to be where the green is.
Title: Re: moving model positions
Post by: Kva3imoda on April 18, 2017, 04:10:04 pm
i just tested it, is it possible to "center" the model and make it be on the ground instead?
Yeah, I can do it. In addition, I am a bit remade skeleton and animations.

Version for pets and monsters(flying bot): https://yadi.sk/d/l8EBoLvo3H7iVU

Version specifically for Twinkle tasks(ground slider): https://yadi.sk/d/0iAYPRtb3H7hhp

what i mean by this is that the root bone is away from the rest of the model, which offsets the model upward miss aligning the whole thing.

the green thing is a unit theme i attached to what i was using before to enhance the look.
but basically i want the gunbots to be where the green is.
Well, the root-bone is always in zero coordinates. You need to attach your unit themes to other bones. I think in this case you need a body-bone - bone02. This will allow the particles to move in concert with the model body.

In the hierarchy, it looks like this:

        <boneparent bone="bone01" parent="root" />
        <boneparent bone="bone02" parent="bone01" />
        <boneparent bone="bone03" parent="bone02" />
        <boneparent bone="bone04" parent="bone02" />

which means:
root - zero-point bone
bone01 - base bone. Technically used to adjust the position/rotation of the model during animation.
bone02 - body bone. The main body bone.
bone03 - prop bone.
bone04 - gun bone.

Title: Re: moving model positions
Post by: Kva3imoda on April 18, 2017, 04:26:01 pm
Also, I can make a "shoulder monster" for you instead of ezro_brute. To attach bots and other units.
Title: Re: moving model positions
Post by: TwinkleToes on April 18, 2017, 08:38:49 pm
woohoo thanks kva :D
and yea, would love a shoulder monster.
Title: Re: moving model positions
Post by: Kva3imoda on April 18, 2017, 08:58:04 pm
and yea, would love a shoulder monster.
"Shoulder" Base Monster: https://yadi.sk/d/8cIdT6bA3H7pZa

Description and parameters vs standard human size:
(http://i.imgur.com/sy8YlRY.png)

You can change parameters yourself, if you need. It is not difficult. I added hand-tags, maybe this will be needed in the future. Hand bones and Tags have an angle of 90 degrees.

This monster is invisible and have 1 polygon and 7 bones.
Title: Re: moving model positions
Post by: TwinkleToes on April 18, 2017, 09:13:04 pm
o wow, thanks, your a legend kva XD
the ability to tweak it, is something i didn't expect.
very much appreciated.
Title: Re: moving model positions
Post by: Kva3imoda on April 27, 2017, 02:52:33 pm
Hey Twinkle. Does the model work as it should? It's interesting to see this in action.  :)
Title: Re: moving model positions
Post by: TwinkleToes on April 29, 2017, 02:29:19 am
worked out really well :D
i used the hit animation and turned it into an attack animation and it looks cool

im currently trying to solve a problem with the class atm, so ive put it on hold.