Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Do the objects need to be bound? There are script commands for "bind" and "unbind", you could try just not requiring the objects to be bound, or undbind them and rebind them as necessary.

Edited by Moonbo

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

According to the script reference (http://wiki.thedarkm...cript_Reference):

 

scriptEvent void bind(entity master);

Fixes this entity's position and orientation relative to another entity, such that when the master entity moves, so does this entity.

master: the entity to bind to

Edited by Moonbo

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

I'm reading through Fidcal's tutorial, and he's having me select one wall to use the Copy Shader tool on a new brush/room. When I try it, I get an error message: "Can't copy shader. Please select single face or patch."

 

I'm hitting Esc. and making sure nothing else is highlighted. Fortunately this isn't a "stop you in your tracks" problem, but it would certainly make things easier. Thanks for any advice.

Edited by Digi

"Fancy burricks are afraid of dogs, if they encounter each other the dog barks and the burricks poop." - Thief: Deadly Shadows Game Designer

Link to comment
Share on other sites

Bah, reading! Who needs it?! But yeah, I noticed the difference once you mentioned it. I was just too used to doing Alt-Shift. Anyway, thanks.

 

Slow but steady progress on my first map. Probably not my first FM...I'm creating things too haphazardly to help me get acquainted with the tools. But a functioning map at least.

Edited by Digi

"Fancy burricks are afraid of dogs, if they encounter each other the dog barks and the burricks poop." - Thief: Deadly Shadows Game Designer

Link to comment
Share on other sites

  • There is a KO and death_script spawrnargs for the AI. Make a script file for your mission with "dropsword" script. Give this dropsword for the death/ko_script on the AI.
  • In the script you just need to sys.spawn a shortsword, teleport it into the location of the AI, and activate physics for it.
  • There should be examples in the LQD.pk4 how to use death_scripts. All the revenants have it. the script does also similar things you are interested in, IE spawning stuff and teleporting it to the AI.

@Sotha I am working with melan on his map - could you help me do the above if I give you a basic map with An Ai..?

Link to comment
Share on other sites

What exactly do you want to happen once an ai dies/gets knocked out?

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

Biker, here:

 

Script (dropstuff.script):

void dropstuff_thread(entity e)
{
entity newitem = sys.spawn("atdm:weapon_shortsword"); //create item
sys.wait(0.5);
newitem.setOrigin(e.getOrigin()); //teleport item
sys.trigger(e); //activate physics
}
void dropstuff(entity e)
{
 thread dropstuff_thread(e); //must make a new thread in order be able to use delays between commands.
}

 

And map (dropstuff.map):

 

 

Version 2
// entity 0
{
"classname" "worldspawn"
"editor_drLastCameraPos" "168.025 -465.81 129.868"
"editor_drLastCameraAngle" "-13.5 106.8 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -528 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 25.75 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 1 0 0 ) ( ( 0.01953125 0 3.28125 ) ( 0 0.0390625 5.3125 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 1 0 0 -520 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 2.8125 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 -1 0 -512 ) ( ( 0.01953125 0 12.71875 ) ( 0 0.0390625 5.3125 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( -1 0 0 0 ) ( ( 0.01953125 0 13.65625 ) ( 0 0.0390625 5.3125 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 0 -1 520 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 25.75 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -520 ) ( ( 0.01953125 0 2.1875 ) ( 0 0.0390625 25.75 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 1 0 -8 ) ( ( 0.01953125 0 3.28125 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 1 0 0 -520 ) ( ( 0.01953125 0 2.1875 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 0 -1 -8 ) ( ( 0.01953125 0 2.1875 ) ( 0 0.0390625 10.9375 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( -1 0 0 0 ) ( ( 0.01953125 0 13.8125 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 -1 0 0 ) ( ( 0.01953125 0 3.28125 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 0 1 -520 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 25.4375 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 1 0 0 ) ( ( 0.01953125 0 3.4375 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 1 0 0 -528 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 0 -1 -8 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 11.25 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 -1 0 -512 ) ( ( 0.01953125 0 12.5625 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( -1 0 0 520 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 1 0 0 ) ( ( 0.01953125 0 3.28125 ) ( 0 0.0390625 4.6875 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 1 0 0 -520 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 2.1875 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 0 -1 -16 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 10.9375 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 -1 0 -512 ) ( ( 0.01953125 0 12.71875 ) ( 0 0.0390625 4.6875 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( -1 0 0 0 ) ( ( 0.01953125 0 13.65625 ) ( 0 0.0390625 4.6875 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 0 1 8 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 10.9375 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 0 1 -520 ) ( ( 0.01953125 0 2.5 ) ( 0 0.0390625 25.75 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 1 0 0 -520 ) ( ( 0.01953125 0 2.5 ) ( 0 0.0390625 2.5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 0 -1 -8 ) ( ( 0.01953125 0 2.5 ) ( 0 0.0390625 10.9375 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 -1 0 -520 ) ( ( 0.01953125 0 12.71875 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( -1 0 0 0 ) ( ( 0.01953125 0 13.5 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 1 0 512 ) ( ( 0.01953125 0 12.71875 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -520 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 26.0625 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 1 0 0 ) ( ( 0.01953125 0 3.125 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 0 -1 -8 ) ( ( 0.01953125 0 2.34375 ) ( 0 0.0390625 10.625 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 0 -1 0 -512 ) ( ( 0.01953125 0 12.875 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( -1 0 0 -8 ) ( ( 0.01953125 0 13.65625 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
( 1 0 0 0 ) ( ( 0.01953125 0 13.65625 ) ( 0 0.0390625 5 ) ) "textures/darkmod/carpet/rugs/ornate_black_gold01" 0 0 0
}
}
}
// entity 1
{
"classname" "info_player_start"
"name" "info_player_start_1"
"origin" "304 -288 -8"
"angle" "90"
}
// entity 2
{
"classname" "atdm:ai_builder_guard"
"name" "atdm_ai_builder_guard_1"
"origin" "296.049 -135.99 -8"
"rotation" "0 1 0 -1 0 0 0 0 1"
"ko_script" "dropstuff"
"death_script" "dropstuff"
}
// entity 3
{
"classname" "atdm:ai_builder_guard"
"name" "atdm_ai_builder_guard_2"
"origin" "232.049 -127.99 -8"
"rotation" "0 1 0 -1 0 0 0 0 1"
"death_script" "dropstuff"
"ko_script" "dropstuff"
}
// entity 4
{
"classname" "atdm:weapon_blackjack"
"name" "atdm_weapon_blackjack_1"
"origin" "208 -248 32"
"inv_map_start" "1"
}
// entity 5
{
"classname" "atdm:weapon_shortsword"
"name" "atdm_weapon_blackjack_2"
"origin" "208 -264 32"
"inv_map_start" "1"
}
// entity 6
{
"classname" "light"
"name" "light_1"
"origin" "232 -208 328"
"light_center" "0 0 0"
"light_radius" "1112 320 1704"
}

 

 

 

