Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Ugh, this engine is more finicky about dds than a damn toddler is about dinner. I can't let someone just do it for me because I need to tweak it to fit the HUD, and can't wait every time.

 

So here's what I do. Tell me what I'm missing. I've got it all rendering fine in-game just without the transparency (it's white) before, but now I have the transparency confirmed & it'all white.

 

- I have my texture in tga. I select the bit I want & save it as alpha. Correct part is transparent in paintshop & windows viewer.

- I save it as .tif because Compressenator apparently likes it better.

- Open Compressenator, ver. 1.21.1044 exactly, mind you. Open the .tif. Right click "Show Alpha" to confirm it's there.

- Batch or individually (same result either way), two tracks:

A: "ATI 3Dc Compression", like the wiki instructs.

B: "DirectX Texture Compression" like another part of the wiki instructs.

- Select DXT5, red .3086, green .6094, blue .082 (all would be .333 in xyz), Adaptive box unchecked. Click compress.

- With the non-batch way, I get a bar with 3 parts. Right click show alpha to confirm it's still there. Thank goodness it is. File-> Save Compressed. Save it. Repeat 31 times. Batch does all that itself.

- Open cmd, "ren .DDS .dds" (I don't have the star character on my phone but it's there), so all .dds are lowercase.

- Names are lightgem_0031 down to zero in the lightgem folder (that part's ok).

- Open game. Result depends on track. Track A (API 3Dc) renders all white. Track B (DirectX TC) renders the graphic, but alpha part is all white, despite compressenator correctly turning dds's alpha black.

 

Aside from asking what's wrong, that list demonstrates how ridiculous the pipeline is for something that should be really simple. I have 12 batches now (slightly different, or not for all I know) that are all one of those 2

botches. It's taken so much time for this one little thing, so I guess I'm venting a little too. Humbug!

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

- Top bar to "ATI 3Dc Compression", click Compress.

 

change that to:

 

- Top bar to "DirectX Texture Compression", click Compress.

 

and see if that gives you better results. 3Dc is a normal map format. I'm not even sure what it will output from this tool.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Sorry my internet on phone is slow, I was already editing in that case. It correctly renders the item, but the alpha is all white, even though compressenator correctly turned the alpha black when I checked show alpha. Also, if that API setting isn't right, the wiki needs to be changed.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Yes, I see that the screen-shot shows one thing and the instructions say another.

I have updated the wiki to correct the problem.

 

If I recall correctly, the 3Dc menu still has DXT sub-menu options which is definitely strange but may indicate that it should

function identically.

 

Now, the last piece of the puzzle is: What does the material def do with the alpha?

 

A black alpha is fully transparent while a white one is fully opaque. The material flag can override the texture value or can react to it.

For example Alpha 0.5 will make the alpha channel grey resulting in a semi-transparent texture while alphatest 0.5 will make any alpha

color darker the grey 0.5 fully transparent while anything brighter is fully opaque. I'm pretty sure the lightgem just uses the alpha and not

alphatest but if you made a custom material rather than just giving your lightgem texture the same name as the default then this might be

a consideration.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I'm trying to recall all this. I used to know it, but just for clarification when you say white, black, & grey alpha, is that something baked into the alpha (eg that you'd see in the alpha view in photoshop, and if so, I'll have to read up since I don't know offhand how to set that up) or like the color of the pixels of the image overlapping the alpha area?

 

Edit. Nevermind, testing confirmed it's the pixels. It works now thanks! For the record, I had an idea about it and switched the background to black earlier, but paintshop corrupted all the saves very oddly so I couldn't do it. The only reason it worked this time was I used png's instead. Just goes to show the insanity of the whole thing. Well I'm back in the game now, I guess.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Think of Alpha as another color. The channels are black and white representatives of the brightness of each color.

When you view the Red channel, the white parts are 100% red while the black parts are 0% red. The same is true

of Blue, Green, and Alpha. The problem is that different image editors have different ways to access the brightness

