Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Semitransparent objects

A topic by qwer7000 created Apr 21, 2021 Views: 212 Replies: 2
Viewing posts 1 to 3
(1 edit)

Hi. I'm trying to add semitransparent glasses for my character, but have a few difficulties with this. 
These commands can make the target effect, but they require an object. And this is the only function i found that could get it.

object GetCharacterModel(ref character)
{
object model;
SendMessage(character, "le", MSG_CHARACTER_GETMODEL, &model);
return model;
}
object persRef = GetCharacterModel(pchar);
SendMessage(persRef, "ls", MSG_MODEL_SET_TECHNIQUE, "DLightMark");

Problem is, this makes my whole character semitransparent, because this function will only target everything on the character model, not the specific part. And I found no way to get objects of equipped items, like gun or blade.

Can you make a method, that will give us an option to target a specific part, instead of whole object? I can make my lenses a separate model and connect them with TOOL. Is it possible to send in the message name or number of this part and use the effect only on this area?  

Or maybe you know any other way how to  do it? I tried to make glasses as a questmark at first, but they just din't show up.

(+1)

Based on the original design, this will require some work to both retain the current function and not require script changes for the original mods, but also add some flexibility to achieve what you want.

The shading effects are hardcoded for the guns/blades.  They are also hardcoded for the character.  As you found, you can override the effect name for a model if you obtain the whole model object in the scripts and send that message, but of course it only provides the entire character model.  So you cannot add the lenses as a part of the character model; it will need to remain separate, so that you can pass an effect name for just that piece.  But how to "attach" them in the correct position of the character model?

We did add a way to add a hat, or piece of headgear to a character, and a way to adjust the position relative to an existing "locator" defined on the character.  All the characters have a "camera" locator for the eye position, so we added a way to adjust the hat position, relative to the camera locator, by reading an x, y, z adjustment.  Since this adjustment might be slightly different for each character model, we had to devise a way to read the character model, read the x,y,z adjustments for that specific model, then move the hat to its desired location.  Means we have to manually check each character (which we have not yet done...only some of them), but it's a start...

Anyway, there is also already a way to "tie" random items to a specific locator to a character as well, which is why the characters in taverns can hold food/drink.  Those items also adhere to the 2 hardcoded effect options in the engine (they are EnvAmmoShader and AnimationBlend if you're curious, and they are chosen whether the highest bits are part of the alpha value supplied by a "render tuner" in the engine).  What I'm thinking is that we can add another "tie" feature that is similar, but "extended" in that you can also adjust the position like we provided for hats, but also provide a specific effect name if you want also.  This way you could also specify the "camera" locator for your lenses, but every character model would need that x,y,z reposition in a file (see ERAS RESOURCE\INI\pscriptsRESOURCE\INI\pscripts\HeadGear.ini file for the hat example), then also specify the effect name you want to use for that item.

I have no timeline I can give you for this, because I am fulltime employed at a job and can only devote part time to this, but I'll add it to a list of features to add.

(4 edits)

Thanks for the reply. This is really a great feature, I already tried it. 

It seems that the new model overrides the previous one. I don't want to overload you, but when you find time for this, is it possible to also add a few more slots there, so I could connect hat, frame for glasses and lenses together to the same locator, instead of merging them with character model? it's just that right now I have to create a lot of almost identical models and change them in the scripts just to make this equip/unequip feature possible. Also, it would be great if we could set not only position, but rotation for this tied object. I don't insist, if this is something difficult to do.