Jump to content
The Dark Mod Forums

Changing a texture in a func_static based desklamp.


Bikerdude

Recommended Posts

  • Replies 70
  • Created
  • Last Reply

Top Posters In This Topic

Hmm, Yeah I don't think I added a light to it unless that is a mistake I missed. I think I did change the light position maybe (I dunno, there were tons of lights...)

 

But most likely the two lights thing is the issue. Sounds like it just doesn't need a light attach....

-----------

I think the candles map is probably from when Springheel was tweaking candles quite awhile back, don't think I've even looked at it. I didn't change any of them other than the shadows on/off thing, and a couple additional attachments (like sconces)...

 

---

looking forward to messing with the links thing. mainly it would just be nice to have it ready and tested before 1.08 (with enough time to make additional entities). So no major rush.

---

 

I see we have a smaller desklamp, similar in size to my lamp, BC are you making a model with the same textures I used in mine with a few variations..?

 

It's about the same size I think.

 

I'm just going to export yours and 'clean it' a bit (better uv's on top mainly - DR just pinches patches around the top like that) and was planning on turning the glass into a projected texture so it has that too.

 

I can look into adding some skins.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Hmm, Yeah I don't think I added a light to it unless that is a mistake I missed. I think I did change the light position maybe (I dunno, there were tons of lights...)

 

But most likely the two lights thing is the issue. Sounds like it just doesn't need a light attach....

 

Yeah, I'll toy around with it. Still think it needs the attached light, but it is probably just using the wrong base class (a base class which is itself a light, not a light holder). Since the base class (The "Inherited" line) changed, I think this might be actually the culprit :)

 

I think the candles map is probably from when Springheel was tweaking candles quite awhile back, don't think I've even looked at it. I didn't change any of them other than the shadows on/off thing, and a couple additional attachments (like sconces)...

 

It might be, but I extended it in major ways and used it as a testbed for all the light entities I was building. Why it is buggy, tho, I have no idea. Something about the geometry?

 

looking forward to messing with the links thing. mainly it would just be nice to have it ready and tested before 1.08 (with enough time to make additional entities). So no major rush.

 

Tracked http://bugs.angua.at/view.php?id=3051 - this is the code bug which causes the endless trigger loop. The code fix is compiling, my hunch is the loop is because the entity that is activating all its entities on the same "bind team" (in this case the mover and the lamp) is also actually in the same team, so it activates itself.

 

This might break things (f.i. I *think* one might have been able to target a mover to itself and let itself being constantly triggered), but I'd rather remove that "feature" as it can also cause lockups (if the thing isn't a binary mover with some movement, the retrigger will happen instantly and the game probablyl locks up with 100% CPU)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I had one point when I cut down my test map just for other stuff, deleted most of the lights. Then I was falling through a wall when backing up to see LOD's. Never did figure that out, it didn't leak, it compiled fine.

 

So yeah, maybe that map is just corrupted.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I'm just going to export yours and 'clean it' a bit (better uv's on top mainly - DR just pinches patches around the top like that) and was planning on turning the glass into a projected texture so it has that too.

 

I can look into adding some skins.

 

Sweet, thanks dude!

Link to comment
Share on other sites

I had one point when I cut down my test map just for other stuff, deleted most of the lights. Then I was falling through a wall when backing up to see LOD's. Never did figure that out, it didn't leak, it compiled fine. So yeah, maybe that map is just corrupted.

 

Oh yeah, I had that too in the zombie sleeper map you could walk through a wall. The only cure after two days of debugging was to make the wall instead of 2 units 8 units thick. No idea what the problem ever was, but after wards it worked....

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Btw, I fixed the "lever attached to lamp and targeting the same lamp".

 

You can see such an entity (with a huge, misplaced lever embedded in it) in the test map test/add_link.map - it needs an SVN update, and maybe a code recompile for windows.

 

The script that toggles its children did first toggle all bound children, then all targets (and since the lever is both, it was targeted twice). This is prevented now in the script by temp. marking all bound children as "processed" and then skipping them during the "activate target" step.

 

So the lamp can now be toggled by the lever - and both lamp and lever are spawned entirey from the entityDef :)

 

(The lamp still has the "light is too bright issue". Will work on that another day).

 

Have fun and if someone can, please make a video!

 

Here is the entity def:

 

