Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

In addition to the death_script Tels added a ko_script /knockout_script spawnarg on AI, enabling mappers to easely call script functions once an ai has been knocked out.

  • 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'm trying to get an AI to 'relight' an electric light that is activated via a switch. I have succeeded previously when it comes to re-igniting torches, however, I cannot figure out what I'm doing wrong even after reading the wiki on this topic.

 

A short step by step guide would be greatly appreciated.

Link to comment
Share on other sites

For electric lights, use a light entity that has a model. Don't use the "light" entity.

 

Create a switch that's no more than 88 units off the floor.

 

Target the switch to the light so it can be used to turn the light on and off.

 

Give the light the spawnarg "shouldBeOn", with one of 3 settings:

 

0 - AI will comment if the light goes off, but will not become alerted or try to relight it

1 - AI will comment if the light goes off, and will try to relight it. The'll add to their alert level if the light's been off less than 10 seconds.

2 - AI will comment if the light goes off, try to relight it, and it will add to their alert level

 

That's roughly what the spawnarg does. There are some nuances that depend on the situation.

 

There is a randomness to relighting. AI might not always choose to relight. It might take them a few passes before randomness lets them relight.

 

A light can have multiple switches. If an AI decides to relight the doused light, he will use the nearest switch.

 

If the floor around the switch is cluttered with stuff, and there's no clear place for the AI to stand, the light will never be relit. Make sure there's room for an AI to stand.

 

If you still can't get it working, PM me the map and I'll look at it.

Link to comment
Share on other sites

There is a randomness to relighting. AI might not always choose to relight.

 

You can control the likelihood of a religh. Check the list of spawnargs starting with "chance_*" "chance_relight_lights" "chance_spot_lights" or something similar. Setting there to 1.0 will make a guaranteed immediate relight. Good for testing purposes and for AI that are doing something they certainly cannot do in the dark.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

  • 2 weeks later...

So I am having some problems with my custom sounds and folders and I was wondering where I made a mistake here.

 

So I used to have all of my sounds in "c:\games\darkmod\sound\" but now I moved them into the actual map folder as I want everything to be all in one so my sound folder is currently "c:\games\darkmod\maps\a\sound\" I fixed it up in Dark Radiant so everything works fine as at the start it didn't but I don't know how to change the folder in Dark Mod is there something special I need to do?

 

tl;dr my custom sounds work in Dark Radiant but not when I test the map in The Dark Mod

 

Thanks in advance!

Link to comment
Share on other sites

You have to use a project setup. This means, you have to create a folder for your FM in the darkmod/fms folder. The structure there is the same as in the main darkmod folder.

 

For example, if your folder is called mymission, you would place your map, proc, aas and cm file under darkmod/fms/mymission/maps, and your custom sounds under darkmod/fms/mymission/sound.

 

To get this loaded into DR, you have to set the last directory to your FM folder. For example, in your case you would have the folder structure:

  • Engine Path: c:/games
  • Mod (fs_game): darkmod
  • Mod Base (fs_game_base): darkmod/fms/mymission

To be able to start the mission in TDM and to dmap it and get the resulting files placed in your mymission/maps folder, you have to create a darkmod.txt file which contains

Title: ...
Description: ...
Author: ...

Do not mix up the order, or the mission will not load. In addition you need a startingmap.txt file containing the name of your map file (without the ending). Both files have to be placed under fms/mymission. Now you can simple start TDM, and install your mission via the mission list.

 

Note that you do not have to pack the mission each time you do so. Just keep everything unpacked while you are working on the mission, and only pack it if you are going to upload it.

 

I hope that helps. If anything is still unclear, just ask.

  • Like 3

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

You have to use a project setup. This means, you have to create a folder for your FM in the darkmod/fms folder. The structure there is the same as in the main darkmod folder.

 

For example, if your folder is called mymission, you would place your map, proc, aas and cm file under darkmod/fms/mymission/maps, and your custom sounds under darkmod/fms/mymission/sound.

 

To get this loaded into DR, you have to set the last directory to your FM folder. For example, in your case you would have the folder structure:

  • Engine Path: c:/games
  • Mod (fs_game): darkmod
  • Mod Base (fs_game_base): darkmod/fms/mymission

To be able to start the mission in TDM and to dmap it and get the resulting files placed in your mymission/maps folder, you have to create a darkmod.txt file which contains

Title: ...
Description: ...
Author: ...

