Jump to content
The Dark Mod Forums

Recommended Posts

Posted

Thanks for the respones guys however I haven't had any luck solving my push-the-player-water-flow problem.

 

I just had a look at both maps but the flowing water doesn't carry the player. I'm looking for water that moves the player if they're in it.. like a really fast stream. Looking at the wiki the only thing i've found about a water stream is the follow wiki article however setting everything up like that doesn't seem to do it. When the player touches the func_forcefields they just slowly sink into it and not much else happens. http://wiki.thedarkmod.com/index.php?title=Func_Forcefields

 

I guess i'm missing something but I just can't think of what :/

  • 2 weeks later...
Posted

Now that I got DarkRadiant working and started creating a level, I have one such question: How do I make a func_static model solid?! I set the "solid" key to "1", the help field confirms I got the right property. Yet if I save the map then compile with dmap then start a new mission, there are still no collisions and I go right through it. If it has any importance, the model I'm trying this with is models/darkmod/architecture/pier_platform01.lwo.

Posted

I placed it in a test map and it was solid for me.

 

Materials are textures/darkmod/wood/boards/timber_ends and textures/darkmod/wood/boards/pier_platform -- which look quite ordinary.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

Now that I got DarkRadiant working and started creating a level, I have one such question: How do I make a func_static model solid?! I set the "solid" key to "1", the help field confirms I got the right property. Yet if I save the map then compile with dmap then start a new mission, there are still no collisions and I go right through it. If it has any importance, the model I'm trying this with is models/darkmod/architecture/pier_platform01.lwo.

 

That model (and prolly nearly all models) are solid by default, w/o us having to set the "solid" spawnarg to "1".

 

Perhaps you've manually set "noclipmodel" to "1" by accident?

Posted (edited)

That model (and prolly nearly all models) are solid by default, w/o us having to set the "solid" spawnarg to "1".

 

Perhaps you've manually set "noclipmodel" to "1" by accident?

 

Just checked... no. If it might have importance though, I scaled them to twice their size (via the rotation flag), and also surrounded them with a Monster Clip brush (for safer AI navigation)... I'll try without those as well.

Edited by MirceaKitsune
Posted

 

Just checked... no. If it might have importance though, I scaled them to twice their size (via the rotation flag), and also surrounded them with a Monster Clip brush (for safer AI navigation)... I'll try without those as well.

 

Yes, that's the problem. The collision model doesn't scale, so you're falling through the section of the model that has no collision model.

 

You can surround the entire model with a common/tdm_nodrawsolid_wood brush, and that'll make both the AI and the player happy.

Posted (edited)

Yes, that's the problem. The collision model doesn't scale, so you're falling through the section of the model that has no collision model.

 

You can surround the entire model with a common/tdm_nodrawsolid_wood brush, and that'll make both the AI and the player happy.

 

Yep... just noticed the problem went away once I removed the scale. Surprised that collisions for scaled models can be a problem, but I can live with that.

 

Also they seem to have a good collision box by default, so maybe there's no need for brushes. I thought they would break footstep sounds, but if there are solid nodraw types for every material (eg: wood) that's fine.

Edited by MirceaKitsune
Posted

You'll most likely get wrong shadows as well with a scaled model. You should make them noshadow 1 too.

Posted

I have another one: How do I create a guard that's drinking on duty, as I've seen in several missions? I already enabled the "drunk" flag in the AI tab... but that doesn't put a bottle in the AI's hand and make them occasionally drink from it, nor does it seem to give them the incoherent speech.

 

On the same topic, where do I find bottle props to put on the map? I looked around the entity and model browser, but couldn't find any beverage bottles that I could place.

Posted (edited)

Incoherent speech -- try giving the AI an atdm:ai_vocal_set_grumber_drunk_01 or atdm:ai_vocal_set_drunk_* vocal set.

 

Bottle prop -- try atdm:prop_winebottle or atdm:prop_winebottle_sit_and_drink in the darkmod/Props entity folder. Judging by the descriptions, one needs to be attached, the other placed in the map.

 

Ordinary bottle models are under darkmod/kitchen in the model browser, with names like bottle01.lwo, wbottle01.lwo and wine_bottle02.lwo. There are also moveable bottles in the entity tree under darkmod/Moveables/Kitchen; they tend to have an atdm:moveable_kitchen_ prefix.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

How would you go about making an entity respond in a particular way to particular kinds of attack, including melee attacks? (E.g. to make something cuttable but immune to arrows and blunt weapons.)

 

Apparently the Dark Engine uses S/R for this, e.g. slashable banners respond to the slashStim which Garrett's sword applies on a hit. TDM's S/R doesn't have built-in equivalents to slashStim, pokeStim, etc. (there's a STIM_DAMAGE, but I think weapons apply their own damage/melee defs instead of applying the stim) and stims can't be trivially added to melee attacks, although it's possible with scripting (see responses to my earlier question about making a melee attack apply STIM_HOLY).

 

