News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Another Material Question

Started by spamclark15, August 14, 2017, 11:27:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phrozo

Okay good, you included your scripts. Now just edit each tablecart entityDef you mentioned in moveable.def to include a new line with this code somewhere among all the other key/value strings.
"scriptobject" "lookAt"

Launch the game and look at a table cart in game and see if you notice anything.

spamclark15

Changed 3 entityDefs in moveable.def to:

entityDef moveable_compcart {
"inherit" "moveable_base_fixed"
"model" "models/mapobjects/lab/compcart/compcart.lwo"
"density" "0.02"
"friction" "0.2"
"bouncyness" "0.2"
"snd_bounce" "cart_impact"
"scriptobject" "lookAt"
}

entityDef moveable_tablecart1 {
"inherit" "moveable_base_fixed"
"model" "models/mapobjects/lab/tablecart1/tablecart1.lwo"
"density" "0.01"
"friction" "0.1"
"bouncyness" "0.3"
"snd_bounce" "cart_impact"
"scriptobject" "lookAt"
}

entityDef moveable_tablecart2 {
"inherit" "moveable_base_fixed"
"model" "models/mapobjects/lab/tablecart2/tablecart2.lwo"
"density" "0.01"
"friction" "0.1"
"bouncyness" "0.3"
"snd_bounce" "cart_impact"
"scriptobject" "lookAt"
}


Trying to load a map with one of these results in:

WARNING: idScriptObject::SetType: Can't create object of type 'lookAt'.  Must
be an object type.
--------- Game Map Shutdown ----------
--------------------------------------
********************
ERROR: Script object 'lookAt' not found on entity 'moveable_tablecart2_6'.
********************

Phrozo

I miss read your object name. It isn't 'lookAt' it's 'lookAT' so change it and try again.

spamclark15

#33
Alright, I tried it out and the entire carts turn to face me. :o I need to find the 1ball entity but all I can find are the material and skin.

Phrozo

What exactly is the desired effect you want?

spamclark15

For the wheels to have this behavior as they're flat. The problem is that using deform sprite on their material turns them completely black. This can be prevented by changing the material to just a single texture, but then they appear fullbright.

spamclark15

What I thought would work is if the latter appear fullbright but are otherwise functional, to find some way of writing the material for the wheels so that they show up at the right brightness but I haven't thought of any way of doing this without adding another texture which would cause them to appear black. It's like I'm trading problems.

Phrozo

Just for clarity.
models/mapobjects/tablecart1ball
{
deform sprite
{
blend blend
map models/mapobjects/lab/labcart_wheel/poppawheely_d.tga
}
}


Not all blend modes interact with light, such as blend, add, or filter. Blend mode blend is often used for opaque particles like dust or smoke and is rendered based on how strong the alpha parameter is.

Looking through the source code deform sprite doesn't appear to work correctly with light interaction so stages like normalmap, diffusemap, and specularmap may not work at all with deform, but I can't say for certain.

spamclark15

Yes, that is what I had for the material. It is always fully bright.

spamclark15

Would you happen to know where the light color from the GUI on a viewweapon is set? The .gui files for the weapons that have GUIs apparently don't set it.

Phrozo

The color is hard set in the material being used for the weapon gui lights, which is 'lights/viewWeaponGuiLight' found in lights.mtr.

spamclark15

Thanks! Also dealing with materials, I'm trying to rewrite the gui/hell/stamina material to scroll only a single TGA but getting it to do 3 things simultaneously, that is, scroll, have translucency, and exist within the box for stamina is proving to be difficult. Currently I have it written:

gui/hell/stamina
{
{
blend blend
map guis/assets/hud/mp/lstafill2.tga
// colored
}

{
maskcolor
map guis/assets/hud/mp/lstafill2.tga
scroll time * -1, 0
// colored
}


This reuses the top part of the original code where lstafill2.tga has an alpha channel the shape of the stamina bar. Since I don't want all the effects that the original material had which combined more than one image together, this has been a challenging material to figure out so I'm sort of lost at this point.