Aller au contenu

Photo

[Success] Need help with turning models into placeables


  • Veuillez vous connecter pour répondre
13 réponses à ce sujet

#1
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
I just updated the Gay Bars of Ferelden module files and am hoping
someone can help me with making placeables out of models. Every time I try to do it the placeables appear in the area editor and the game, but they are not clickable.

The module is still a work in progress. You can find them on my project page:

http://social.biowar...ct/517/#details

I am posting a copy of my 2da
file so you can see what I did. They show up as clickable in their
properties, so I don't know what the problem is. I have posted the builder to builder file as well.


Thanks!

Modifié par PavelNovotny, 08 décembre 2009 - 04:17 .


#2
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
The stone well in the Crossroads level is an example of a model turned into a placeable that can't be clicked on.

#3
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
I did some more investigating, and here are some differences I have found between placeable files and prop/model files using the same item. It looks like the mao files are different. Here's the mao for the covered wagon prop/model (prp_wagoncover_01_0)

?xml version="1.0" encoding="UTF-8" standalone="yes"?>
!-- Exported by Material Editor -->
    Material Name="static.mat">
    DefaultSemantic Name="Default">
    Texture Name="mml_tLightmap" ResName="LM.dds" RequiresID="true">
    Texture Name="mml_tDiffuse" ResName="p_wagon_covered_01d.dds">
    Texture Name="mml_tNormalMap" ResName="p_wagon_covered_01n.dds">
    Texture Name="mml_tSpecularMask" ResName="p_wagon_covered_01s.dds">
    SoundType Name="mml_iSoundMaterialType" value="0">
/MaterialObject>

And here's the mao for the placeable version of the same item (plc_wagoncover_01_0)

?xml version="1.0" encoding="UTF-8" standalone="yes"?>
!-- Exported by Material Editor -->
    Material Name="Prop.mat">
    DefaultSemantic Name="Default">
    Texture Name="mml_tDiffuse" ResName="p_wagon_covered_01d.dds">
    Texture Name="mml_tNormalMap" ResName="p_wagon_covered_01n.dds">
    Texture Name="mml_tSpecularMask" ResName="p_wagon_covered_01s.dds">
    Texture Name="mml_tTintMask" ResName="p_wagon_covered_01t.dds">
/MaterialObject>

There seem to be 3 main differences:
  • prp files use static.mat while plc files use prop.mat (I checked a few more to make sure that it wasn't unique to this one model or placeable)
  • The prp files get a tLightmap line but no tTintMask line
  • The plc files get a tTintMask line but no tLightmap.


I remember something about lightmaps not applying to placeables, and that's why placeables and props look different when placed next to each other in the same room even when they are using the same mesh. I'm wondering if that's what the TintMask and Lightmap difference is.

So, the question I have for the forum is how do I generate a tTintMask or tLightmap? Do the meshes already have both? I would think so since both prp and plc use the same mesh.

Any ideas?

Modifié par PavelNovotny, 06 décembre 2009 - 04:34 .


#4
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
The mesh has neither. Those are textures required by the material (static.mat or prop.mat). The lightmap texture is the same for every material which uses static.mat btw, its LM.dds. It is not in the textures.erf and I haven't been able to find it.

#5
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
The weird thing is I can get the models to show up as placeables through editing the 2da, and they show the arrow and the name and everything. Once I put them down though you cannot click on them in either the Area Editor or the game.



I can even get them to show up if I change all the file names from prp to plc (mao, msh, phy, etc.). The same thing happens - you can't click on them directly in the area editor or the game. In the Area Editor I can select them by dragging over the item - just can't click on it even though Interact is set to True in the properties.



This is very annoying. :-P


#6
Looy

Looy
  • Members
  • 388 messages
Are you sure your doing it right? I.E Creating the placeable through New > Placeable? You make it sound like your doing something more complicated.

#7
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
By default, New Placeable only lets you create placeables that are listed in the placeables 2da file. Each placeable has a type (container, furniture, etc.) that you define in that file. Placeables can be interacted with in the game while models cannot. Placeables are used in the Area Editor while models are used in the Level Editor.



If you want a custom placeable that does not come with the default 2da (like you want to use a woodpile as a container) you have to add it to the 2da and then it will show up in the New Placeable list in the toolset.



All that is fine, the problem is that when I create a custom placeable I cannot click directly on it in either the Area Editor or the game. There is a property called Interact that is supposed to control whether or not you can click on it, but it shouldn't effect that behavior in the Area Editor.

#8
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
Here's what I've tried so far and still cannot get the new placeables to be clickable in the Area Editor or the game:



In both of these instances I created the appropriate GDA file (placeable_types_00pav.GDA) and put it in the overide folder. I know the 2da part is correct because:



1. If I create a new placeable based on an existing placeable (for example, the small desk is currently listed as a flip type, and I added a new container type small desk) it works fine.



2. If I change the ModelName field in my gda so that it is an existing placeable instead of my custom placeable it will work fine (it just shows the wrong item).



So, the 2da part and the properties are all fine. The problem seems to be with what I'm putting in the ModelName field.



1. If I use an existing model without changing the name, for example prp_stnwell_0 (the stone well) then I will get a placeable stone well, but I will not be able to click on it in the Area Editor (once I've placed it) or in the game.



2. If I edit the file names (mmh, phy, mao) using the GFF Editor from prp_stnwell_0 to plc_stnwell_0 and change the names referenced by those files so they all match, I get the same results as in #1 above. Note that in this case I also edited the mao file so that it referenced Prop.mat instead of static.mat as found in all the other placeable mao files.



I know the original campaign has a stone well placeable that you can click on (it's either a container or a puzzle type - I think it's puzzle because it generates a dialog) because there is one in the Denerim market square by the chantry. What am I missing?



Anyone have any ideas?

#9
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
OK, I looked through the MMH and PHY files for both placeables and props/models and found a few differences. The PHY files are almost exactly the same, but one difference I noticed is in a field called MMH_NODE_COLLISION_OBJ_TYPE. Placeables have a value of 1 in this field while props/models have a value of 2.



Does anyone know what MMH_NODE_COLLISION_OBJ_TYPE does? Is this the one that controls whether you can click on it or not?

#10
ChewyGumball

ChewyGumball
  • Members
  • 282 messages
I believe that is the type of shape of the collision object. A box is 2 I think. I doubt it has anything to do with whether its clickable or not

#11
Craig Graff

Craig Graff
  • Members
  • 608 messages
For a hint, compare the prop version of a collision object in a file.mmh.xml to the placeable version:
CollisionObject Static="true"
CollisionObject Kinematic="true"

Notice a difference?

Modifié par Craig Graff, 07 décembre 2009 - 09:29 .


#12
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
I don't see those anywhere in the mmh or the phy. For example, they're not in plc_bedcnpy_01_0 or prp_bedcnpy_01_0. I do see this in the phy



MMH_SHAPE_COLLISION_MASK_PLACEABLES



it's 1 in the plc and 0 in the prp. Does that have anything to do with clicking?




#13
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
OMG IT WORKED!



Changed MMH_SHAPE_COLLISION_MASK_PLACEABLES to a 1 in the phy file for the custom plc and now I can click on the placeable in the area editor. I'll check and see if it works in game.

#14
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
Worked in game too - the stone well even behaved as the correct type of placeable (container in this case). Hurray!