Jump to content
The Dark Mod Forums

Applying Af Attachments


Springheel

Recommended Posts

Hooray!! How many such 'joints' or locations are there, is there a list?

 

Ish, how hard would pickpocketing be to get working? A big complex new system, or a simple frob of a breakable bind?

 

I remember for TDS there were quite a few and it was quite useful. In my old mission, I had some of the zombies with eyeballs, some with one, and some without any at all. And some of them wore jewelry you could lift from them, rings, bracelets, and necklaces. :( Nothing much more creepy than pulling the necklace off a walking (or resting) zombie.

 

*sniff*

Link to comment
Share on other sites

  • Replies 91
  • Created
  • Last Reply

Top Posters In This Topic

There are no shortage of of joints right now, it just takes some time to position objects correctly, since you have to manually adjust the origin coordinates and then load the game up to see the effect. It took me about 45 minutes to position the belt pouch properly.

 

I've got him carrying a torch as well, though it doesn't look quite as good since his hand isn't really grasping it.

 

When you do create one by adding a light to a torch and binding it, it seems like it does it at exactly the location you place it in the map, so that's somewhat convenient.

 

When you're binding a model to an AI you don't do it at the map level though (at least not how I did it). I've created the following def for a prop_torch.

 

entityDef prop_torch {

"inherit" "func_static"

"model" "models/darkmod/props/lights/extinguishable/torch.lwo"

"joint" "LeftHand"

"origin" "5 5 -1"

"angles" "0 0 0"

"remove" "1"

}

 

All I'm doing in the def file is pointing to the torch model. So how would I attach a light/particle effect in that case? I assume it has to be added to the def file as well, but I'm not sure how to do that.

Link to comment
Share on other sites

No, you can't frob it yet. I don't know what would be involved with that--as far as I know there's no system for removing attachments from an AI until they die.

Link to comment
Share on other sites

Since you can attach any entity, simply make that attachment into a loot object (inherit atdm:loot_purse_belt in the attachment def), then you should be able to frob it off the guard with no problem.

 

I think internally, when loot is frobbed, it's hidden rather than destroyed, so we shouldn't have any problems with stale pointers to destroyed attached objects or anything in the code, it would just hide the belt pouch once you took it.

Link to comment
Share on other sites

Well, that's rather cool. :) My very first pick-pocketing experience in TDM. :)

 

Works like a charm, although it illustrates how the frob distance is too far--I can steal the purse from a very safe distance behind him.

 

One last thing, and then I'll put this up on CVS. Right now, I've had to add a line to the mansion_guard's def file to add the purse. But I don't think we want every guard to have one, and it would certainly get messy if we had to have separate ai entities for every possible combination of object they're carrying. Can the "def_attach" line be added to AI on an individual basis in the map (and if so how)?

Link to comment
Share on other sites

Works like a charm, although it illustrates how the frob distance is too far--I can steal the purse from a very safe distance behind him.

 

Shouldn't be a problem. :) Frob distance can be adjusted on an individual basis...so we can make pick-pocketing a much tighter experience.

 

The default is something like 120 or 140, pretty much what it was in T1 and 2...but you should be albe to set the distance to 60 for pick-pocketing. I can't remember where to do it, so perhaps spar will chime in.

Link to comment
Share on other sites

Just set "frob_distance" on the entitydef for the frobable item. Probably the best place to put it would be in the most "base" def of the belt purse in /def/tdm_loot.def. I'm going to document all the frobbing stuff in a minute... stay tuned in documentation forum.

Link to comment
Share on other sites

Well, yes and no. The system does support multiple attachments, so the mapper can add as many as they want and call them def_attach_<whatever>. However, that's just a name, it won't determine a joint or anyything. Due to how Id's system works, we'll have to make entityDefs for each attachment, because that's where it's stored what joint they attach to, what orientation they should have and what offset they should have.

 

So right now you can't just put in a joint to attach to and an entity to attach in the AI spawnArgs, you have to make a separate entityDef that contains the thing to attach (via the "inherit" keyword) and the attachment information (joint, origin, angles). Maybe we'll change that system later because it is a bit inconvenient, I don't know.

 

Btw, people were asking how to set the frob distance lower for a specific item, so you have to be closer to pickpocket. This documentation thread should cover that (and everything else about frobbing):

 

http://forums.thedarkmod.com/index.php?showtopic=4205

Link to comment
Share on other sites

So if I understand right, we can attach things, e.g., a necklace on a neck, but first someone will have to define that spot. That's cool. Not sure if I understand this though:

 

a separate entityDef that contains the thing to attach (via the "inherit" keyword)

Doom3 needs to know what the item will be? Not very flexible. So we can't say, define a general attach point as def_attach_neck, and set up angles and everything, for which someone can attach a necklace in the editor, or someone else can attach a clock? (yo yo yo style) That won't work?

 

If it's just a matter of people defining the positions though, then great, it's basically build-as-needed.

Link to comment
Share on other sites

Doom3 needs to know what the item will be? Not very flexible. So we can't say, define a general attach point as def_attach_neck, and set up angles and everything, for which someone can attach a necklace in the editor, or someone else can attach a clock? (yo yo yo style) That won't work?

 

That's correct in the current system. If you wanted to attach something else to the same spot you found when attaching some item, you'd have to create a new def for it with the new item inherited and then copy & paste the origin and angles you found for the first thing.

Link to comment
Share on other sites

Put the sword in the hand :)

 