entityDef atdm:lamp_desk_with_switch
{
   "inherit"			   "atdm:static_electric_light_lit_quiet_base"
   "model"				 "models/darkmod/lights/non-extinguishable/lamp_desk_01.ase"

   "extinguished"		  "0"
   "noshadows_lit"		 "1"			 // turn off shadow when lit
   // Let the lamp not obscure the light:
   "noshadows"			 "1"			 // lit, so has no shadows

   "editor_usage"		  "A small desk lamp with a switch that the player can toggle to turn the lamp on/off."
   "editor_displayFolder"			  "Lights/Switchable/Electric/Indoor"

   // the lamp itself is unfrobable
   "frobable"			  "0"
  "def_attach"		    "light_lamp_desk"
   "pos_attach"		    "flame"		 // At the attach point called "flame"...
   "attach_pos_name_1"	 "flame"		 // ... which is defined here.
   "name_attach"		   "flame"		 // Give it a name to pass along spawnargs
   "attach_pos_origin_1"   "0 0 27"	    // Offset the light a bit//doesn't appear to work
   "attach_pos_angles_1"   "0 0 0"		 // rotate the light
   "light_center"		  "0 0 27"

   "skin"				  "desklampshade"
   "skin_lit"			  "desklampshade"
   "skin_unlit"		    "desklampshade_unlit"

   "_color"			    "0.48 0.48 0.40"
   "_color"			    "0.80 0.50 0.20"

   // attach the switch (placeholder)
   "def_attach_2"		  "atdm:lamp_desk_switch"
   "pos_attach_2"		  "switch"		    // At the attach point called "switch"...
   "attach_pos_name_2"	 "switch"		    // ... which is defined here.
   "name_attach_2"		 "switch"		    // Give it a name to pass along spawnargs
   "attach_pos_origin_2"   "5 0 27"		    // Offset the switch a bit
   "attach_pos_angles_2"   "0 0 0"			 // rotate the switch

   // add a link from the switch to the flame (self here refers to the newly spawned base lamp entity)
   "add_link"			  "self:attached:switch to self"
}

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

@Tels, just so you know

 

"inherit" "atdm:static_electric_light_lit_quiet_base"

 

is just the static lit base, changed to have no buzzing sound (per Spring on nicer /indoor stuff) So the extra light shouldn't be coming from there.

 

But I'll play with this tonight/tomorrow and see what I come up with.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

@Tels, just so you know

 

"inherit" "atdm:static_electric_light_lit_quiet_base"

 

is just the static lit base, changed to have no buzzing sound (per Spring on nicer /indoor stuff) So the extra light shouldn't be coming from there.

 

Yes, but the base is a light. So you have the basic model being a light, and a ligth attached. (One theory for the change I have is that the offset of the base light changed, before it was maybe embedded into the lamp so never did cast any light, now it is moved 27 units up and is visible).

 

Regardless of where the double light comes from, the desk lamp needs to have less of it (and preferable only one light source for performance reasons :)

 

But I'll play with this tonight/tomorrow and see what I come up with.

 

I'll also have a look, was swamped the last days.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Well, I imagine the projected texture is on the base model itself then, so I guess that'll need swapped over if we just use the attached light.

 

Anyway, I got Biker's lamp and switch modeled, and I got a projected texture almost ready (need mtr), I'll get those up on SVN today.

 

 

@Biker, I don't have the betamapper repos, so if you could just email me that newer version with the stove (no wonder I missed it, lol) then I'll convert it. forumname@gmail.com

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Well, I imagine the projected texture is on the base model itself then, so I guess that'll need swapped over if we just use the attached light.

 

Actually, I think we might get rid of the attached light, because having the model itself being a light means you'd always have two lights. (It is possible to make a light not cast any light, but it is still strange that you'd have a light (with no difuse/shadow/specular stage) and a light which casts the light. Better get rid of the attached light then.

 

Anyway, I got Biker's lamp and switch modeled, and I got a projected texture almost ready (need mtr), I'll get those up on SVN today.

 

Cool :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

OK, I'm going to upload my work now right after I update just to make sure we're not conflicting.

 

note:

 

