Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

3 hours ago, JackFarmer said:

Sound shaders used in conversations are given the reverb effect defined in the associated efx file for the defined info location.

If you have a room with an intense reverb (example: efx cathedral), then the voice files are sometimes not easy to understand. If you could use a different reverb for the voice files (then maybe exf Medium Stone Room), it would be more understandable again.

Question: Is it possible to define a different reverb effect independent from the Info Location for such voice files?

It wouldn't help if I converted the voice files with a more "understandable" reverb using an editing program, because the defined room reverb via the Info Location would still be applied, which would probably only make things worse.

@nbohr1more

At this time, it is not possible to define per entity reverb this way.

The current workaround:

Add the no_efx keyword to the sound shader and bake the reverb into the audio recording ( if you want reverb )

 

  • Thanks 1

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

  • 2 weeks later...

I'm not having much success with vertex blending a cobblestone path with grass. I've applied it to an .ase model imported from Blender.

I followed this tutorial: https://wiki.thedarkmod.com/index.php?title=DrVertexBlend_(tutorial)#Vertex_Painting_Each_Object

In DR, my custom material file does show up in the material editor and it seems to be getting applied to the model but incorrectly - it's just a uniform green.  In game, the model is greyscale - I think it's getting textured with my vertex-painting, instead of the grass and cobblestone.

Here's the mtr file. Have I overlooked anything?

textures/darkmod/map_specific/lawn_vertex_blend
{
    surftype15
    description "grass"
    
    qer_editorimage textures/darkmod/nature/grass/short_dry_grass_dark_ed.jpg
	{
		blend	diffusemap
		map		textures/darkmod/nature/grass/short_dry_grass_dark
		vertexColor
	}
	{
		blend	bumpmap
		map		textures/darkmod/nature/grass/short_dry_grass_local
		vertexColor
	}
    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
		vertexColor
	}
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/darkmod/nature/grass/short_dry_grass_dark
        rgb         0.15 * parm11
		vertexColor
	}

	{	
		blend	diffusemap
		map		textures/darkmod/stone/cobblestones/cobblestones02_square_dark
		inverseVertexColor
	}
	{	
		blend	specularmap
		map		textures/darkmod/stone/cobblestones/cobblestones02_square_dark_s
		inverseVertexColor
	}
	{	
		blend	bumpmap
		map		textures/darkmod/stone/cobblestones/cobblestones02_square_dark_local
		inverseVertexColor
	}
    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
		inverseVertexColor
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/darkmod/stone/cobblestones/cobblestones02_square_dark
        rgb         0.15 * parm11
		inverseVertexColor
    }
}

"lawn_vertex_blend" is the vertex-blended DDS image file exported from Blender and is also referenced in the .ase file.

 

Link to comment
Share on other sites

I think you can leave out the if ( parm11 > 0 ) stuff, because that is for frob highlighting, but is not needed anymore in material files since 2.11

I don't think it will help though.

I just wondered if the blend specularmap would work correctly if it's only defined for one of the two textures blended.

Btw. I don't know much about it really. Hope somebody else can help you.

Edited by datiswous
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, datiswous said:

I think you can leave out the if ( parm11 > 0 ) stuff, because that is for frob highlighting, but is not needed anymore in material files since 2.11

I don't think it will help though.

I just wondered if the blend specularmap would work correctly if it's only defined for one of the two textures blended.

Btw. I don't know much about it really. Hope somebody else can help you.

Thanks for the input, I have updated the material file based on that. It still isn't working, but it didn't make it worse anyway:)

Link to comment
Share on other sites

If you already know this ignore it but if you don't, then know that if's in materials stages turn on and off those stages, so you need to make sure you are setting parm11 to a valid value above zero in a script somewhere.

But if removing those, didn't solved the problem, then the problem could be the vertex colors itself, are you sure the model has the correct vertex color info on it? Afaik the engine only supports grayscale vertex colors in the RGB format no alpha.

Also instead of blend diffusemap keyword try the blend add (gl_src_one gl_dst_one) not sure if this matters but the basic example for vertex colors in this link uses it.

I haven't used vertex blending for a very long time so all of this is rusty on my mind unfortunately. 

