Jump to content
The Dark Mod Forums


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by kingsal

  1. Spooks- I tried your script out and it works really well and is much cleaner. It also works with being locked and having a froblock attached to it. Thanks so much! Obs- That would definitely be a more solid solution and friendlier to the mission designer. It would be nice to be able to select the items as spawnargs inside darkradiant. There is one small advantage to each chest having its own script, you can make edits to its contents without digging around for it in the editor. If for instance, you wanted to quickly balance the items across the entire map. Thanks guys for the help!
  2. Hey Guys, I apologize ahead of time, I am a novice at scripting. I am trying to create a thief-style chest; one that when opened, the items are automatically dumped into the player's inventory. I have pretty hacky prototype. Once the player frobs open the lid (atdm:mover_binarymover_base), it targets a func_callscriptfunction. I have a hacky Stim/response that removes the lid's targets when frobbed. This prevents the player from getting items every time they open the chest. The problem is when I try to lock the lid or attach a froblock, it breaks and nothing happens. The lid doesn't seem to like having other entities bound to it or target it. Any suggestions or help would be awesome? Thanks a bunch guys. EDIT (Solved). Thanks for everyone's help with this. Here is the .script and .def for anyone who is interested in using this in their FM. Here is the script by SteveL: #ifndef AUTOLOOT_CHEST #define AUTOLOOT_CHEST //Script for autoloot chest by SteveL // Spawnargs: "random_spawn", "random_chance" //"random_spawn" = name of inventory item. (example "atdm:ammo_gasarrow") //"random_chance" = Probability of spawn. (0 to 1) void autoloot_chest(entity chest, boolean bOpen, boolean bLocked, boolean bInterrupted) { // Fire only if map has been open 3 seconds (avoiding map initialisation) and // only the first time the door/lid is fully opened. if ( sys.getTime() > 3 && bOpen && !chest.getBoolKey("already_opened") ) { chest.setKey("already_opened", "1"); // Search through "random_spawn" spawnargs, and find a matching "random_chance" spawnarg string key = chest.getNextKey("random_spawn", ""); while ( key != "" ) { float chance = chest.getFloatKey(sys.strReplace(key, "_spawn", "_chance")); float r = sys.random(1.0); if ( chance > r ) { entity newItem1 = sys.spawn(chest.getKey(key)); newItem1.addItemToInv($player1); sys.wait(1.0); } key = chest.getNextKey("random_spawn", key); } } } #endif And the def file: Be sure to replace the YOUR FM with your fm's directory. //++++++++++++++++++++++++Frob Chest++++++++++++++++++++++++++++++ //Auto Loot Chest //Uses script "autoloot_chest" by SteveL //Spawnargs: "random_spawn", "random_chance" //"random_spawn" = Name of inventory item. (example "atdm:ammo_gasarrow") //"random_chance" = Probability of spawn. (0 to 1) entityDef frob_chest_lid { //editor stuff "inherit" "atdm:mover_binarymover_base" "editor_displayFolder" "YOUR FM/autoloot_chest/" "editor_usage" "Auto loot chest. Random_spawn = name of inventory item. (example: atdm:ammo_gasarrow). Random_chance = Probability of spawn. (0 to 1)." "editor_color" "1.00 0.82 0.29" "spawnclass" "CFrobDoor" //model "model" "models/darkmod/containers/openable/footlocker_wood_lid.ase" //sound "snd_open" "chest_wood_open" "snd_close" "chest_wood_close" //movement "rotate" "0 0 -80" "move_time" "0.4" //interaction "frobable" "1" "locked" "0" "state_change_callback" "autoloot_chest" } //Chest Body entityDef frob_chest { //editor stuff "inherit" "atdm:entity_base" "spawnclass" "idStaticEntity" "editor_displayFolder" "YOUR FM/autoloot_chest/" "editor_usage" "Auto loot chest." "editor_color" "1.00 0.82 0.29" //model "model" "models/darkmod/containers/openable/footlocker_wood.ase" //other stuff "solid" "1" }
  3. Biker- This problem puzzled me for a while. I ended up adding naturalmatscale 1 to my def. I also did a bunch of trial and error to get the placement and ratios to work okay in the windowdef. See below My map file are sizes are 2048 x 1536 TGAS. I think its worth the extra cost to get a nicer, more detailed map. However, I've only tested it on 16x9 screens Nbohr1more's method seems pretty solid though. Have you had a chance to test it?
  4. Hey Guys! I don't know enough about scripting to read Stumpy's post without trying it out in-game, but I will certainly test it out once I hook up the script. Yeah I imagine the sequence is checked after the three candles are lit and extinguishes all three of them if they are incorrect. This way the player can keep trying different sequences and then realize they need a clue to solve the puzzle. (Light candles in this order readable). The two outcomes would ideally fire a trigger_relay. I have them currently set up this way: torch_relay_correct- Plays a sound or signal to the player that they've done the sequence in the correct order and triggers a hidden objective. torch_relay_incorrect- Resets the candles by extinguishing them. Although this might be handled in the script itself? So in effect, the player will keep trying combinations of three until they've done it correctly (ideally lighting and relighting the same candle will not count towards the combination, unlike it would in a keypad for instance with combo 112)
  5. Hey All, I am working on a puzzle for my level in which the player must light 3 torches in the correct order. If they light them in the wrong order the puzzle resets. If they extinguish any of the torches the puzzle resets. I attempted to do it through the objectives menu, but ran into trouble. I currently have stim/responses set up on all three torches to know when they are lit or extinguished, but I can't seem to figure out a way to make the sequence puzzle part work. Does anyone know of a way to do this using scripts or a series of entities. The help would be very much appreciated! Thanks so much!
  6. Hey guys, I found two console commands that work: logFileName = yourfilename.log Sets the name of the logfile that shows up in your fms folder logfile = "1" Starts dumping the console lines into the log file. SteveL- Looks like you don't need "com" at the beginning.
  7. Awesome! Thanks for the help Steve. I definitely see a lot of node without volumes and most of the time they don't seem to affect anything. However, once I checked the log, I did find some strange entities in my map that were invisible in the editor. They only show up as an origin point when I selected them. I deleted those and it seemed to improve performance in certain areas.
  8. Hey all, When I compile my map, I see some red "node without volume" errors appear as its compiling. However when I scroll up in the console I don't see them. I've tried dumping the console to a .txt and haven't been able to find the error lines there either. Is there a limit to how many lines the console will show? Is there a way to show all the previous lines? Any help would be great! Thanks!
  9. Another question I came across: I wanted to have anAI pick up the wine bottle (formerly the pot) and drink from it after the player puts the laxative in it. Currently I have the AI move to the bottle location and play the bottle_pickup animation which automatically picks up the wine bottle. However, the AI sits during this animation which looks pretty funny. Is there a way to play the standing animation use_right hand and then attach the wine bottle in the same fashion as bottle_pickup would? So the AI walks up to the bottle, plays use right hand, and the bottle attaches naturally? Thanks for the help!
  10. Very cool! In addition to adding a decal and some floor geometry, you might try placing a few random junks of coal around the floor to give some variation? Like pieces that sort of flew off. Might help it to feel like this super dirty coal room. The coals could also sort of bunch up around pillars and corners. -K
  11. Obs- Great! Yeah I would love to see what you've done there. I have something temporarily set up, but I'll ping you when the time comes. I agree, the map has very little detail. I'll commit to that once I've blocked everything out. This way I'll prevent a lot of art re-work if something changes. Stumpy- Hello! I do have an objective attached to it. I did try something where the player removed the vial and drops it into the pot and once the item is within that volume, it fired the objective.. This solution felt pretty immersive but created some problems in that I don't use that convention anywhere else. IMHO, It seems to be more effective to have pot high-light and the player "unlocks" it with a custom inventory item "the laxative". Did I explain that right? Sorry I might be confused about what you're suggesting, haha.
  12. Thanks Guys! Obs- I am playing through your map right now. Awesome work btw. I love the mood/ pacing and how you slowly introduce the player to world through readables. Placing them directly on doors is super effective. Once I've found the generator and understand what you've set up. I'll get back to you. SteveL- Thanks! Would you mind sending that over? It would be cool to look at in addition to Obs solution. Much appreciated! Venus- Me too! haha. I am still pretty earlier in the process. I am just blocking out my map and trying to solve all of my necessary objective situations as well as getting the general flow and feel down. About the map: light spoilers that will probably change anyway: I am attempting to developing a combined city/ mansion map. My temporary primary objective is to make your way into the wealthy district, steal a costume and party invitation from a nobleman, and take his place at the event (probably going to be mission #2). The idea being you need to give him an "excuse" not to show up. That's where the laxative or something comes in! I have included some very early screenshots that are pretty spoiler free. Image 1: An optional "target of opportunity" tavern in which the player must deal with a patron and bartender while other patrons regular visit the tavern as stops on their patrols. Image 2: A gatehouse to the wealthy district in which the player must find a way to lower the drawbridge. Image 3: Another "target of opportunity" where the player breaks into a black market inventor's shop to gather supplies. The player encounters several security measures, one of which is an electrified floor. Probably mandatory on hard. I have some level design experience, but so far TDM has been great to work with! Thanks to the strong community.
  13. Awesome! Being able to reload the xdata in game will save me a lot of headache. Thanks so much!
  14. Hello! I am creating a scenario in which the player has an objective to pour a vial of laxative into a pot of soup. Currently, I have the bottle of laxative set up as a custom inventory key and the pot of soup as a locked mover_button. Essentially when the player "unlocks" the pot of soup with the laxative the change objective fires and a no frob volume prevents the player from interacting with the pot. The laxative "key" remains in the inventory. This is obviously pretty messy. What I eventually would like to have is a custom inventory item that when frobbed on a particular item in the world (in this case the pot of soup) it fires its targets and removes the inventory item and/or reduces its count. Similar to a custom weapon. I tried using the func_itemremover to remove the laxative "key" but it doesn't seem to work when I trigger it. Any suggestions or links to information on this would be incredible helpful as I am pretty novice to TDM. Thanks!
  15. Awesome! That did it. I checked to make sure my fms directory was correct in DR. I also I didn't realize you could just restart TDM to update the readables. Thanks guys, much appreciated.
  16. Hello! I am new to DR and I am trying to get some working readables in my map. Currently, I have my xdata and strings files (copied from St Lucia) placed in my darkmod/fms/project folder under strings and xdata. This works okay, but in order to see my edits to the strings I have to re-install my map. - Is there a way to place an xdata folder in the darkmod/maps folder where I keep my other working map files? Rather than having to re-install my FMS every time? - Where does the readable editor in DR place its xdata? Every time I open it is says failed to (Xdata Name) Sorry for such a newbie question, but I appreciate the help. I can't seems to find this info in the tutorials. Thanks!
  • Create New...