When you kill or KO the guards, they spit out a player usable moveable shortsword. It could be improved so, that the item does not appear at AI origin (e.getPosition()), but slightly above them (add a vector with few units of z). That way the item is visible, now it gets under the AI.

 

EDIT:

Always the perfectionist... Here the script that does that. Looks pretty good now:

void dropstuff_thread(entity e)
{
entity newitem = sys.spawn("atdm:weapon_shortsword"); //create item
sys.wait(0.5);
vector location = e.getOrigin() + '0 0 8';
newitem.setOrigin(location); //teleport item
sys.trigger(e); //activate physics
}
void dropstuff(entity e)
{
 thread dropstuff_thread(e); //must make a new thread in order be able to use delays between commands.
}

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Is it possible to have a map which highlights the area you are currently in? similar to how it is in Thief 2?

Link to comment
Share on other sites

Yes. The Location system allows you to trigger scripts when you enter and leave locations. So what you'd do is trigger a simple script that replaces the map object in your inventory with a new map object with the xdata image highlighting the area you're currently in.

  • 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

Or you check Obstipedia (Link in my signature) on how to create automaps, where this area is covered, too. ;)

 

One question myself: Is it possible to define global variables via script or spawnarg? Currently there global0 ... global7, which are used by a couple of shaders (mostly Ambient related), but I could need three more. I need global ones as I'm not able to access the shaders directly.

  • 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

