Somewhat big project

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
RedDynasty
Thug
Posts: 27
Joined: Thu Jun 21, 2012 9:55 pm
Location: Portugal( yes there are portuguese people in dx)

Somewhat big project

Post by RedDynasty »

I dont know how the DX community is busy around this part but i need some help for this project.
Basicly its Team Fortress 2 hats (and possibly weapons) into DX.
Dont believe me? http://www.gravity-world.com/download/file.php?id=2826 (http://wiki.teamfortress.com/wiki/Prince_Tavish's_Crown)
And i also got 2 other hats, but right now they are only silly decos.
What i simply want is make them items and when used, it simply creates and places the model of the hat in the head( the more complex part is to code something that makes it detect what model the player has and get the right head reference)
I am begging for some help on this one [-o<
Image
Your not a gamer until you played this.

Cant....stop...listening...to.... RedSun......Menu music.
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Somewhat big project

Post by G-Flex »

I'm not sure what you mean by "head reference", but at any rate, I'd do something like this:

Make the hat a DeusExPickup of some sort, and upon activation, unhide it and set it to appear on the player's head by putting some code in its Tick() function that correctly sets its location every frame (possibly using BaseEyeHeight?).
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Somewhat big project

Post by DDL »

Yeah, you'd need to laboriously establish the desired position for a hat to be, in every frame of a meshes' animation, and hardcode that.

Which would be an arse, because DX meshes move their heads around a fair amount, and unless you got it really detailed, it would still probably look ugly.

Plus the updating of "hat location" would presumably be subject to serverside/clientside disagreements, so you might have weird occurences like hats and hat-wearers being out of synch.
User avatar
RedDynasty
Thug
Posts: 27
Joined: Thu Jun 21, 2012 9:55 pm
Location: Portugal( yes there are portuguese people in dx)

Re: Somewhat big project

Post by RedDynasty »

When i said head reference i meant that not all models have the same height, meaning that the hat needs to know what model the player has and once activated get the right coords to place on the head.
I asked this because i cant code for shit anymore, i was hopeing that atleast 1 coder around here (that isnt particulary busy) could help me out with this (if you need the models just ask me).
Image
Your not a gamer until you played this.

Cant....stop...listening...to.... RedSun......Menu music.
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Somewhat big project

Post by DDL »

Right, but the problem is that the head isn't static. Getting the height of the head is easy (there's even a variable for that) but getting the X,Y position of the head within the collision cylinder is not easy. And not coded, either.

Remember, actors of this unreal-engine era are stored as collision cylinders: as far as the game is concerned, a man running around is simply "a cylinder this tall and with this radius": the game neither knows nor cares where the mesh currently has its head, arms, legs, or indeed whether the mesh even HAS those things. You could replace the mesh of UNATCO troopers with that of the small crate, and other than some complaints about "CANNOT FIND ANIMATION", the game would not care one bit. There is no code in place to determine where a pawn's head is, other than "it's this high above the centre of the cylinder".

So, for instance, a pawn at rest has his head pretty much centred within the cylinder. You could spawn your hat at location+baseeyeheight*vect(0,0,1.05) or something to put it just above his eyeline.

However, the pawn now starts running forward. The MESH shows his head move to the front of the cylinder, since the whole body animation is more "leaning forwardy" because..he's running. Your hat will now still faithfully be at location+baseeyeheight*vect(0,0,1.05), so just above his eyeline, in the centre of the cylinder, sort of falling off the back of his head.

Now he gets shot, and his head recoils in the "hitfront" animation. The hat remains fixed in place as his head moves through it.



So what we're saying is you'd have to sit and flip through each individual animation sequence for a given mesh, work out the coordinates for a hat to be in those sequences, and then hardcode those numbers into the game so that it constantly checks for current animation and adjusts the hat position accordingly. It would be a stupid amount of very, very tedious work.
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Somewhat big project

Post by G-Flex »

Obviously, the solution is to implement angelic halos instead.
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: Somewhat big project

Post by DDL »

Hahhahah that's exactly what I was thinking.

"What is the laziest way of implementing some sort of hat system..."
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Somewhat big project

Post by G-Flex »

The GM_Suit character model (which is used for the chef class, as well as businessmen, MIBs, and some others) does have a weird cylindrical thing on top of the head, which is perfect for adding a hat texture, actually. Just make every single character in the game use that instead!
User avatar
RedDynasty
Thug
Posts: 27
Joined: Thu Jun 21, 2012 9:55 pm
Location: Portugal( yes there are portuguese people in dx)

Re: Somewhat big project

Post by RedDynasty »

Well doing all that crap for every single animation is indeed a ton of work, so forget that lets just put the hat in the head and call Destroy() when the pawn dies.
But like i said, i havent coded in ages, i wouldnt be able to do this crap.
Image
Your not a gamer until you played this.

Cant....stop...listening...to.... RedSun......Menu music.
G-Flex
Silhouette
Posts: 621
Joined: Mon Jul 11, 2011 10:16 pm

Re: Somewhat big project

Post by G-Flex »

It would still look absolutely atrocious when the pawn... well, does anything, as DDL said.
Post Reply