Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Try "big_monster" "1" as well as "solid" "0". (I think "solid" relates to the regular collision model, and AI have a simplified oblong bounding box that can be removed for 'big monsters'.) I don't know whether that will override door animations though. I do know I never found a way to stop ghosts setting off mines.

  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

I have an AI who has the def_attach "atdm:prop_playable_lute" and he plays the lute, but I have a speaker next to him which transmits the sound of the music. This is a good setup until the player aggravates him or causes him to stop playing, in which case he will get up and move around but the music will continue to play.

 

Is there a way to somehow tie the speaker playing the music to the AI, so that it only plays when he is sitting and playing his lute animation?

Link to comment
Share on other sites

You can control a speaker with a script, and you can put a condition in the script that could get the current state of the AI. I don't know the specific query for the AI state -- off-hand my first idea was just a simple boundary condition that the AI was present inside a bounding-box over the chair or some similar proxy, but that would let the music continue longer than you want -- but I think there's a way a script can get the AI state directly, and any change from the idle lute-playing animation (if != ...) could let you trigger the speaker which turns it off.

 

Edit: Another approach altogether is to just define a new lute object that inherits atdm:prop_playable_lute, so it's basically the same lute object, but it adds a script call to a script which plays (startSounds) the music directly. You don't even need the speaker, although you can have the script play a speaker too if you want. (Or if the original def file already calls a script it needs, you make a clone of that, add the sound stuff, then call that script). Then when the lute is destroyed the script object is destroyed with it (I think), and the sound stops for free. And of course you def_attach your new custom object.

 

Edit2: Come to think of it, that should be the default behavior of the lute object to begin with. Does it really play lute-playing animations without any sound? That should be fixed at the mod level if it does.

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 can control a speaker with a script, and you can put a condition in the script that could get the current state of the AI. I don't know the specific query for the AI state -- off-hand my first idea was just a simple boundary condition that the AI was present inside a bounding-box over the chair or some similar proxy, but that would let the music continue longer than you want -- but I think there's a way a script can get the AI state directly, and any change from the idle lute-playing animation (if != ...) could let you trigger the speaker which turns it off.

 

Edit: Another approach altogether is to just define a new lute object that inherits atdm:prop_playable_lute, so it's basically the same lute object, but it adds a script call to a script which plays (startSounds) the music directly. You don't even need the speaker, although you can have the script play a speaker too if you want. (Or if the original def file already calls a script it needs, you make a clone of that, add the sound stuff, then call that script). Then when the lute is destroyed the script object is destroyed with it (I think), and the sound stops for free. And of course you def_attach your new custom object.

 

Edit2: Come to think of it, that should be the default behavior of the lute object to begin with. Does it really play lute-playing animations without any sound? That should be fixed at the mod level if it does.

 

Re: Default sound playing, it doesn't play any sound on my end. Looking at the def files it only mentions sounds for the bouncing of the object itself.

 

I added an "s_shader" to a new definition which does work however when the AI is interrupted the sound continues playing as it's tied to the object existing and I can't find a way to force the object to despawn upon the AI dropping it.

 

I do know that the props for winebottle and cards have sounds associated with it that are not in the def files. The bottle causes the AI to play a "tdm_bottle_slosh" sound when they take a drink but I have no idea how it was done because there is nothing in the def file mentioning it, so I assume that is just hardcoded into the game.

 

So that leaves the last option of running a script, i'm a bit reluctant to do so as I don't think it's good having a script constantly checking in the background if the AI is playing a certain animation, wouldn't that overload things a bit?

 

Edit: so it appears you can set things to disappear by using ""destroy_on_detach" "1"", I found that not listed in the spawnargs but on another entity. Now it looks quite strange because as soon as he is alerted the lute disappears, which at this point i'm willing to accept. But the music continues playing so it doesn't really solve much.

Link to comment
Share on other sites

The bottle causes the AI to play a "tdm_bottle_slosh" sound when they take a drink but I have no idea how it was done because there is nothing in the def file mentioning it, so I assume that is just hardcoded into the game.

 

 

That sound is set in the animation. That is generally the best way to do it, because if he is alerted he will stop playing the animation and thus stop playing the sound.

Although the lute is a special case, because animation sounds need to be short since they play every X frames. Long sounds will start overlapping as the animation loops.

 