I always put spawnargs on a dummy object so I can have as many as I want; IIRC they were global, but my memory is hazy. I mean other independent scripts can get those spawnargs. Once they're set they're part of that object. I don't remember how shaders work though.

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

A dummy entity is global for scripts, but material files can't reference an entity in the map. They can only access the shader parms on the entity they are attached to.

You can't add extra globals unfortuately. Material.cpp accesses parms 0-11 and globals 0-7 by hard-coded names. There's no general search for "globalxxx".

Is there no way you can set up your shader so that it has a referenceable entity? Particles, for example, can be told to use the shader parms from their func_emitter, and you can set parms on def_attached entities too. But there are some entities that I've never managed to reach from script code: view models, for example.

Link to comment
Share on other sites

I have a custom animation that i'm trying to get into my map however I don't know what folder to place the file in.

 

I know that I animations need to go inside something like /models/md5/chars/**classname**/ but I don't know what the classname of the AI is and I don't know how to find it out.

 

I was wondering is there an easy way to figure this out? like say look at a spawnarg or something? that way I can know it goes in the /guards/proguard folder or whatever it is.

 

And if anyone knows what would be a basic entry for a .def file for an idle animation?

Edited by Goldwell
Link to comment
Share on other sites

Check tdm_ai_humanoid_guards01.pk4

It contains def/tdm_ai_guard_proguard_devel.def

 

That contains the anim definitions for male humans.

 

a basic anim looks like this:

anim walk1 models/md5/chars/guards/proguard/walk.md5anim

{

frame 8 footstep

frame 16 sound snd_rustle

frame 25 footstep

frame 33 sound snd_rustle

}

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Check tdm_ai_humanoid_guards01.pk4

It contains def/tdm_ai_guard_proguard_devel.def

 

That contains the anim definitions for male humans.

 

a basic anim looks like this:

anim walk1 models/md5/chars/guards/proguard/walk.md5anim

{

frame 8 footstep

frame 16 sound snd_rustle

frame 25 footstep

frame 33 sound snd_rustle

}

 

Thanks for the response Sotha but the proguard thing was just an example. The character I actually have is "atdm:ai_merchant01" and I was wondering how I figure out what folder I should create so that it will work in game. As far as I know you have to have the exact folder for the respective AI in order to place the anim files inside correct?

 

And thanks for that example for the .def file!

Link to comment
Share on other sites

Yes. The Location system allows you to trigger scripts when you enter and leave locations. So what you'd do is trigger a simple script that replaces the map object in your inventory with a new map object with the xdata image highlighting the area you're currently in.

An explample map with this setup might be usefull for new mappers.

Link to comment
Share on other sites

An explample map with this setup might be usefull for new mappers.

http://forums.thedarkmod.com/topic/14394-apples-and-peaches-obsttortes-mapping-and-scripting-thread/page__view__findpost__p__317949

 

http://wiki.thedarkmod.com/index.php?title=Creating_Automaps

 

I can also create a youtube video explaining it if the wiki is not clear enough.

Thanks for the response Sotha but the proguard thing was just an example. The character I actually have is "atdm:ai_merchant01" and I was wondering how I figure out what folder I should create so that it will work in game. As far as I know you have to have the exact folder for the respective AI in order to place the anim files inside correct?

 

And thanks for that example for the .def file!

 

This depends on what you want to do. If you want to replace an animation, you have to put it in the same location, which you can read from the entity definition of the ai it is used for. You can find the defs in the tdm_defs01.pk4. If it is an additional animation, you can place it where you want, but you will need to ship a changed def with your mission where it is referred to and maybe also a modified script file so the anim can be used.

 

If you can describe exactly what you want (in a pm if you want to avoid spoilers), I can help you a bit more maybe.

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 folder you put the md5mesh in doesn't matter at all.

 