Also, even though it takes time to get the position right first time - after that, you would keep the offset variables that you discovered, and use them for all objects of a simlar size. Now that you've got a pouch in the right place, you could put a key there. Or reverse one of the coordinates to put it on the other hip instead.

 

But if the time is still an issue, perhapse one of the programmers could make the ability to adjust the offset values of a bound object during the game, and a command to display the current offset coordinates in the console. So after you posotion it, print the coordinates, write them down, and THEN edit the .def file to make it permanent.

Link to comment
Share on other sites

Well, theoretically anyone with a modeling or maybe animating app could visually select a poin that would be good for placing an attachment, then read off the relavant coordinates in the app, so that should save on the time of figuring out the offset by trial & error. Although sometimes model/anim coordinates get rotated in some way by D3 when it imports them.

 

@Dave: I just thought of something though, which might explain some method to Id's madness: The offset is a translation applied to the object's origin after putting it in. If you just put it in, it would set it up so that (0,0,0) on the object is the same as the coordinate of the joint you're attaching to, plus the offset. However, different models have different origins. To do something like you're talking about with re-using the same attachment joints and offsets, the models would have to be modeled with their origins in the same place relative to where they should be attached.

Link to comment
Share on other sites

Well, theoretically anyone with a modeling or maybe animating app could visually select a poin that would be good for placing an attachment, then read off the relavant coordinates in the app, so that should save on the time of figuring out the offset by trial & error. Although sometimes model/anim coordinates get rotated in some way by D3 when it imports them.

ARent' the unit measurements different though? Doom units?

Link to comment
Share on other sites

It does take some time to get everything sorted out, but once you've done it for an object, it doesn't need to be done again (well, actually it might have to be done slightly differently for different AI, actually, depending on how different they are).

 

There's not really any restrictions that I can see, so it's flexible...just time consuming at the beginning. :)

 

@Dram: I'll get keys working and shorten the frob distance, then I'll upload today.

 

@Dom: Putting the sword into the hand doesn't look like it will be that hard--I've already done a torch. But that might look a little strange right now while they still have a sword as part of the model.

Link to comment
Share on other sites

It does take some time to get everything sorted out, but once you've done it for an object, it doesn't need to be done again (well, actually it might have to be done slightly differently for different AI, actually, depending on how different they are).

 

There's not really any restrictions that I can see, so it's flexible...just time consuming at the beginning. :)

 

@Dram: I'll get keys working and shorten the frob distance, then I'll upload today.

 

@Dom: Putting the sword into the hand doesn't look like it will be that hard--I've already done a torch. But that might look a little strange right now while they still have a sword as part of the model.

 

Thanks Spring :)

 

As for the sword, just make a skin and texture it nodraw.

Link to comment
Share on other sites

Ok, I've got the purse and keys working (man, it's really annoying trying to get the rotation right!)

 

I don't think I'm going to do any more with it right now, as I'm heading on vacation in a few days, so I'll upload to CVS.

 

One last thing:

 

To attach a torch to a guard, you just open him up in the entity browser and put in key "def_attach" and the name of a torch attachment def.

 

Ok, in the entity browser where it says key, you type this?

 

"def attach" "prop_key"

 

And then what? Do you have to hit 'create' or something?

Link to comment
Share on other sites

I tried that, but it didn't appear to do anything. When I loaded the map the guards had nothing attached.

Link to comment
Share on other sites

"def attach" "prop_key"

 

1. You probably did this, but it needs to be def_attach with an underscore

2. The problem could also be that there's no def for prop_key. Also, whatever def you use has to have "joint" in there to say which joint to attach to. Not sure if you made a def for prop_key already or not.

Link to comment
Share on other sites

Hrm. Make sure you have the guy selected (may sound silly, but it happens), then anything you type in those pair of boxes, and hit enter, should appear. E.g., you could put "ice-cream" and "vanilla" and it would work. If you're doing those things, there must be something else wrong.

Link to comment
Share on other sites

It's possible I forgot the underscore...I'll doublecheck.

 

edit: No, still nothing. It works if it's in the def file, but not the editor.

 

I select the guard, type the bit below, and hit enter. Am I missing something?

 

af3.jpg

 

My next guess would be to try putting "prop_key" in the 'val' line instead?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...