So if you want random strumming sounds, adding it to the animation is best. I made a loot-player once that played a longer song, and I think I faked it by putting a trigger_once brush around the lute, so that when it fell or was dropped when the AI was alerted, it would trigger the speaker to stop playing.

Link to comment
Share on other sites

If the animation and the sound have a similar length, you could try to use a frame command (http://wiki.thedarkmod.com/index.php?title=Frame_commands) to play the sound of the lute at a certain frame. That way the sound is linked to the animation. However, I am not sure if the sound is interrupted when the animation stops... At least it would not be repeated as soon as the animation cycle ends.

Link to comment
Share on other sites

 

That sound is set in the animation. That is generally the best way to do it, because if he is alerted he will stop playing the animation and thus stop playing the sound.

Although the lute is a special case, because animation sounds need to be short since they play every X frames. Long sounds will start overlapping as the animation loops.

 

So if you want random strumming sounds, adding it to the animation is best. I made a loot-player once that played a longer song, and I think I faked it by putting a trigger_once brush around the lute, so that when it fell or was dropped when the AI was alerted, it would trigger the speaker to stop playing.

 

How did you do this exactly?

 

I created a trigger_entityname on the floor under the lute then I added a name to the lute in the def file which was set on the trigger_entityname. However when the AI drops it nothing happens.

 

Did you have a working example on hand by chance? or remember which mission it was in if it's been released?

Link to comment
Share on other sites

If the animation and the sound have a similar length, you could try to use a frame command (http://wiki.thedarkmod.com/index.php?title=Frame_commands) to play the sound of the lute at a certain frame. That way the sound is linked to the animation. However, I am not sure if the sound is interrupted when the animation stops... At least it would not be repeated as soon as the animation cycle ends.

 

I tried that however now he just sits there doing nothing.

 

This is the def file I have for him

    anim play_lute_idle_sound         models/md5/chars/guards/proguard/play_lute_idle.md5anim
     { 
    	no_random_headturning
    		frame 1		call overrideLegs
			frame 2		sound alien01_loop
      	}

entityDef atdm:prop_playable_lute_soundplaying
{
	"inherit"					"atdm:moveable_lute01"
	"editor_displayFolder"		"Props"
	"editor_usage"				"Attaching this lute will activate playing behaviour."

        "model"						"models/darkmod/musical/lute01_held.lwo"
	"name"						"specialitem_lute"
	"frobable"					"0" // don't frob until the AI drops it

	"is_mantleable"				"0"
	"drop_when_ragdoll"			"0"
	"drop_set_frobable"			"0"


        	"unbindOnalertIndex"	"2"

        "replace_anim_idle_sit"                 "play_lute_idle_sound"

       "joint"						"Hips"
       

}

Link to comment
Share on other sites

Did you have a working example on hand by chance? or remember which mission it was in if it's been released?

 

 

This was back when I was working on the Whiterose Hotel map. I don't know if I still have it.

Link to comment
Share on other sites

I'm just going to make the lute player an undead immortal skeleton called Ralph who is eternally bound to play his lute in the tavern, the residents are used to him now so they just happily co-exist as long as the ale flows and the music plays.

That has to get you the best use of undead in a mission award!

Link to comment
Share on other sites

I thnik there is a special class for animated characters that don't act as AI, so they are more or less statically playing htere animation without interacting with the world otherwise. Func_animate could be worth a try.

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

I thnik there is a special class for animated characters that don't act as AI, so they are more or less statically playing htere animation without interacting with the world otherwise. Func_animate could be worth a try.

 

You mean the "Audience AIs" which can be found in the prefab folder under the section "ai" ?

Link to comment
Share on other sites

 

You mean the "Audience AIs" which can be found in the prefab folder under the section "ai" ?

 

Those are examples of ambient AI, yes.

Link to comment
Share on other sites

I thought I'd ask about this here before filing a tracker issue in case it's a map bug of some kind.

 

post-35144-0-92023000-1551058158_thumb.jpg

 

This is the room I'm working on. I'm on a dark balcony, but occasionally, when I move alongside the railings, my lightgem goes bright. I've found that this happens especially if I stand opposite the big bookcase, lean left over the railings and look around with the mouse (as shown).

 

By selectively turning off lights, I've found one that seems to be the cause, or at any rate can be the cause on its own. Oddly, I'm outside the light volume. I'm not even that close to it.

 

I've attached the room in case anyone wants to examine it (you'll see only one light is left on). It requires Judith's Builder compound asset pack.

 

The light volume's unusual rotation doesn't seem to be the cause, and making it shadowcasting didn't help.

lightbug2.map.txt

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Ralph needs an empty tankard for collecting the coins he died without, to pay the ferryman.

// oh - If I needed to stick a few AI and use the player character into certain positions in an area of void (or some key colour background), is the easiest way to set some ragdolls as for use in DR?

Edited by teh_saccade
Link to comment
Share on other sites

I have experimented with ghosts some time ago and found that the most effective way for me was to give the AI acollision box (and AAS) with only 0.5 units height. That way, you can leave an extremely small gap below walls and doors for them to walk through and controll that way, where the AI can walk to. It is even possible for the player to walk through them (although there is always a small "bump" over which the player walks.

Do you have an example of such AI, collision box and AAS?

S2wtMNl.gif

Link to comment
Share on other sites

Unfortunately, no. I have lost all these files in my last computer crash (which reminds me to update my backup). But I can whip together a small test map this evening, if you like. It is not really difficult to set it up.

I would really be thankfull if you could, I have no idea how to make a custom AAS.

S2wtMNl.gif

Link to comment
Share on other sites

I tried a bit this evening, but apparently it was moe complicated than I remembered. Apparently, you cannot simply use the spawnarg "solid 0" to make the AI passable by the player. I remember that I made custom skins with custom nonsolid, transparent materials that seem to be necessary to make the AI non-solid. Without the AI will collide with the wall. Do you want me to recreate this? If so it will take some time.

Link to comment
Share on other sites

Maybe noclipmodel 1 will work? Also, could it be the def_attached items (primarily the head) are what's colliding because they're still solid? You could look up the relative names of the attached itemsby looking at the name_attach spawnargs, then put spawnargs like this on the AI:

 

set noclipmodel on *name*

1

Link to comment
Share on other sites

I've checked Mother Rose and it is something more like a fire elemental, but ignoring even brushes - I was thinking about a walking human AI. I'm not sure if in earlier variants of Seed of Lodestar the apparitions couldn't go through closed doors. I have to check how they were made, and if I even remember it correctly.

S2wtMNl.gif

Link to comment
Share on other sites

I'm seeing some weird artifacts when creating a door from multi-brushes. I'm trying to create a grate the opens. I made it from several brushes. Selected all of the brushes, Create Entity, atdm:mover_door. It looks fine in DM. Then, I press 'v' to enter vertex editing mode. I move the origin to the side, so that the grate rotates correctly. After making this change, and no other changes, now I see artifacts in game:

 

post-2024-0-20483900-1551310486_thumb.jpg

 

These only show up after I move the origin of the door. Any ideas?

Link to comment
Share on other sites

Looks like slightly misaligned or intersecting brushes, on a strange angle - I get it, most often in walls, when more than two or three brushes are slightly overlapping (sometimes less than one square, because they are not aligned to the grid but running at strange diagonals).

If it's the same when you use either 'q/w' to move the origin, and you've made sure every single brush isn't overlapping and it's not a result of the clipper - you could export the brushes as a model to use.

Idk if there are supposed to be notches cut in the hinge side, but when faces vanish like that - it's usually a sign that there's some intersection that needs correcting.

It's better to not have brushes go inside each other.

Might be another reason, but that's when I've seen this happen.

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

    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
    • The Black Arrow

      Any of you heard Age of Wonders 4's OST?
      https://www.youtube.com/watch?v=Q0TcoMGq4iA
      I love how after all these years, Michiel van den Bos still conserves his "Melodic" spirit.
      · 0 replies
    • nbohr1more

      Moddb article is up:  https://www.moddb.com/mods/the-dark-mod/news/the-dark-mod-212-is-here
      · 3 replies
    • Petike the Taffer

      I've been gone for a while, but now I'm back, have a new desktop and I want to get back to making missions and playing missions. And doing other contributions. Waiting for my reset password for the wiki, but I'll take a look at it soon. Hello, all.
      · 4 replies
    • snatcher

      TDM Modpack 4.0 for The Dark Mod 2.12 released!
      · 1 reply
×
×
  • Create New...