Jump to content


Photo

messed up my development environment with 'save selected as collision model'


  • Please log in to reply
4 replies to this topic

#1 dmw88

dmw88

    Member

  • Member
  • PipPip
  • 83 posts

Posted 26 January 2019 - 09:41 PM

I was trying to export a collision model to make a frobbable brush and I clicked 'save selected as collision model'.  The 'select model' menu popped up with the last entity I had placed, a crate, highlighted.  I x'd out.  Now whenever I try to place any entity it's placing a crate with it.  1. how do I un-taff my collision models and 2. how do I actually make a brush into a frobbable object?  Meaning, how do I actually export a collision model?  Also, I know I have to assign the 'custom grabbable' entity, but do I place that entity and then set something in the spawnargs to refer to the brush I want movable and the collision model?

Thanks as always for the help.  Coming really close to having a map that is fully playable and getting pretty excited, so it's heartbreaking to get stuck like this in a way that I can't continue for now!



#2 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1933 posts

Posted 28 January 2019 - 02:02 PM

you should check first that the item you want to use is available by right clicking on one of the xyz views, select create model, try to find your item, if not found click on cancel and use reload models in file tab and look for it again, if not found then the item was not saved in the models directory, move it there, or if directory don't exist in your darkmod install, create directory models in the same directory as where all the pk4 files are. if item found then you can do the following.

 

so i dont screw anything up I always move what am making a collision box for to the editors xyz origin and place the base of the item on the xyz origin so I can move the collision box origin onto that origin.

 

create a box around your object textured with the collision texture, or select the collision texture and use that to make a box around the item, convert collision box to a func_static, press v to move the origin of the collision textured box to the bottom of the box(this is where it would rest if dropped on the ground), press esc twice so nothing else is selected, select collision box, save selected as a collision model, select the model you want to add the collision box to in the model selection screen, click on ok to select it or cancel to not select it.

 

to un-taff what you done find the collision box you made (<what ever its named>.cm) and delete it. will be in the model directory with the same name as the model you selected if you did not select one it might have been save as cm

 

to make a useable item there are three types. to use place the one you want in your world, eg atdm:moveable_custom_item

change name to something like what it is - name : bunch of grapes

change inv_icon path to a tga image or dds image - inv_icon : guis/assets/hud/inventory_icons/bunchofgrapes

change model path to path of your model with the collision box ase/lwo - model models/darkmod/bunchofgrapes.ase

if you can't find your model, just use the reload models option in file

the collision box is auto loaded with the model

 

if its the one that doesn't go in your inventory then you dont need to set the inv_icon path

it still needs a unique name so objectives and scripts can access the item when they need to



#3 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 248 posts

Posted 31 January 2019 - 02:37 PM

you should check first that the item you want to use is available by right clicking on one of the xyz views, select create model, try to find your item, if not found click on cancel and use reload models in file tab and look for it again, if not found then the item was not saved in the models directory, move it there, or if directory don't exist in your darkmod install, create directory models in the same directory as where all the pk4 files are. if item found then you can do the following.

 

so i dont screw anything up I always move what am making a collision box for to the editors xyz origin and place the base of the item on the xyz origin so I can move the collision box origin onto that origin.

 

create a box around your object textured with the collision texture, or select the collision texture and use that to make a box around the item, convert collision box to a func_static, press v to move the origin of the collision textured box to the bottom of the box(this is where it would rest if dropped on the ground), press esc twice so nothing else is selected, select collision box, save selected as a collision model, select the model you want to add the collision box to in the model selection screen, click on ok to select it or cancel to not select it.

 

to un-taff what you done find the collision box you made (<what ever its named>.cm) and delete it. will be in the model directory with the same name as the model you selected if you did not select one it might have been save as cm

 

to make a useable item there are three types. to use place the one you want in your world, eg atdm:moveable_custom_item

change name to something like what it is - name : bunch of grapes

change inv_icon path to a tga image or dds image - inv_icon : guis/assets/hud/inventory_icons/bunchofgrapes

change model path to path of your model with the collision box ase/lwo - model models/darkmod/bunchofgrapes.ase

if you can't find your model, just use the reload models option in file

the collision box is auto loaded with the model

 

if its the one that doesn't go in your inventory then you dont need to set the inv_icon path

it still needs a unique name so objectives and scripts can access the item when they need to

 

I already tried several approaches in the past (thanks @VanishedOne & ERH+), but I can't create such a moveable item even as per you description above.

 

:(

 

1. Created a "brush model" --> Converted to func static --> Used save selection as xxx.lwo under the models folder of my WIP ---> model shows up there

2. Created model xxx.low and changed location to the coordinates 0 0 0

3. Created collision model over xxx.low at coordinates 0 0 0 ---> converted to func static

4. Saved collision model model for xxx..lwo --> the collision model shows up in the models folder

5. Deleted model and cm model

6. Created entity atdm:moveable_custom_item and selected xxx.low --> xxx model shows up

7. Added properties grabable/frobable 1

8. Ingame: cannot frob or grab the item in question 

 

I don't get it. :( .


Edited by JackFarmer, 31 January 2019 - 02:38 PM.


#4 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37752 posts

Posted 31 January 2019 - 07:36 PM

You can add a cm from a separate model with a spawnarg in the entity. If you look at some existing movable entities, especially bowls or anything concave, you should find an example. If you pick one used by a model of similar size to yours, it should work.

 

edit:  Here's an example of the line you need to add to the movable entity:

 

    "clipmodel"            "models/darkmod/misc/clipmodels/jug_clay_cm.lwo"

 

You could also probably use DR to make your own brush clipmodel, save it as a .lwo, and then add the above line pointing to the model you just saved.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#5 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 821 posts

Posted 01 February 2019 - 08:46 AM

Is this about creating collisions models for dynamic objects in DR? If so what Springheel said is what I would recommend also. If is not for dynamic objects then is just a matter of creating a brush hull around your object and assign the collision material to it.

 

Btw if you are creating the models in blender you can export the collision model directly from blender, just create a collision mesh (with less than 16 polys, this is important) around your object, assign it the collision material and export your model, there's no need to put the collision model in a different layer, it can belong to the visible mesh layer, the engine will detect automatically the collision geometry by the material.  






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users