Jump to content
The Dark Mod Forums

SteveL

Member
  • Posts

    3666
  • Joined

  • Last visited

  • Days Won

    62

Posts posted by SteveL

  1. I had one more myself, which I'll likely be using in the future: How do I cause an event to change alliances... turning previously friendly AI's against the player once he completes an objective, or contrarily making hostile AI's join the player? Can the "team" key be changed by a trigger, or perhaps alliances between teams modified by another entity?

     

    While at it I had a similar question: How can an event alert all AI's on the map? A Score to Settle does this, when a guard yells to raise the alarm and virtually every NPC starts running around the map looking for you... I'm not going to open the map however, because finding entities in big complex levels without knowing where to look rarely seems to work for me.

    1. atdm:target_setteam and atdm:target_setrelations

    2. I guess you could use an alarm that's silent to the player. There may be better / other ways.

  2. I don't know anything about speaker set up so I'll wait for you or someone to tell me when there's been enough discussion :) I could add a "volume_cvar" spawnarg for all speakers in about 5 mins. It'd just override the default "s_volume" and still be overridden by special setups like atdm:voice's script object, so it wouldn't change the behabviour of any existing speakers.

  3.  

    You're right, that makes no sense. You can't play two narrations at the same time, and you wouldn't use this method for a conversation, because each line has to be triggered separately.

     

    You can already create narrative voices by just linking a regular speaker to a trigger and giving the speaker the qualites of "omni" and "global". The only benefit I can see to using the atdm:voice entity is so that the narrative speaker volume can be controlled by the main menu. It's actually MORE time consuming to set it up with a atdm:voice entity, since there are three entities involved instead of 2, so I'm not even sure the net benefit is worth it.

     

    Isn't there a way to just designate a regular speaker entity as "this speaker is controlled by the Player volume slider on the main menu"?

     

    I suspect there isn't a built-in way, but it could be done with one line of script at map start.

     

    Or we could add a built-in way. Maybe add a spawnarg for speakers that lets them specify a cvar where they get their volume? Quick work if people think that's how it should work.

  4. Good project. There are a few things in the tutorial that are outdated. Some keyboard shortcuts that are different in DR nowadays for example, as well as the overly manual methods that you're talking about above. I'd say don't let that hold you up though. If you work through it as you're translating it you can fix things and ask here for anything that's unclear. And when you're done we can use it to update the original :)

  5. You can almost certainly tweak the volume on the atdm:voice entity too.

     

    atdm:voice is just the standard speaker entity with s_global and s_omni set to 1, and with a default s_volume of 60.

     

    Edit: Oh, and with a script object too, which I guess is kind of important to its behaviour :)

     

     

     

    entityDef atdm:voice

    {

    "editor_displayFolder" "Sound"

    "inherit" "speaker"

    "scriptObject" "tdm_voice"

     

    "s_looping" "0" // does not loop

    "s_global" "1" // is a global speaker

    "s_music" "0" // is not music

    "s_volume" "60"

    "s_omni" "1" // omnidirectional

     

    "editor_usage" "Place one in your level, then link it from any 'atdm:trigger_voice' (under Targets) entity."

    "nodraw" "1"

    "solid" "0"

     

    "editor_color" "1 0.5 1"

    "editor_mins" "-4 -4 -4"

    "editor_maxs" "4 4 4"

    }

     

     

     

    edit2: the script object ignores the spawnarg. It uses the game menu slider level plus the sound level in the shader. Maybe the game takes account of the s_volume spawnarg and maybe not, I can't tell just from reading the code.

  6. I have no idea what the difference between "as_player" 1 and 0 is though. "If the speaker (from off) should say things" What does that mean? Is it just the difference between having the sound affected by the Player menu slider or not?

    Yes, apparently, according to the notes in tdm_voice.script, that spawnarg controls which menu setting controls the volume: player voice volume or ambient volume.

  7. The dev team are working on some projects that we originally planned for 2.04 but are likely to take a few months more. In the meantime, it's 8 months since the last release and we have quite a few bugfixes piled up, so we're thinking of attempting a minor bugfix release. I say "attempting" because it will mean splitting off a release version from the current development build, which we haven't done before. And splitting the list of bugs on the roadmap for 2.04 between 2.04 and 2.05.

    To current mappers: I know that some of your projects rely on bugfixes. I've sent out patches to several mappers for scripts and def files. Most of those are already fixed, but could you please have a look over the current roadmap and outstanding bugs? And post here or PM me with any bugfixes or minor features that need to be in place for your maps?

  8. @Biker or anyone:

    When Biker and SirTaffs were at my place a few weeks ago, Biker played a video voiced by (I think) Mortem Desino of two guards in TDM having a conversation. I can't find it by googling or searching youtube. Can anyone help?

     

    It'd be worth a repost in any case. I'd never seen it until then after nearly 2 years on the forum.

  9. 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
  10. 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.

  11. I don't know how Moonbo did it. He replied to your thread but couldn't remember the details. You could always unzip the FM pk4, study how he did it all, then let us know :)

     

    You might also want to take a look at Obsttorte's Hitman-style gameplay scripts, which make all AI neutral unless they see you commit a crime. There are instructions at http://wiki.thedarkmod.com/index.php?title=AI_behaviour_depending_on_player_actions, and the discussion on it (and the script's evolution) is spread throughout his gameplay modification thread at http://forums.thedarkmod.com/topic/14394-apples-and-peaches-obsttortes-mapping-and-scripting-thread

  12. Keeping an interested eye on this thread :) One request, if at all possible please keep your commits as separate as possible, to make it possible for us to absorb and test stuff we can use back into the trunk. It was too hard last time round to isolate the changes that led to certain side effects like low perf on AIs and decal problems. I know you did that last time, but you'd already done lots of changes before you had a branch to work on :-/

  13. Those food items are probably not usable. It's up to the mapper what can be done with food. NB food doesn't confer any advantage in TDM currently, although it'll restore 1 health by default in the next release. But you don't need to worry about it either way. It's placed for atmosphere rather than usefulness.

×
×
  • Create New...