Jump to content
The Dark Mod Forums

joebarnin

Member
  • Posts

    1086
  • Joined

  • Last visited

  • Days Won

    42

Posts posted by joebarnin

  1. Here's what I did. I took all of the .pk4 files from my \darkmod install, and unzipped them to a different directory, in this case c:\dm_all. (I use 7-zip, and it will extract multiple zips all in one go). So all of the pk4s are unzipped to a single folder hierarchy. If I'm looking for a file by name, I just use Windows search on c:\dm_all. But, if I want to search within those files, I use Textpad Find in Files functionality. I search the entire c:\dm_all folder hierarchy, limiting it to the following file types: *.vfp *.skin *.map *.pfb *.mtr *.def *.script *.sndshd *.prt *.xd *.lang *.gui*. It takes a minute, but that way I can find descriptive text, and also objects that are defined in text files. For example, let's say you are interested in atdm:ai_builder_priest_combatant. You won't find a file with that name, but if you search within text files you'll find that entity defined in the file 'tdm_ai_builder_priest.def'.

    It's important to limit the file types because otherwise it searches through all of the graphics files which is a waste of time.

    Anyway that's what I do. Maybe there's a better way.

  2. 9 hours ago, Dragofer said:

    This is something I used for a custom AI script in an early alternate version of Down by the Riverside (Tales of the Riverside), which you can find [url=http://forums.thedarkmod.com/index.php?/topic/18402-fan-mission-down-by-the-riverside-by-dragofer-20160925/&do=findComment&comment=407828]here[/url].

    The script is able to make an AI stop patrolling upon reaching its next path node. If you want the AI to stop immediately it would involve teleporting the path_corner to an inaccessible location, as I recall it.

    (I was aware of the StopMove event but in my experience it only caused the AI to twitch while carrying on with its patrol. Might be good for a free-roaming AI like a zombie though?)

     

    Good ideas, thanks. I was trying to stop the patrol as a work-around for a glitch (bug?) that I am seeing. Here's the scenario: I have an AI on patrol that I want to temporarily 'hide', then eventually return. The hide() method doesn't seem to work - he's still there, you just don't see him. So (at Event A) I use setOrigin() to move him to a blue room. At a certain point (Event B), I call setOrigin() again to return him to the world. This works fine, if the AI was not on a patrol. But, if the AI was on a path/patrol, sometimes he'll hang out in the blue room for a short time (20 seconds?), and then he'll suddenly disappear and show up somewhere else in the map (usually with falling damage). 

    This problem doesn't always happen, but it only happens when the AI is on a path. So my assumption is that the path code gets confused after the setOrigin, and sometimes tries to move the dude incorrectly. I was just trying to avoid this problem by cancelling the patrol just before moving him.

    I'm actually rethinking this entire scenario, to destroy() the AI instead of moving him (at Event A), and then recreating a duplicate AI at Event B.

  3. 20 hours ago, demagogue said:

    Is it possible to delete it and spawn a new one at the new location?

    Yes, that would work. The problem is, what if the player extinguished the candle before the script moved it? Spawning a new one will relight it. I can't tell if there are script calls to determine if a light is extinguished (in which case I could spawn it either lit or extinguished).

  4. (the previous post was me too).

    I'm trying to move a light using a script call (e.g., $myLight.setOrigin(newLocation)). Works fine for most lights, but for candles in holders (for example, atdm:moveable_holder_round_plus_candle) it moves the holder, but not the candle itself. Probably something to do with the fact that atdm:moveable_holder_round_plus_candle entity has a "def_attach" of the candle itself (atdm:moveable_candle_default) - the def_attach'ed candle is what isn't getting moved by the setOrigin call.

    Has anyone run into this before? Any ideas?

  5. I'm not an expert, but looking at the code, I think 0 is the best you can do. As you mentioned, +5 gets added. There is a setting to override the +5, in darkmod.cfg

     

    seta tdm_lp_base_count "5"

     

    But in the code, if this value is less than 5, it looks like it gets set to 5. So, at least by my reading of the code, setting it less than 5 doesn't do anything. But you can try it and see if it works.

     

  6. I'm trying to make an Objective of having the player put an object in a certain location. I've been banging my head against the wall for 3 hours on this, I just can't get it to work. I followed these instructions, and I also looked at several other FMs. For the life of me I can't figure out what I'm not doing right. I've got an entity with "objective_ent" "1", and a nice big info_tdm_objective_location, and the Objectives set up just the way the documentation says. But when I put the object in the location, nothing happens (the objective is not met).

     

    Has anybody run into any 'gotchas' trying to get this to work?

  7. Not sure where to best to post this, but here's a recent experience with dmap causing a crash. I was working on a map, and all of a sudden, dmap started crashing (TDM vaporized, no error dialog or anything). I turned on qconsole.log (seta logFile "2" in darkmod.cfg), and the last entry in the qconsole.log was:

     

    [store AAS]
    This made me think it had something to do with pathfinding/AAS. Luckily I had a backup version of my map from a few hours earlier. I compared the two, and one of the big changes in the 'bad' map was that I added a bunch of Monster Clips (which of course affects AAS). Though a tedious process of elimination, I determined that one specific Monster Clip was causing the crash. I have no idea why; it was more-or-less identical to several others in the same area (each surrounding a bench in row of benches). I remembered reading something about this, so I made the brush one unit larger in each direction, and the crash went away. Go figure.
    Anyway, just thought I put this out there for future searching.
  8. I'm doing something similar in my mission. What I found is that you have to create a new particle definition. Let's say you want to make a green candle flame (based on light_candleflame). First, in your custom def file, define:

     

    entitydef light_candleflame_green
    {
    "inherit" "light_candleflame"
    "model_lit" "tdm_fire_candle_glare_green.prt"
    "_color" "0.10 0.8 0.1"
    }
    _color will make the light that is cast green. The "model_lit" is the key to making the flame itself a different color. It needs to point to a new particle definition (the default is "tdm_fire_candle_glare.prt", which is yellow-orange). You can use the Particle Editor in DR (Entity > Particle Editor) to clone tdm_fire_candle_glare to tdm_fire_candle_glare_green (you'll need to create a custom .prt file). Then you can modify each of the Stages of the new particle (the Shader tab lets you mess with the color). You probably want to Toggle Visibility of the stages to see each one individually.
    Hope this helps.
    • Like 1
  9. I don't know what's causing this. In similar situations, when I'm desperate, what I usually do is search all of the mission text files for the string in question. For example, use Textpad, Find in Files feature, search for "map", include subfolders, files with these extensions: *.vfp *.skin *.map *.pfb *.mtr *.def *.script *.gui *.xd. You'll get a bunch of hits but maybe one will explain what is going on?

  10. One idea: open your <mission>.map file in a text editor (e.g., notepad). Search for "atdm:map_of" and see if there is more than one entity of that type. That will at least confirm that there is only one map_of entity.

     

    I remember having to make my lute player stone deaf and blind as a bat in my first mission to pull it off haha.

     

    I'm now beta testing my newest mission, and we've run into a bug where the player spawns with two area maps. One called "map" and the one that I have defined in the game with an "atdm:map_of" entity. Does anybody know what the issue could be? I've looked through my entity list and it doesn't appear that I have two map_of entities in the editor. It's also not an item that can be bought in the store. I'm completely stumped on this one, even though it does sound kind of familiar like I had the same or similar problem with my first map. -_-

     

    • Like 1
  11. re: the lute issue. I just did a few tests, and it looks like removing a speaker doesn't work - the sound keeps playing. I made a trigger_once that called a script, and the script called $myspeaker.remove(). Just like you noticed, that didn't work. The workaround I came up with was to just move the speaker to a far away 'blue room' (inaccessible to the player) using $myspeaker.setOrigin(). That effectively silences the speaker.

     

    How to put away a quill?

     

    I have an AI doing several things, including writing with a quill.

    How can I achieve that the AI puts away the quill when not writing respectively doing other things?

     

    attachicon.gifwrite_like_the_wind.jpg

     

     

    How to mute the lute?

     

    This one is driving me crazy.

     

    attachicon.gifand_the_band_played_on.jpg

     

    I have added a location brush on the floor (A) in the entire room. When the lute player gets alerted, he drops the lute. I tried to mute the belonging speaker via the objective editor with if item with name "lute" is in location "A", then trigger entity func_remove xxx to remove the speaker. Does not work.

     

    Then I tried objective: do alert lute player to level 5, then trigger entity func_remove xxx to remove the speaker. Does not work as well.

     

    Is there a standard way to do that?

     

    This is so strange, because I know that it definitely works with acquiring items, but I cannot reproduce it with other objectives.

     

  12. Is there a script call to determine whether the player has a certain object in his inventory? Specifically, there are two objects involved. Player has Object1 in inventory, and they Use it. Object1 has a custom scriptobject defined, and the inventoryUse() method is called. All of that works fine. But within that method, I want to determine whether the player has Object2 in his inventory. I looked through the script reference, but so far I'm not seeing it.

  13. I'm getting some weird shadow things. Here is a video:

     

    If I change the light to a simple ambient light, the shadows go away. I don't see any stray brush or entity that might be causing this, and also the way that it moves as the player walks is interesting. Does this look familiar to anyone?

  14. I'm no expert, but here's an idea, if you can't figure out a better solution. Create a separate NPC for each trigger_once (identical NPCs, but separate entities). Each NPC uses a unique patrol. Each trigger script kills off the other NPCs. That way you get a unique path depending on the trigger_once. Kludgy, but if you can't come up with a better way...

     

    Hey I had a question. So I have a scenario where I have an NPC being teleported from black box into the map. However depending on what trigger_once the player uses, I need it to modify the starting path the NPC starts to patrol on. Still getting the hang of this method as my brain still works in Source Engine I/O direct entity events.

    So yeah to recap I just need to be able to assign a different path depending on what trigger is targeting the NPC. Thanks!

     

×
×
  • Create New...