Jump to content
System downtime for updates - Sunday 13 July 2025 ×
The Dark Mod Forums

Search the Community

Searched results for '/tags/forums/a script/' or tags 'forums/a script/q=/tags/forums/a script/&'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • News & Announcements
    • The Dark Mod
    • Fan Missions
    • Off-Topic
  • Feedback and Support
    • TDM Tech Support
    • DarkRadiant Feedback and Development
    • I want to Help
  • Editing and Design
    • TDM Editors Guild
    • Art Assets
    • Music & SFX

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. First off thanks to Dragofer and other users who helped with the scripting basics needed to get this done. As a detail for some FM's I plan to make in the future, I wanted to have it possible for friendly AI to be frobbed for idle chatter, causing them to say something random to the player. I first tried with conversation entities but the setup was too ugly and complex, so I decided to do this using one script function. I succeeded with pretty nice results, thus I figured I'd share this for other FM creators to use as well. The thing I like most is that it only requires one universal function to be added to your map scripts. Every AI can use it with a simple spawnarg and it doesn't require manually setting any sound shaders: It will automatically work on any character! This means you can use it on a pro guard, a builder priest, a noble woman... each will say the appropriate thing when frobbed. This is done with the power of the ai.bark() call which lets you make the AI speak any action defined in their vocal set (universal across all vocal sets). To get it working you only need to add two spawnargs to your AI, with a third optional one for customization (explained below): frobable 1 frob_action_script ai_frob frob_bark ... frob_bark is optional: If not set the AI will normally greet the player... if alert or having seen evidence of intruders, it will use other lines to inform the player depending on severity. This parameter can be set to the following values to get a custom result: "suspicious": The AI always acts as if it has seen indirect evidence of trouble and warns the player. "alert": The AI always acts as if it has seen an intruder warns the player. "angry": The AI is upset and curses at the player. "rambling": The AI rambles random things when talking to the player (idle lines). Finally here's the script itself. It's pretty tiny, most of the code is for choosing the voice to use. Put it on an AI and let me know if you like the result void ai_frob(ai self) { if(!self.AI_DEAD && !self.AI_KNOCKEDOUT && self.AI_AlertLevel < 3) if(self.isFriend($player1) || self.isNeutral($player1)) { string frob_type = self.getKey("frob_bark"); string frob_bark; // Pick what the AI will say when frobbed if(frob_type == "alert") { frob_bark = "snd_warnSawEnemy"; } else if(frob_type == "suspicious") { frob_bark = "snd_warnSawEvidence"; } else if(frob_type == "angry") { frob_bark = "snd_admonish_friend"; } else if(frob_type == "rambling") { frob_bark = "snd_relaxed"; } else { if(self.AI_AlertLevel > 2) frob_bark = "snd_warnSawEnemy"; else if(self.AI_AlertLevel > 1) frob_bark = "snd_somethingSuspicious"; else if(self.hasSeenEvidence()) frob_bark = "snd_warnSawEvidence"; else frob_bark = "snd_greeting_generic"; } float look_time = 1 + sys.random(1); self.bark(frob_bark); self.lookAt($player1, look_time); sys.wait(look_time); } } ai_frob.script
  2. This is the error I get when going back to play an older mission (pre 2.08/64) Script object "number wheel" not found on entity "idMover_atdm:numberwheel_small_725" I know that save games don't work when you upgrade to a newer version, but in this case the entire mission is not accessible. Any Advice ?
  3. like changing the speed maybe every minute or two... or is the speed hardcoded?
  4. I'm getting this fatal 2.08 error message now and then when testing my WIP. I've seen it happen when doing nothing, or when doing a specific action (like turning off a light switch). Has anyone seen this, and does anyone have any suggestions on how to debug it? The error message doesn't give any information about which script might be causing the problem. I have tons of scripting work in this WIP, so it looks like it'll be a big job trying to find the culprit. Thanks.
  5. Hi, I need to know what the code is to use Spoiler Tags. I am using my tablet and I don't have the options to use anything, like spoiler tags, quote tags, text changes etc. Thanks
  6. I started WS2:Home Again using the latest SVN (15447/7824) and got this error: "ERROR: Error: file maps\ws2_homeagain.script, line 59: Type mismatch on redeclaration of length" The line in question is: float length = gybbsPlayer.startSoundShader(recording,1); startSoundShader returns a float to the thread where the line in question appears. The odd thing is the claim that the line redeclares "length" when this is the only declaration of "length" in the script file. Anyone been fiddling with types lately? Thx.
  7. Not so long ago I found what could make a pretty good profile picture and decided to try it out on these new forums. But I couldn't find a button anywhere that would let me change it. I asked on Discord and it seems Spooks also couldn't find anything anywhere. So I logged into an old alternative account and, lo and behold, that account has a button. This is on the first screen I get when I: 1) click on my account name in the top-right of the browser -> 2) click on 'profile'. Compared to my actual account: Are you also missing this button on your account? It'd be very much appreciated if that functionality could be restored to any of the affected accounts.
  8. [Let me know if this isn't the right place for this post] This is a thread to discuss this issue: I created a bug here: https://bugs.thedarkmod.com/view.php?id=5236 As for duzenko's comment in the bug tracker: Either of those would be acceptable, from my point of view.
  9. I just made a test with script here from darkmod but i put $player1 and not work after $info_player_start_1 and nothing. If possible help me. please. Create the script file If your map is called for example maps/mydir/mymap.map, you must create a text file maps/mydir/mymap.script. The contents The map script needs to contain a main function. This function is called at the very start of your map, e.g. when the map is loaded for the first time. So if you want something to happen later, you need to pause the script and then do something. Here is an example:
  10. Hi all, some time ago SteveL gave me a python script, that can search files in the TDM installation (also inside pk4-files), which is very handy for playing around with definitions, materials, etc. Unfortunately, the script does not work with the latest Python distribution. Could someone, who in contrast to myself knows python, be so kind to correct the script, so it works? Idle gives an error that the print part is wrong; I am not sure if they have changed anything in their syntax. Any help is appreciated! """Search text files in FMs and TDM assets""" import re, os, fnmatch, zipfile PATHS = [ r"E:\Spiele\Stealth\TDM" ] #, r"E:\dm-dev\campaign"] FILE_EXTS = ['.mtr'] # '.mtr', '.prt', ,'.skin','.fx','.md5mesh','.pfb', '.anim', '.md5anim','.gui','.map','.script','.gui','.def' SEARCH_PTN = r'arm_leg' # 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
  11. Still spreading the word about TDM on forums to new peops... Funny to see people say "Awesome, I loved playing Thief back in the day!"

    1. Show previous comments  2 more
    2. kano

      kano

      Yes it was in a discussion where someone was saying how unhappy they are with the way game companies grant themselves permission to do whatever they like to your PC and personal info today. I pointed out that giving up games completely is an unnecessarily overkill solution when there are free games like TDM to play.

    3. Epifire

      Epifire

      Honestly the mod/Indie genre is still really booming right now. And they aint got no reason to do shady invasive privacy bs.

    4. Petike the Taffer

      Petike the Taffer

      What Epifire said. :-)

  12. I,m trying getHealth () from enemy with script but without sucess. If possible help me t = sys.getTime(); sys.print(t); if (t > 5) { //Code for spawn enemies Wherever you wish on the map float killed = 0.0; sys.wait(1.8); entity new_monster = sys.spawn("monster_zombie_fat"); // example monster_zombie_fat or any class enemy name new_monster.setKey("name", "monster_zombie_fat_3"); new_monster.setOrigin('-136 -120 11'); if ($monster_zombie_fat_3.getHealth( ) < 1){ // Not Working cant get value of health killed += 1; string myStr = new_monster.getKey("name"); // Retrieve the value of the "name" spawnarg of the player entity myStr = "The name of zombie_fat is " + myStr + "killed = " + killed + "\n"; sys.println(myStr); // Print the text to the console } }
  13. Hi guys, through the "cheats" topic I got the idea, that it would be quite useful, if there were tags for missions (the post was about removing the killing restriction in some missions to suit the prefered play style). I don't know how easy or difficult this is, but with them, it would be quite convenient to pick missions with playstyles, environment, etc one does want to use. This could also be expanded to other mission properties. I remember a discussion about climbable drains, handles on doors, that cannot be picked and other things the map author chooses for himself. That way these things would be clearer and as I said before, it is easier to choose missions with playstyles that suit oneself. What do think?
    1. Tarhiel

      Tarhiel

      Awesome, congratulations!!! :o

    2. Bikerdude

      Bikerdude

      Yup, all the remianing bugs were ironed out, so it nigh on perfect now.

    3. AluminumHaste

      AluminumHaste

      version 2.1 is now uploaded to mirrors ready to download.

  14. can somebody fix the mainpage of our site? http://forums.thedarkmod.com/topic/19469-new-layout-error/

    1. nbohr1more
    2. Springheel

      Springheel

      It's under construction at the moment.

       

  15. Experimenting with TDM on Steam Link on Android. see topic http://forums.thedarkmod.com/topic/19432-tdm-on-steam-link-for-android/

    1. freyk

      freyk

      Did the TDM team removed D3's internal Joypad feature? (tdm works only with systemkey binders for joysicks)

    2. freyk

      freyk

      Thanks to shadrach, i got my joypad working in TDM on steam link!

  16. Has anyone gotten the blend ase export script to work in the latest DR? I've tried exporting a func_static as a blended model to the Desktop, and it doesn't show up. (I had tried to put it into the proper mission folder, but it didn't show up there either.
  17. I'm trying to write a couple of scripts to walk the graph and tweak every light entity. Trying to make sure the script will do the right thing first by just printing changes instead of making them. But DarkRadiant is crashing every time I run the script. The script itself, the darkradiant log, a test map I had that it crashed on, and the crash dump itself are all at: https://www.dropbox.com/s/xi5sf4adyzkmpyu/darkradiant_crash.zip?dl=0 I'm running DarkRadiant version: 2.4.0 (x64) on Windows 10 64 bit. I'm using it here to make a Quadrilateral Cowboy map.
  18. I do kinda wish there was some sort of script that would export generic null positions (or cube primative) over selected mesh positions. Would be super handy for combining/cleaning up scenes arranged in DR.

    1. Show previous comments  5 more
    2. rich_is_bored

      rich_is_bored

      I've got a solution for you. Make a func_static out of a small brush. Select the "model" key/value pair. Now deselect everything and select the models you want to extract position data from. In the entity inspector you should still have the model key/value pair queued up. Apply it to everything selected by clicking the green checkmark. Now all the models will be replaced with the brush you created. Export this selection of brushes as an obj.

    3. rich_is_bored

      rich_is_bored

      Scratch that. Exporting as obj doesn't work and I can't revert the brushes back to worldspawn either.

    4. Epifire

      Epifire

      You know now that I think about it. If I can use the world 0 0 0 set the same as Softimage, I might just be able to copy and paste the values out manually. Most of the big things I'm needing are rotation snapped anyways so that makes it easy.

  19. Well I'd talked a tad bit about starting a tram with my splines thread but I thought I'd post something a little more direct now. For you script junkies I hope this can be a fun little project to collaborate on! So here it goes. The tram I'm making for my mission will be a self powered mode of transportation that rides along a railway. It should basically be a small box car of sorts with a view panel that stretches around all sides. It should have a single door that is automatically closed while the tram is in motion. It should have three buttons for controlling it. Forward, backward and a brake. The directional levers should only be able to change direction when the brake has been applied (so no changing directions while in motion!). The tram brake should probably be it's own script function so that it can be called by other modes of command (from end of path splines or triggered events). It also should have a single state that (when enabled) should make the controls inoperable. This function is only needed so that the tram may carry out it's last defined spline path without player interference. Lastly, I wanted to have a true/false active state available. This is just so that the tram can remain inactive until the story/objectives define otherwise. I will be modeling a entirely new detail mesh from scratch, and I'm hoping that I can eventually get a pretty compact def file established for it. The end goal of mine is to have a nice tram that practically anyone can pick up and use after it ships in my FM. Also for your convenient referencing I already grabbed the original script for the D3 tram and tried to gut most the features I was sure that we wouldn't be needing for this. Such as vertical and lateral movement functions. Hoping we can reuse some functions from it but I'm a script novice so I need some parental advice.
  20. Did a great find today: Quake 4 mods for dummies. Now online readable. http://forums.thedarkmod.com/topic/5576-book-quake-4-mods-for-dummies/?p=412644

×
×
  • Create New...