I wondered about SIG_DAMAGE but I don't see a way to get the entity the signal came from.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

I've come across two more things I can't find an easy answer to, which I'm planning to use in my mission once I finish the map itself:

 

First is how to make a group of AI's appear when an event is triggered; I'm going to have a button, and when it's pushed I want it to complete an objective but also cause several AI's to appear in places around the map. The AI can either be spawned / created at that time. Or maybe they can be unleashed from behind a door that was previously locked... in this case I'll simply have the door open, and maybe the previously hidden AI wake up from sleeping? I'd like to know how to do this both ways if possible! The biggest problem is that once the AI are released, I want them to patrol across a set of paths... while I know how to do this for an AI that's always there (just target a path_corner), I don't know for an AI introduced later by an event.

 

And my second question was how I can make reading a book a requirement to unlock a door, additional to finding its key. I want it to require that the player reads a journal, which will also say something like "you must pull slightly on the key because the lock is broken" so this restriction makes some sense. In practice this is to keep the story from progressing if you don't read that journal, and to not lett the player access the next area until they've read what it's about.

Posted

There are several ways to go about the first one, e.g. involving a teleporter, but regarding the pathing aspect http://wiki.thedarkmod.com/index.php?title=Path_Nodes#path_waitfortriggermight be useful.

For the second, it should be possible to use a hidden objective: http://wiki.thedarkmod.com/index.php?title=Objectives#Non-AI_Componentslists readable_opened, readable_closed and readable_page_reached.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

How would you go about making an entity respond in a particular way to particular kinds of attack, including melee attacks? (E.g. to make something cuttable but immune to arrows and blunt weapons.)

 

Apparently the Dark Engine uses S/R for this, e.g. slashable banners respond to the slashStim which Garrett's sword applies on a hit. TDM's S/R doesn't have built-in equivalents to slashStim, pokeStim, etc. (there's a STIM_DAMAGE, but I think weapons apply their own damage/melee defs instead of applying the stim) and stims can't be trivially added to melee attacks, although it's possible with scripting (see responses to my earlier question about making a melee attack apply STIM_HOLY).

 

I wondered about SIG_DAMAGE but I don't see a way to get the entity the signal came from.

 

I'm guessing no-one's done this before, but our Stim system is designed to be user-extendible. All the stim types and effects are defined in the game files. Stim numbers 1-999 are reserved for game expansion and mappers are supposed to use numbers 1000 and above to define their stims, to avoid all possibility of clashes with future core game expansion. You can also define your own damage defs. I appreciate that's not much help, but I've not actually worked out how it all works.

 

I have a python script that searches through a TDM installation, looking inside both the game pk4s and all fm pk4s. It's good for finding out whether someone has done something before, and where to find the file. If you tell me what to look for I'll have a look. Or I'll share the script if you are ok with running a python script and using simple regular expressions for searches. I keep meaning to put a windowed interface on it but never got round to it.

Posted

 

I'm guessing no-one's done this before, but our Stim system is designed to be user-extendible. All the stim types and effects are defined in the game files. Stim numbers 1-999 are reserved for game expansion and mappers are supposed to use numbers 1000 and above to define their stims, to avoid all possibility of clashes with future core game expansion. You can also define your own damage defs. I appreciate that's not much help, but I've not actually worked out how it all works.

 

I have a python script that searches through a TDM installation, looking inside both the game pk4s and all fm pk4s. It's good for finding out whether someone has done something before, and where to find the file. If you tell me what to look for I'll have a look. Or I'll share the script if you are ok with running a python script and using simple regular expressions for searches. I keep meaning to put a windowed interface on it but never got round to it.

The tricky bit isn't defining a stim but that I don't know of any way to apply it via melee attacks, other than with a script like the one you gave me for the priest's holy fire; presumably in this case I'd be investigating modification to the player's sword weapon script for a STIM_SLASH, etc. Suppose I did make a slashable banner: any mission that used it would have to override the default sword script. That's why I thought it was worth asking whether anyone knew another way for an entity to 'know' how it was damaged. (Maybe I should make another feature proposal out of this TTCBI post?)

 

Obsttorte has talked about making a melee weapon that applies STIM_FIRE, though I don't know whether he did.

 

Feel free to post the script. :smile: Is it 2.x or 3.x?

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

But shouldn't there be an information, how the player attacks? For AIs to parry correctly, the information should be given, when the player attacks, so the right parry can be used. Maybe this could somehow be used for the STIM?

Posted (edited)

Is that information exposed anywhere scripts can access it?

Edit: maybe getMeleeActType() and getMeleeLastHitByType()?