What matters is the model definition you use. Most AI inherit the proguard modeldef, which is where most of the main animations are set (animations need shaders similar to sounds, as Sotha illustrated above).

 

If you only want one AI to do a specific animation, then you usually make a new modeldef for that AI. I did this in Reputation to Uphold for several AI if you want to see what it looks like.

 

Here's an example of one of the defaults that swaps one animation for another--when the code calls "idle_nose_wipe", characters using this modelDef will actually play models/md5/chars/guards/proguard/idle_armwipe.md5anim.

 

 

model tdm_ai_builderacolyte {

inherit tdm_ai_proguard

mesh models/md5/chars/builders/acolyte/tdm_acolyte_mesh.md5mesh

 

channel torso ( *Spine_Dummy)

channel legs ( origin Pelvis Pelvis2 *Hips)

 

//replacing animations that don't fit character

anim idle_nose_wipe models/md5/chars/guards/proguard/idle_armwipe.md5anim

anim idle_nosewipe_short models/md5/chars/guards/proguard/idle_shifting2.md5anim

anim idle_spit models/md5/chars/guards/proguard/idle_shifting1.md5anim

 

 

}

Link to comment
Share on other sites

Time for my next (hopefully easily answered) question:

 

I was getting a leak error in my sky prefab, which was well outside the rest of my map. It persisted when I deleted it, in the position that the prefab had been in. Possible explanations?

 

I've had another issue with leaks, on the same map minus the sky prefab. The first couple I plugged without issue. Right now I'm trying to deal with a persistent one. It maps the leak path, and I've gone so far as to create a brand new block (brush?) that plugged any conceivable holes in the path. It still persisted. Every possible combination of walls and floors along the path has been shored up. And I'm reasonably sure nothing is outside my current rooms (like ambient_world, etc.).

 

The only way I was able to "fix" the leak was with a massive brush that I hollowed out that encompassed everything. I assume this is an inelegant solution. Help is appreciated, as always.

 

Picture:

http://i.imgur.com/QMzTsy7.jpg

Edited by Digi

"Fancy burricks are afraid of dogs, if they encounter each other the dog barks and the burricks poop." - Thief: Deadly Shadows Game Designer

Link to comment
Share on other sites

Ouch. Leaks like that are frustrating.

 

First one (deleted skybox leak), is it possible something was filtered or hidden, such that deleting it all left a remnant? (A less likely explanation would be having deleted the vertices of something, leaving it's origin remaining.)

 

Second, you are correct that encompassing everything isn't a viable solution. There will still be an issue with sound, and the space will be rendered when it shouldn't be, negating the benefit of portalling areas.

 

However since surrounding it all sealed without a leak, that means there IS a leak that can be found within that space. What you might do is encompass just portions of it until you isolate where the leaking section is. I've done this to find leaks in my and others' maps by simply walling off part of a space, shifting that wall if necessary.

Edited by RJFerret

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

I don't know if I just missed it before, but the giant room around everything DIDN'T fix either one. Maybe I wasn't zoomed out enough the first time I looked. But something else is afoot.

 

I think the real lesson I'm learning here is about frequent backups and Pointfile checks. But thanks.

 

{edit} is it possible the Pointfile is lying to me? I restarted from an earlier save, remade the room, and can run it fine with no dmap leak errors. But when I run Pointfile, I'm getting the exact same path as before. There may have been a leak it wasn't showing me.

 

I got back to the point I wanted to be - with a working sky and functional outdoor room - so that's good. Just never figured out the original source of the leak. I'm sure it'll come back to haunt me down the line. But for now, Onward! I'm not too far from feeling comfortable with the tools and starting my own map instead of just following the tutorial.

Edited by Digi

"Fancy burricks are afraid of dogs, if they encounter each other the dog barks and the burricks poop." - Thief: Deadly Shadows Game Designer

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

    • OrbWeaver

      Finally got round to publishing a tutorial on baking normal maps in Blender, since most of the ones we have are inaccessible or years out of date.
      · 0 replies
    • 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
×
×
  • Create New...