Also not sure what you mean with ""lawn_vertex_blend" is the vertex-blended DDS image file exported from Blender and is also referenced in the .ase file." but a material name like yours "textures/darkmod/map_specific/lawn_vertex_blend" shouldn't be a link to a real texture, in reality that is just a virtual path to a fake folder that DarkRadient uses to display in the media section of the editor. 

You can have a material with just a single word on its name and it will show in the media tab, just not inside a folder but in the global space.

it is like this:

virtual path/material name { material code }  or  material name { material code }

Edited by HMart
  • Thanks 1
Link to comment
Share on other sites

52 minutes ago, HMart said:

If you already know this ignore it but if you don't, then know that if's in materials stages turn on and off those stages, so you need to make sure you are setting parm11 to a valid value above zero in a script somewhere.

But if removing those, didn't solved the problem, then the problem could be the vertex colors itself, are you sure the model has the correct vertex color info on it? Afaik the engine only supports grayscale vertex colors in the RGB format no alpha.

Also instead of blend diffusemap keyword try the blend add (gl_src_one gl_dst_one) not sure if this matters but the basic example for vertex colors in this link uses it.

I haven't used vertex blending for a very long time so all of this is rusty on my mind unfortunately. 

Also not sure what you mean with ""lawn_vertex_blend" is the vertex-blended DDS image file exported from Blender and is also referenced in the .ase file." but a material name like yours "textures/darkmod/map_specific/lawn_vertex_blend" shouldn't be a link to a real texture, in reality that is just a virtual path to a fake folder that DarkRadient uses to display in the media section of the editor. 

You can have a material with just a single word on its name and it will show in the media tab, just not inside a folder but in the global space.

it is like this:

virtual path/material name { material code }  or  material name { material code }

Cool, I think this should help a lot. First off, there is an alpha channel in my vertex-blend texture, so I'll remake that without it.

The "blend diffusemap" was from the DrVertexBlend tutorial, but I'll try using "blend add" instead.

I had mistakenly thought the first line of the material file was referencing the vertex-blend image, so I should just be giving the material a name there? OK, I'll fix that too.   

Thanks!

  • Like 1
Link to comment
Share on other sites

2 hours ago, grodenglaive said:

Cool, I think this should help a lot. First off, there is an alpha channel in my vertex-blend texture, so I'll remake that without it.

The "blend diffusemap" was from the DrVertexBlend tutorial, but I'll try using "blend add" instead.

I had mistakenly thought the first line of the material file was referencing the vertex-blend image, so I should just be giving the material a name there? OK, I'll fix that too.   

Thanks!

No problem btw there's no vertex blend texture, the vertex colors are baked in the mesh itself, meaning they should be exported in the .ase file itself. 

And yes the first "path" in a material is just a material name, it can be any unique identifier, the real textures are defined inside the material itself. 

materialname
{
	//global space

	{
		// diffuse material stage
		blend diffusemap
		map path/to/the/real/texture.tga
	}
}

or

materialname
{
	//global space

	diffusemap path/to/the/real/texture.tga
}

 

Edited by HMart
  • Like 1
Link to comment
Share on other sites

I just read@motorsep

Discovered that you are able to create a brush, then select it and right click "create light". Now you have a light that ha the radius of the former brush.

Just read it on discord and thought it may be of use for some people in the forums here too.

  • Like 2

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

7 hours ago, SeriousToni said:

Discovered that you are able to create a brush, then select it and right click "create light". Now you have a light that ha the radius of the former brush.

Just read it on discord and thought it may be of use for some people in the forums here too.

How is it useful?

Well you could convert it into a light prefab? For those you can't see the light radius I think.

Link to comment
Share on other sites

54 minutes ago, datiswous said:

How is it useful?

Well you could convert it into a light prefab? For those you can't see the light radius I think.

I could imagine some people find the work flow easier. Dragging from corner to corner and then converting instead of placing a light hopefully centered so that you don't have to move it around while expanding its radius.

  • Like 1

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

I want to dynamically create a trigger_hurt via a script. The following creates one, but it has no size:

    sys.setSpawnArg("origin", <some point>);
    entity trigger = sys.spawn("trigger_hurt");

How can I specify a size and shape (e.g., a rectangle) for this entity?
 

Link to comment
Share on other sites