Do not mix up the order, or the mission will not load. In addition you need a startingmap.txt file containing the name of your map file (without the ending). Both files have to be placed under fms/mymission. Now you can simple start TDM, and install your mission via the mission list.

 

Note that you do not have to pack the mission each time you do so. Just keep everything unpacked while you are working on the mission, and only pack it if you are going to upload it.

 

I hope that helps. If anything is still unclear, just ask.

 

 

Thank you!!! That works perfectly :)

 

Now I have a seperate issue though with a sound file not playing. Is there anything special that needs to be done to get a Stereo Ogg file to play?

 

All of my other sound files work great but for some reason if I play it using the speaker thing it doesn't work and it doesn't work for the info_location sound thingy (whatever its called).

 

I'm guessing I am missing something extra that needs to be done as this is the first file I have had to use that wasn't mono because the stereo clip of it is much better.

Link to comment
Share on other sites

Maybe you've encoded it wrong. The codex has to be "vorbis".

the info_location sound thingy (whatever its called).

It's called info_location. :P

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

Maybe you've encoded it wrong. The codex has to be "vorbis".

 

It's called info_location. :P

 

It's definitely encoded as vorbis and it even plays in the Dark Radiant editor. I just cannot get it to play playing the game though it's really weird. Every other file works fine and the only difference I can think of is the fact that it's stereo instead of mono.

 

Have you ever managed to get a stereo file working?

Link to comment
Share on other sites

Well, I made a cutscene with stereo sound, and there it works. And I think some of the stock files are stereo, too.

 

Can you post the soundshader here? Maybe a typo or so.

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

Well, I made a cutscene with stereo sound, and there it works. And I think some of the stock files are stereo, too.

 

Can you post the soundshader here? Maybe a typo or so.

 

Well I have tried creating a speaker with just that sound attached and once again it plays perfectly fine in DR and I even selected it from the list so that rules out misspelling and yeah no problems but as soon as I run DM and boot up my map the sound does nothing... God this is really weird :S

 

The file is 44100khz stereo ogg vorbis 160kbs

 

According to the wiki that is the right file type for it. What did you have yours set as?

Link to comment
Share on other sites

Well its supposed to play when you enter this area. I have set this up before and it works fine but for whatever reason it doesn't want to work here. The only thing I haven't done is test another stereo file to see if the problem is with that file or just stereo files. I will do this and report back

Link to comment
Share on other sites

I just tried it with a completely different stereo file and same problem happened.. nothing played.

 

What did you do step by step to get the stereo file working? as i'm guessing my problem lies with all stereo files not just this one

Link to comment
Share on other sites

Is there anything printed to the console.

 

I don't think you do have to do anything special with stereo files in comparision to mono files, at least I didn't.

 

If nothing works you can also pm me the file and an example map showing what you are aiming for, and I can try to dig out the issue.

  • 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

edit: ok I got it sorted. Turns out my file system was out of place for my maps which explains why the sound was working but the maps wasn't.

 

Thanks for your help man! :)

Edited by Goldwell
Link to comment
Share on other sites

How do you stop NPC's from doing this? The NPC starts off with the "sleeping 1" spawnarg however he sleeps through the bed... I have tried moving him upto a higher starting position and I have placed a monster clip around the bed but neither seem to make a difference. Is there a trick to this madness?

 

 

uf5KFR1.png

Link to comment
Share on other sites

Or you can put a small box of monsterclip on the floor next to the bed, to the position where you path_corner which sends the AI to the path_sleep. The idea is that you have an invisible box the AI steps on to and goes to sleep from there, ending up in a slightly elevated position, controlled by the height of the monsterclip box.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I'm going through Fidcal's tutorial - everything went well until I started to fiddle with the AI.

 

I created an ai_thief_01 and some path for him to follow. The problem is that it won't open any closed door - instead will just walk in circles in front of them. If they are open, it exits the room and closes the door behind itself just fine.

Link to comment
Share on other sites

Sounds like a broken portal problem, make sure you sink the portal into the walls around the doorway, it will cut itself down to the perfect size. If you do it by hand you often create tiny issues when the geometry is compiled.

 

Edit: If you still can't figure it out, zip and upload the map somewhere for us :)

Link to comment
Share on other sites

Sounds like the aas is out of date. Did you get any such warning? Did you try redmapping?.

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

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

      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 )
      · 1 reply
    • 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
       
      · 3 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...