(It looks as though getMeleeLastHitByType() and getMeleeLastActTime() may have their definitions swapped around in the documentation.)

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

Feel free to post the script. :smile: Is it 2.x or 3.x?

The script is python 2.x. You set the 3 constants at the top -- path to your darkmod folder, the file types you want to search, and your search term -- then run it.

 

I've currently got it set up just to look for "lantern" in scripts and def files. But you can use regexes for some sophisticated searches.

 

 

 

"""Search text files in FMs and TDM assets"""
import re, os, fnmatch, zipfile

PATHS = [ r"C:\darkmod" ] #, r"E:\dm-dev\campaign"]  
FILE_EXTS = ['.def', '.script'] # '.mtr', '.prt', ,'.skin','.fx','.md5mesh','.pfb', '.anim', '.md5anim','.gui','.map','.script','.gui','.def'
SEARCH_PTN = r'lantern' # regular expression

def searchPk4(pk4, exts):
    """Look in a pk4 archive and yield files with any of the extensions
    in exts. Returns ( filename, filecontents ). filename includes any
    directory path internal to the archive.
    
    pk4: full path, e.g. r'E:\darkmod\tdm_defs01.pk4'
    exts: list or tuple of bare extensions, e.g. ['def', 'mtr']
    """
    f = zipfile.ZipFile(pk4, 'r')
    for member in f.infolist():
        ext = (os.path.splitext(member.filename)[1]).lower()
        if ext in exts:
            yield member.filename, f.read(member)

def findTDMFiles(paths, exts):
    """Yield tuples: (filepath, filecontents) of all files
    found in paths with any of the extensions in exts. Looks inside
    pk4 archives, but not nested archives.
    
    paths, exts are sequences containing one or more paths / extensions.
    """
    for path in set(paths):
        for root, dirnames, filenames in os.walk(path):
            for ext in set( ['.pk4'] + exts):
                for filename in fnmatch.filter(filenames, '*'+ext):
                    fpath = os.path.join(root, filename)
                    if ext == '.pk4':
                        for internalname, content in searchPk4(fpath, exts):
                            yield ( fpath + ' -> ' + internalname,   content )
                    else:
                         yield fpath, file(fpath).read()

if __name__ == '__main__':
    search_regex = re.compile(SEARCH_PTN, re.IGNORECASE)
    context_regex = re.compile("[^\n]{0,250}(" + SEARCH_PTN + ")[^\n]{0,250}", re.IGNORECASE)

    result = '\n~~~~~ RESULT:\n'
    for fname, text in findTDMFiles(PATHS, FILE_EXTS):
        print "Checking " + fname
        refs = search_regex.findall(text)
        if refs:
            print '***** %s *****' % fname
            result += '***** %s *****\n' % fname
            for r in context_regex.finditer(text):
                print r.group().strip()
                result += r.group().strip() + '\n'
    print result

 

 

Feel free to put forward your feature proposal if you figure out the best way to set up your weapon. Or if you find some more clues. You have me scratching my head about game mechanics that I don't know right now :)

  • Like 1
Posted

Another basic question with no visible answer: I created an atdm:readable_immobile_sign_small01 entity, which is a sign with visible text that you don't need to click on to read. How do I put text on it thought? I tried page1_title and page1_body but nothing, and the readable editor doesn't seem to set it up either.

Posted (edited)

Haven't tested it, but try "gui_parm1" "your text here".

http://wiki.thedarkmod.com/index.php?title=Text_Decals_for_Signs_etc.#The_Decal

Edit: it may also need "gui" "path/to/gui" as per the link above.

Edit: okay, got it working. Suitable GUIs are in the /guis/readables/sign_text_decals/ directory inside tdm_gui01.pk4. So use something like:

"gui" "guis/readables/sign_text_decals/sign_text_camberic.gui"
"gui_parm1" "put text here"
Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

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

    • snatcher

      Author of the Visible Player Hands mod: please come forth and collect a round of applause!
      · 2 replies
    • nbohr1more

      Holiday TDM Moddb article is now up: https://www.moddb.com/mods/the-dark-mod/news/happy-holidays-from-the-dark-mod
      · 0 replies
    • nbohr1more

      Cool thing: Thanksgiving break means I don't have to get my son up before dawn

      Not cool thing: My son stays up all night on my PC so I don't get much TDM time...
      · 3 replies
    • datiswous

      Does anyone know if the mission/map in this video posted by @Springheel can still be found somewhere and played? Looks like fun.
       
      · 2 replies
    • taffernicus

      I'm curious about doom and thief multiplayer netcode 😂 or how these games handle networking for multiplayer in general
      a youtube channel called battle(non)sense sometimes posts about netcode analysis
      · 2 replies
×
×
  • Create New...