Unfortunately many things in this engine are best done on the editor and then called through script, not created directly through script, one of them afaik is triggers.

You normally create a trigger by creating a square brush on the editor manually, and give it the trigger_hurt material, so the size and shape comes from that brush, it also creates the physics (a clip model) automatically, then just need to use the script function,

entity ent = sys.FindEntity("entity_name");

To get it and use it in the script to do whatever you want.

Creating a clip model from script, is probably possible, thou I never did it, so I don't know how... thou I do know how to do it through c++.

But I don't think there's any equivalent script functions exposed to the script system, if I'm mistaken please anyone correct me.

Perhaps something to recommend in the TDM roadmap?

Edited by HMart
  • Thanks 1
Link to comment
Share on other sites

Thanks. I was hoping to create the trigger in an arbitrary location. I guess I could create a brush trigger in a "blue room" (in DR), then have some script code that moves it to the arbitrary location (using setOrigin). Anyway, I found a different workaround for this, so it's not an issue anymore.

  • Like 1
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 3 weeks later...

Hello again TDM-ers.

I have a question about sound.

I have a small river that flows through a map area.  I want the water flow sound along the river.

Is it possible to create a a single flowing sound that follows along the river evenly/linearly? Or must I create numerous speaker objects along the river?  Are there other ideas?

Very much appreciated.

Clint

 

Link to comment
Share on other sites

You can use the Location System, but the issue is that the entire location will have the river sound and it won't sound like it's coming from the river nor fall off with distance. That might work if you can make your location close enough to the river, but if it's outside it might not work well. But the advantage is, once you define the location, you could have it miles long and you've got the whole area covered with a few simple steps and parameters.

Speakers are the main alternative that are localized and have a falloff with distance.

Well another option is that you can create a special dummy object and in its def file you can define a sound, like the way a machine or AI makes sounds. Then you could maybe make an invisible & long skinny object out of brushes that follows the river and convert it to a func_stat, but that seems like a really elaborate solution to a simple problem that'd probably be more trouble than its worth.

I think practically speaking a line of speakers would work just fine, but maybe the location system depending on just how big and location-able this river is.

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

It would also be possible to use a script to move a speaker.

Say your river is running straight west-east. Put the river noise speaker in the river somewhere. Then set up a trigger-timer to fire every 0.1 of a second and target it to a callscript. The script will then get the player's X-coordinate and set the speaker's X-coordinate to that value. In this way the speaker will always be level with the player and it should sound as though the river noise is coming directly from the river.

  • Like 1

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

Thanks for the info.

I am using speakers with [hopefully] nice placement and max distance with a few topographical things in the river area that will sound like water needs to be a louder splash.  So far, it seems useful.

Appreciated.

Clint

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I have a stackable inventory item and an object these collectables are supposed to be deposited into. I'm using used_action_script to call a script that decrements the size of the stack in my inventory to simulate dropping the items into the bucket. This works fine so long as I collect and deposit the things one at a time. If I have a stack of more than one object, they all get dropped in at once. That isn't what I want. If I have a stack of three items I want the player to need to use the objects on the bucket three times. How can I do that?

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

I found this object in the TDM files (tdm_target.def)

entityDef atdm:target_itemremove {
    // Added in #3784
    "inherit"                        "atdm:target_base"
    "editor_color"                    "1 0.5 0"
    "editor_mins"                    "-5 -5 -5"
    "editor_maxs"                    "5 5 5"
    "noclipmodel"                    "1"
    "wait_for_trigger"                "1"
    "spawnclass"                    "CTarget_ItemRemove"
    
    // DR documentation
    "editor_usage"                    "Removes items from the player's inventory. Each target_itemremove can remove up to 1 unique entity, one stack of stackables, and one type of ammo. Melee weapons cannot be removed."
    "editor_var unique_item"        "The name of a unique entity to remove. Must match the entity's 'name' spawnarg." 
    "editor_var stackable_class"    "Specify a type of stackable. Must match the entity's 'inv_name' spawnarg." 
    "editor_int stackable_count"    "The number of stackables to remove. 0 means all." 
    "editor_var ammo_type"          "The weapon whose ammo is to be removed. Standard ammo names are: broadhead, firearrow, gasarrow, mossarrow, noisemaker, ropearrow, vinearrow, waterarrow"
    "editor_int ammo_count"         "The amount of ammo to remove. 0 means all."
    "editor_bool drop_in_world"     "If set, the item will be dropped at the player's feet instead of being removed from the world."
    
    // DR default keys
    "editor_setKeyValue unique_item"        "-"
    "editor_setKeyValue stackable_class"    "-"
    "editor_setKeyValue stackable_count"    "0"
    "editor_setKeyValue ammo_type"          "-"
    "editor_setKeyValue ammo_count"         "0"
    "editor_setKeyValue drop_in_world"      "0"
    
    // Defaults for subclasses
    "stackable_count"    "0"
    "ammo_count"         "0"
    "drop_in_world"      "0"
}

