Author Topic: Another Material Question  (Read 466 times)

0 Members and 1 Guest are viewing this topic.

Phrozo

  • Mr. Phrozo
  • Jr. Member
  • **
  • Posts: 89
  • Karma: +15/-1
  • :3
    • View Profile
    • Mod Page
Re: Another Material Question
« Reply #30 on: September 04, 2017, 12:48:59 PM »
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.
Code: [Select]
"scriptobject" "lookAt"

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

spamclark15

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Another Material Question
« Reply #31 on: September 04, 2017, 01:05:04 PM »
Changed 3 entityDefs in moveable.def to:

Code: [Select]
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:

Code: [Select]
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

  • Mr. Phrozo
  • Jr. Member
  • **
  • Posts: 89
  • Karma: +15/-1
  • :3
    • View Profile
    • Mod Page
Re: Another Material Question
« Reply #32 on: September 04, 2017, 01:14:39 PM »
I miss read your object name. It isn't 'lookAt' it's 'lookAT' so change it and try again.

spamclark15

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Another Material Question
« Reply #33 on: September 04, 2017, 07:06:21 PM »
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.
« Last Edit: September 04, 2017, 07:10:13 PM by spamclark15 »

Phrozo

  • Mr. Phrozo
  • Jr. Member
  • **
  • Posts: 89
  • Karma: +15/-1
  • :3
    • View Profile
    • Mod Page
Re: Another Material Question
« Reply #34 on: September 04, 2017, 10:44:22 PM »
What exactly is the desired effect you want?

spamclark15

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Another Material Question
« Reply #35 on: September 04, 2017, 10:59:08 PM »
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

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Another Material Question
« Reply #36 on: September 04, 2017, 11:04:35 PM »
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

  • Mr. Phrozo
  • Jr. Member
  • **
  • Posts: 89
  • Karma: +15/-1
  • :3
    • View Profile
    • Mod Page
Re: Another Material Question
« Reply #37 on: September 05, 2017, 06:41:52 AM »
Just for clarity.
Code: [Select]
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

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Another Material Question
« Reply #38 on: September 05, 2017, 03:19:23 PM »
Yes, that is what I had for the material. It is always fully bright.

spamclark15

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Another Material Question
« Reply #39 on: September 12, 2017, 09:09:32 AM »
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

  • Mr. Phrozo
  • Jr. Member
  • **
  • Posts: 89
  • Karma: +15/-1
  • :3
    • View Profile
    • Mod Page
Re: Another Material Question
« Reply #40 on: September 13, 2017, 02:31:53 AM »
The color is hard set in the material being used for the weapon gui lights, which is 'lights/viewWeaponGuiLight' found in lights.mtr.

spamclark15

  • id Enthusiast
  • Jr. Member
  • **
  • Posts: 97
  • Karma: +10/-3
  • A missile-launching skyscraper with goat legs.
    • View Profile
Re: Another Material Question
« Reply #41 on: September 13, 2017, 09:12:39 AM »
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:

Code: [Select]
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.