of the Alpha channel. I fought with GIMP for a few hours when trying to recall how to fix Alpha for Melan. I always assumed

that Photoshop was easier in that regard.

 

If you get stumped with Photoshop (etc), another option is simply to create a black and white texture and use it as a stage in

a material def with the makealpha keyword. Not ideal but it makes it easier to edit the alpha levels that way.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Does anyone know if it's possible to have the ambient sound attached to a location bleed through into the adjacent location?

 

I have rain ambient playing on an outdoors location entity but inside I want to still hear it a little bit. I know you can play a speaker with the same ambient by the door but i'm hoping for a better solution because that sometimes produces some odd sounds as the ambient plays twice if you're standing outside and near the speaker.

Link to comment
Share on other sites

There are a couple of things you might try.

 

But the idea that comes to me first... If you're worried about the area of overlap, I'd use the location_settings script feature, so when you leave the location a script is triggered that turns the speaker on, and when you enter the location a script turns the speaker off or turns the volume to zero (maybe wait a second & fade it so it's not too abrupt?). That at least gets rid of the overlap part. Then you can turn off the fading on the ambient so the transition is more seamless going from room to outside. Then if there are still problems we can deal with those when we get there.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

You could also create a small visportalled conduit to channel the sound to the location you want. (This may get performance-intensive, though)

  • Like 1

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

There are a couple of things you might try.

 

But the idea that comes to me first... If you're worried about the area of overlap, I'd use the location_settings script feature, so when you leave the location a script is triggered that turns the speaker on, and when you enter the location a script turns the speaker off or turns the volume to zero (maybe wait a second & fade it so it's not too abrupt?). That at least gets rid of the overlap part. Then you can turn off the fading on the ambient so the transition is more seamless going from room to outside. Then if there are still problems we can deal with those when we get there.

 

I'm a bit of a scripting nube.. how do you fade out speakers?

 

Would the script look something like this maybe?

 

$wait(1)

$speakerrain_01.fade

Link to comment
Share on other sites

The location entity is already fading the ambients. You can set the fade via some spawnargs. But for sounds like rain I would prefer to use speakers instead.

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

That's what he wants too, as I understand. Wait, we might be thinking of different things. I'll start over:

 

 

I'm a bit of a scripting nube.. how do you fade out speakers?

 

I know you can play a sound directly from a script, startSound(), and then fadeSound() handles fading of that. So I guess that's what I was thinking of, if there's not an easy way to command a speaker to do it.

 

Also, yes, as Orbs mentioned, you might be able to forget fading with the speaker and do it all with fading on the location_settings fading, but probably make it much shorter (default is like 4 seconds), just to cover the seam a bit. It may be that just having a hair of overlap hides the seam by itself? Just play with the values.

______________

 

So here's the ideal setup as I imagine it. (Then we can think how to reach it.)

 

Outside the rain plays normally. Just inside, with the door open it sounds like outside, there's a clear muffling when you close the door but it's still playing indefinitely, and then there's a distance falloff from the door. The line between inside and outside, and the area around the line, should be seamless, so no temporal fading at all, and no doubled-up ambients playing.

 

The logical reason you'd want to combine the location system & speakers is each covers some features the other misses. The location covers the entire outside uniformly and entirely, which a speaker can't do cleanly, and the speaker handles the distance falloff and the door muffling. And it would work if only the transition was clean. So that's why I recommended a quick seamless transition (keep the speaker off outside, making the fading short on the location ambient & turn the speaker on as seamlessly as possible in the overlap, and rely only on the temporal fading from the speaker from there).

  • Like 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

I have an AI sitting on a moving cart, however when the cart moves he stays still and the whole cart just goes through his body.

 

I tried to bound the AI to the mover that's moving the cart and he disappears. How do you get an AI to stay on a moving entity?

Link to comment
Share on other sites

If it doesn't need to be an actual AI you could always just use a func_animate. The only tricky bit with those is that you need to line up their heads very precisely to their bodies since they need to be two separate models, but you can check my FM's for examples.

  • Like 1

But you should walk having internal dignity. Be a wonderful person who can dance pleasantly to the rhythm of the universe.

-Sun Myung Moon

 

My work blog: gfleisher.blogspot.com

Link to comment
Share on other sites

How do you get an AI to stay on a moving entity?

This is something I did for my carriages, if you're looking for an alternative approach.

 

- monsterclip the cart so that AIs can get on board and sit down

- duplicate the monsterclip and convert it to mover_elevator, this will push the AIs forward

- bind the mover_elevator and all cart components to the horse and give the horse a path_corner

 

- If you want the AIs to get out at the other end you also need a copy of the worldspawn monsterclip there.

- If you have multiple horses you need to disable idle animations to avoid that they start out of sync, which normally leads to the death of all carriage occupants. Setting the interval to 99999 seems to be the way it's done, at least for head turning.

 

If the carriage stops in a player-accessible area you'd need to teleport in a fresh carriage which isn't bound to a horse, in case the player shoos away the horse.

 

 

An alternative approach to propulsion is to bind everything to the elevator and let it move instead of binding to a horse. This is more stable when you use multiple horses and lets you keep your original carriage, see above, but I haven't worked out how to let a horse walk on the spot. TDM's walking animations intrinsically cause the AI to move forward.

  • Like 1
Link to comment
Share on other sites

Thank you to you both, the issue I had was I had a monster_clip that was a func_static and bound to the mover.. but making the monster_clip seat the AI was sitting on the actual mover seems to have remedied the problem.

Link to comment
Share on other sites

I recall there are spawnargs you can give an AI that will change their name when carried, depending on their state. E.g. instead of a "Body", it is called "Sven", and instead of a "Corpse", it is called "Sven's Corpse". Abyone remember how they are called?

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

I recall there are spawnargs you can give an AI that will change their name when carried, depending on their state. E.g. instead of a "Body", it is called "Sven", and instead of a "Corpse", it is called "Sven's Corpse". Abyone remember how they are called?

 

"shouldered_name" - For when they're just knocked out

"shouldered_name_dead" - For when they're dead

  • Like 1
Link to comment
Share on other sites

Thank you.

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

I've made a special item, which consists of 3 func_static models, which are embedded into a collision brush which was made into a "atdm:moveable_base." The models have been "bind":ed to the "atdm:moveable_base," so that they move with the collision brush.

 

I set all the inv_* parameters like they should be for a moveable that goes into the player inventory. In essence it is a "atdm:moveable_base" collision model entity, that carries 3 ordinary models in it.

 

If I pick this entity up in the game, it goes into the inventory correctly, and if I drop it, it drops correctly.

 

The problem starts when I add "inv_map_start 1" into the "atdm:moveable_base"-entity so that the player would have it in inventory when the map starts. It looks like the "atdm:moveable_base" goes into the inventory, but the binded models stay where they are. If I drop the entity now, I drop nothing that is visible, and the binded models are present in the map, where I originally had the combo entity.

 

If I add the item to the player inventory with a script command $thing.addItemToInv($player1); I get the same result as with "inv_map_start 1"

 

Is there any way of having the combo entity in the player inventory on map start?

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

If the script way doesn't work, perhaps you might need to define your item through a new entityDef and use def_attaches for the models. Things like candles and oil lamps use def_attach without bones (well, with fake bones) on the entity.

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

Try including the line

 

sys.waitFrame();

before your code. Maybe that solves the issue.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

The entityDef is maybe too clunky.

 

Waiting a frame did not help.

 

I also tried

$thing.frob();

 

This brings it into my inventory as if I had remotely frobbed it. But again, the models do not come with it.

 

End conclusion is perhaps this: frobbing by hand is different than frobbing via script.

 

I suppose I cannot do this like I initially planned. Gotta think something else....

 

EDIT: yeah, maybe I just use individual models instead of the combo and make it more interesting objective-wise..

 

Thanks for the help, guys!

Clipper

-The mapper's best friend.

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...