Note this:

    "editor_int stackable_count"    "The number of stackables to remove. 0 means all." 

The default is 0, which is the behavior you are seeing. I'm not sure how to use this, but maybe you can somehow, and set stackable_count to 1?
 

Link to comment
Share on other sites

The issue is that the frob gets activated once per frame and not once per mouse click. How do doors and keys do this? Using a key on a door doesn't unlock and lock it sixty times a second. I can find nothing useful in the defs that would help me.

Edited by thebigh

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

I'm just guessing at what your script function does, but maybe, after calling whatever reduces the stackable count by 1, do a wait for, say, a half second, before exiting the function. That might suppress redundant/re-entrant calls to the function. Or it that's not enough, add a pseudo-mutex within the same file, e.g.:

float mutex; // outside any function body

my_script_function()
{
  if (mutex == 0)
  {
    mutex = 1;
    // call here to decrement stackable count
   sys.wait(0.5);
   mutex = 0;
  }
}

As for the target_itemremove, I'm thinking one would create an instance (the usual colored cube), then in its property list set "stackable_count" and/or "ammo_count" to 1. Then have your script function trigger it by name.

Edited by Geep
  • Like 1
Link to comment
Share on other sites

I created a simple test with 3 objects. A stackable arrowhead:

"classname" "atdm:moveable_loot_ancient_arrowhead"
"name" "atdm_moveable_loot_ancient_arrowhead_1"
"origin" "64 104 -40"
"rotation" "1 0 0 0 1 0 0 0 1"
"inv_category" "Special"
"inv_loot_type" "0"
"inv_loot_value" "0"
"inv_stackable" "1"
 

A frobable bowl:

"classname" "atdm:frobable_base"
"name" "func_static_1"
"origin" "112 104 -61.9901"
"model" "models/darkmod/kitchen/bowl01.lwo"
"rotation" "1 0 0 0 1 0 0 0 1"
"target" "atdm_target_itemremove_1"
 

And an itemremove target:

"classname" "atdm:target_itemremove"
"name" "atdm_target_itemremove_1"
"origin" "120 104 -16"
"ammo_count" "0"
"ammo_type" "-"
"drop_in_world" "0"
"stackable_class" "Arrowhead"
"stackable_count" "1"
"unique_item" "-"
 

When you frob the bowl, the arrowhead count in your inventory drops by 1. If you want to do additional processing when the bowl is frobbed, have it target a atdm:target_callscriptfunction, which can do whatever you like (including activating the atdm:target_itemremove).

  • Like 1
  • Thanks 1
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

    • Sotha

      WIP mission name confirmed: "The Last Offering"
       
      · 5 replies
    • Sotha

      Today I started writing readables for my WIP mission.
      I wrote my usual text and then crammed it into AI and boom, high quality stuff comes out.
      I used to say that clipper is the mappers best friend, but now it seems it is more like "AI is the mappers best friend."
      · 2 replies
    • The Black Arrow

      Just saw further into 2.13 development, or is it 2.14? Anyway, proper Parallax Mapping...Absolutely fuck yes, please!
      · 2 replies
    • nbohr1more

      Happy Halloween! "Gem of Souls" is out:
       
      Psst, someone let Darkfate know...
      · 1 reply
    • The Black Arrow

      Is there a thread for "Moving Day 2: Look Who's Moving Now"? If not, could someone hint me on what is Dick's birthday? This mission is quite enjoyable on its disturbing creepy implications.
      · 3 replies
×
×
  • Create New...