I changed the lamp entity names you made to reflect the models. ie: made it _03 (_01 is the original (yellow lamp), _02 is the red version skin... so _03 is Biker's.)

 

I changed the model/position for the dial.

 

I commented out one of the color lines and adjusted the color on the other a hair (just so it's a tinge more white/blue... we got too many yellow lights everywhere, we need variety)

 

made all required skins/materials for this lamp.

 

-------

I'll let you get rid of that extra light, and add the projected textures to the existing lights. There are 3 projections, 01,02,and 03 respectively.

 

your new script makes 1.07 hang and I can't get 1.08 going now so I commented out to test spawning, but that's fixed in the upload.

 

--------

 

I guess I'll make entities later for my desklamps to also have a switch as that's better than frobbing.

 

Will it break old maps if we just fix that entity to spawn a switch? Or do we just need a new entity?

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Will it break old maps if we just fix that entity to spawn a switch? Or do we just need a new entity?

 

Thanx I have a look later maybe tomorrow.

 

 

I am not so sure it is a good idea to change the "frob entire lamp" for the existing maps, because f.i. the newly spawned switch could be invisible to the player at the back of the lamp (the player might then wonder why th e lamp does not frob highlight and think he can't turn it off).

 

Also, the difference between "frobhighlight entire lamp" and "frobhighlight only the small switch" might make it more difficult to turn the lamp of in a hurry - so I'd say leave the old entity exactly as it was (that includes the light color and brightness!)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Regarding the double light, the desk lamp from v1.07 is here:

 

entityDef atdm:lamp_desk
{
    "inherit"							   "atdm:static_light_unlit_base"
    "model"								 "models/darkmod/lights/non-extinguishable/lamp_desk_01.ase"

    "extinguished"				  "0"
    "noshadows_lit"				 "1"							 // turn off shadow when lit
    // Let the lamp not obscure the light:
    "noshadows"							 "1"							 // lit, so has no shadows

    "editor_usage"				  "A small desk lamp that the player can toggle on/off with frob."
    "frobable"							  "1"

    "def_attach"		    "light_lamp_desk"
    "pos_attach"				    "flame"				 // At the attach point called "flame"...
    "attach_pos_name_1"			 "flame"				 // ... which is defined here.
    "name_attach"				   "flame"				 // Give it a name to pass along spawnargs
    "attach_pos_origin_1"   "0 0 3"				 // Offset the light a bit
    "attach_pos_angles_1"   "0 0 0"		 // rotate the light

    "skin"								  "desklampshade"
    "skin_lit"							  "desklampshade"
    "skin_unlit"				    "desklampshade_unlit"

    "_color"							    "0.86 0.76 0.51"
    "frob_action_script"    "frob_light_holder_toggle_light"
}

 

and it inherits from this:

 

entityDef atdm:static_light_unlit_base
{
    "inherit"					   "func_static"
    "editor_usage"		  "Base class for static unlit light fixtures. Don't use."
    "editor_displayFolder"  "Lights/Static"
    // use the tdm_light_holder script object to allow LightsOn(), LightsOff() and LightsToggle():
    "scriptobject"		  "tdm_light_holder"
    "extinguished"		  "1"
}

 

 

As you can see, it inherits from a func_static (not a light!) and has only one light. And it should be restored to that way.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

OK,

 

I changed that inheritance, maybe I was thinking they needed to be under electric.

 

So they definitely need checked and tested.

 

-------

That should fix the brightness issue as I'm sure I didn't change that, just a mistake.

 

As for color I really don't see any issue in changing the hue a little bit. 1, it's only a little, 2, it WILL look better, 3 it's nothing game or map breaking. I doubt authors used that lamp specifically just because it was yellow for the hue, as EVERY light in game was yellow ;)

 

And I don't want them to continue to be yellow, which will happen if it doesn't get changed now. And I don't want another entity just for a slight hue change. Plus the new entities with the dials will be the new hue, so why have it different just because it has a dial?

 

I'll just deprecate the non-dial ones so all new stuff will have the dials once I get to that.

--------

 

I will need to either make new shaders or adjust the shadow mesh for bikers lamp. Currently I think all the metals use shadows, so I'll probably just edit the shadow mesh later..

---------

I feel like I'm missing something, this was one of those tough sessions where everything turned hard...

 

I think I got everything ready for you... It should all be fixed but it does need tested for sure.

 

---

 

off to lunch then onto Biker's stove...

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Thanx for fixing the lamp. As for the hue change, I disagree on the grounds of it will change the appearance of existing maps quite a bit - and I don't think this is good nor what authors want us to do (it is a massive hue change, not just slightly).

 

As for the "deprecated", I don't think we should quickly dismiss the old lamps. The new ones are not "better and always prefered", they are just different.

 

Both decisions are more in Springheels department, tho, as he is the art and game directory. I'm just a lowly coder who breaks more stuff than he fixes.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Ok, now I remember why I despise D3 scripting. Ater one hour making a oneline change, restarting D3, loading the testmap, running to the lamp, frobbing it - no works. Redo from start. ARGL!

 

I fixed at least the testmap, removed the "double script object", and general tidied the desklamps a bit up.

 

The two originals work, but the new one only partially - the light is there, and it is toggled as r_showlightcount shows (the colors change!), but the light is invisible. I have no idea why and now I am so tired I give up for today. Maybe somebody else can spot why the light isn't actually shining anywhere...

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

hmm, it should have the shadows turned off when lit.

 

I wouldn't think the transparent glass (bulb) would block light.

 

I may look, probably not today, I'm already feeling a bit worn.

 

we got awhile before it all needs finalized anyway..

 

--thanks for looking into it and doing the script work.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

OP, 5 seconds after I posted here I had an idea - and it was the right one - the material for the light texture was simply missing. Added it now, and the lamp now works. (The glass when switched off is a bit bright and the light texture looks a bit off, too, but heh, it can be turned on/off now :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Why wouldn't he be able? (And since no mapper so far has swapped the texture or even asked how to do this, Iguess it wasn't important)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...