-
Posts
2682 -
Joined
-
Last visited
-
Days Won
161
Posts posted by Dragofer
-
-
Ah, looks like I never got around to testing that method. You need to write as follows, either with or without a semicolon:
Quotescript name_of_script()
-
I've moved the recent coding discussion to the new thread I opened for my A to Z Scripting guide.
-
@MirceaKitsuneAnswered in your Art Assets thread (wiki: Campaigns > Scripting)
-
That's pretty damn interesting, good to see such effects implemented and a cool first use of the new addon system. Definitely a case for some balancing i.e.:
- stealth: this would really work better as a subtle effect even at level 4, not "nearly undetectable even in light"
- I think "crosshair" and "info" would work better if merged, so each upgrade has more meat on it, especially since "info" requires a crosshair. Maybe the freed spot could be taken up by "silent steps".
- knockout might be better as non-guaranteed KO with max one chance per AI. Extinguish could also be chance-based for big light sources like torches.
- sonar with a max search distance of 400 units is probably going to be active a lot of the time, might want to go somewhat shorter.
- maybe add an inventory item to the player that can be used to toggle at least some of these effects, in case they interfere with what the player wants to do.
For your question: check the Campaigns wiki article's Scripting subsection for persistent variables.
Also, what's your method for find_closest()?
I think the single main issue with this mod so far is the theme. It'd probably be easier for a player to immersive himself if he were unlocking "supernatural powers" like "extrasensory perception" by finding "runes/orbs/glyphs" rather than "augmenting" abilities such as "sonar" with "implants/microchips". Then it could be considered as a Dishonored/Thief 4 inspired mod rather than Deus Ex inspired. For your cyberpunk mod that's a different matter of course.
-
I've tried to upgrade to beta209_02 but aborted midway by clicking on x in the top right corner. Now whenever I try to download any version I get an error message and the download never begins:
Failed to open zip file ".zipsync/mani/10.iniz"
Here's a log of my faulty tdm_installer. I've also looked in my .zipsync folder and found that 10.iniz is empty.
Deleting 10.iniz has fixed the problem.
-
1
-
-
Can just do the trace every 0.1 or even 0.2s, rather than every single frame.
-
Grats on the latest release! Thanks for working all of this out.
-
59 minutes ago, duzenko said:
It was downloaded this week
Kingsal reuploaded the mission on 23/12, might be you got it before he did that.
-
Nice work! I've gone ahead and setup the files in the structure TDM needs for game assets, dubbing the model "statue_eve".
I've attached the file as a .pk4, which is a renamed .zip. You can simply place the .pk4 into your TDM install, then to look at it ingame start TDM, open the console with ctrl + alt + tilde (button left of 1) and enter: map test
It looks like there are still some issues:
-
ideally, each .ase model would contain both the visual mesh and a lower poly shadowmesh.
- The visual mesh should have a material called tdm_statue_eve while the shadowmesh should have a material called textures/common/shadow.
- it'd be good if the shadowmesh became less detailed with distance, too. No need for a 2k shadowmesh at a long distance, imo.
- an extra very low detail mesh would be great, wouldnt need to cast shadows anymore, or just a very crude shadowmesh.
- the main model is in models/darkmod/decorative/statues, the LOD stages are in models/darkmod/misc/lod/...
-
for the texture files: the texture doesn't show up properly yet, so it'd be good if you could check that you've exported the files as described below:
- statue_eve_d.dds: the diffusemap (corresponds to your colourmaps, I believe), exported as DDS with DXT1 compression. Found in the dds/... folder.
- statue_eve_n.tga: the normalmap, exported as TGA without RLE compression. Found in the models/darkmod/props/textures folder
- statue_eve_s.dds: the specularmap, I believe with DXT1 compression. Found in the dds/... folder.
- statue_eve_ed.jpg: the editor image, should be a low-res version of the diffusemap i.e. 512x512. Found in the models/darkmod/props/textures folder.
This wiki page may be interesting for further reference if needed.
-
1
-
ideally, each .ase model would contain both the visual mesh and a lower poly shadowmesh.
-
-
Je doute que les expertes parlent français içi. Tu pourrais utiliser Google Translate pour faire traduire ton texte en anglais et l'inclure dans tes messages, à côté du texte original français. Je peux essaier à assister si les autres ne comprennent toujours pas, bien que ça fait longtemps depuis la dernière fois que je devais utiliser mon français.
Pour commencer, je suggèrais que tu essaies à fournir encore plus des détails du problème et de ton ordinateur. T'as peut-être un rapport de crash?
-
@grayman Indeed, I had the idea for this guide while I was writing an answer to one of those "How do I..." questions. Those sure add up over time and sometimes it feels like I'm writing the same things.
I was actually thinking of dissecting i.e. your "frosty breath" script, so that's good to know. Well, as demagogue knows it's a long project, for now I'm happy with the demonstrations I have.
@peter_spy Being familiar with a programming language definitely helps a lot, but there's still plenty of TDM-specific aspects, i.e. the bulk of A to Z Scripting: Practical exercise: subtle teleportation concerns itself with how the map should be setup, which entities with which spawnargs, while the script itself is just a handful lines. TDM also has lots of subsystems like stim/response and objectives that can become part of a scripted setup.
Also, learning from a generic programming tutorial in order to script in TDM felt... dissatisfying. All that about memory management, classes and those fancy operators, but only a small fraction is actually relevant in TDM's scripting. Most mappers just want to make x happen as a result of y.
-
1
-
-
- Popular Post
- Popular Post
Another "riverside" mission (no relation) beginning with a somewhat sturdier ship...
... and a riverside encampment.
Though as with the spiritual ancestor, the main action is further inland (you can just about spot the gatehouse in the background).
A tranquil scene from the more maritime sequel:
-
12
-
MirceaKitsune was looking for the "Use" key, which is how keys can be used on doors. And yes, that'd be _impulse51. Frobbing is something else - there are many ways to call a script when a specific entity is frobbed, but not to my knowledge whether the player is frobbing any entity, as you're busy working out.
-
- Popular Post
- Popular Post
For a long time, scripting has been something of an elusive topic in TDM. Those who were already familiar with programming would analyse existing scripted setups in TDM, gradually deducing how things are done around here. Those with no prior knowledge had a handful of basic tutorials to look at, but they only went so far. As a result, a lot of basic scripting questions have been asked and answered on these forums over the years.
Here is my offering: the A to Z Scripting series, aiming to cover all things scripting in TDM. It should cater to anyone, from absolute beginners to more knowledgeable users looking to familiarise themselves with TDM's methods for employing scripts.
Special thanks go to Obsttorte for providing feedback on the entire guide, as well as Kingsal for providing some material to work with.
(Don't mind the timestamps, this thread has been stitched together on Dec 27 2020 from another discussion.)
-
3
-
2
-
1) I'd guess youre calling conv 2 too soon after conv 1. Does it still happen if you wait i.e. 5s or call conv 2 first and from a separate script?
2) Putting the soundshader in a "snd_" spawnarg automatically precaches it on that entity.
-
IIRC I've called a lot of scripts in the conversations of The Painter's Wife. Anyway if worst comes to pass you can probably just make one of the actors activate a callscriptfunction entity.
-
@HMartExcellent, thanks for sharing that - getButtons() is very well alive in TDM (I always assumed it had to with button entities ingame). And looking at darkmod_keybinds.cfg, we have (probably)all the names of the buttons/impulses that TDM uses:
unbindall bind "ENTER" "_impulse51" bind "ESCAPE" "togglemenu" bind "SPACE" "_moveup" bind "-" "_impulse50" bind "0" "_impulse10" bind "1" "_impulse1" bind "2" "_impulse2" bind "3" "_impulse3" bind "4" "_impulse4" bind "5" "_impulse5" bind "6" "_impulse6" bind "7" "_impulse7" bind "8" "_impulse8" bind "9" "_impulse9" bind "=" "_impulse49" bind "P" "map test" bind "[" "_impulse48" bind "\" "_mlook" bind "]" "_impulse47" bind "^" "_impulse0" bind "a" "_moveleft" bind "c" "_impulse24" bind "d" "_moveright" bind "e" "_impulse46" bind "f" "_impulse44" bind "g" "inventory_use '#str_02396'" bind "i" "inventory_cycle_group '#str_02391'" bind "k" "inventory_cycle_group '#str_02392'" bind "l" "inventory_use '#str_02395'" bind "m" "inventory_cycle_maps" bind "o" "_impulse19" bind "p" "map test" bind "q" "_impulse45" bind "r" "_impulse52" bind "s" "_back" bind "u" "_impulse51" bind "v" "inventory_hotkey '#str_02397'" bind "w" "_forward" bind "x" "_impulse23" bind "y" "clientMessageMode 1" bind "z" "_zoom" bind "BACKSPACE" "inventory_hotkey" bind "PAUSE" "pause" bind "UPARROW" "_forward" bind "DOWNARROW" "_back" bind "LEFTARROW" "_left" bind "RIGHTARROW" "_right" bind "ALT" "_strafe" bind "CTRL" "_button5" bind "SHIFT" "_speed" bind "DEL" "_lookdown" bind "PGDN" "_lookup" bind "END" "_impulse18" bind "F3" "_impulse17" bind "F4" "savegame quick" bind "F5" "loadgame" bind "F6" "_impulse20" bind "F7" "_impulse22" bind "F9" "loadgame quick" bind "F12" "screenshot" bind "MOUSE1" "_attack" bind "MOUSE2" "_impulse41" bind "MOUSE3" "_zoom" bind "MWHEELDOWN" "_impulse14" bind "MWHEELUP" "_impulse15"
Impulses don't seem to be in the TDM Script Reference, but "buttons" should do nicely well enough.
-
6 hours ago, MirceaKitsune said:
For near-future reference: Is there a script function that allows me to print a message on the screen to the player, which shows up for a little then fades away? I searched the script reference wiki page but nothing for the word "message".
Also how do I check if the player is holding the USE key? Probably going to need that as well soon.
You'd want to create a GUI message entity, either in DR or by spawning in a script. Set the "text" spawnarg in the same frame you trigger it. There are 2 versions, one with and one without the scroll texture.
I'm not aware of any way to check what key the player is pressing - the only thing I know of is the mouse gesture checking event, which is used to determine which way to swing the sword. The game calls a key press an "impulse", so you might want to use that as a starting point for research.
-
@MirceaKitsune
It's possible that healing works in a similar way to damage, in the sense that defs are used (damage defs). The fact that a string called "air" is involved makes that a little more likely. Could look if you find defs for healing and damage. And as I said earlier, Seed of Lodestar beta contains custom breath scripting.As for crouching the player, there seems to be no obvious way. Still seems like it should be possible to push a button for the player... maybe research impulses some more?
-
@kin
you need to dmap, then map. Dmap compiles the map and is needed whenever you create or modify a brush or patch. If a leak is found during dmap, a lin file is created.Testmap combines both commands for convenience, but won't tell you if dmap found a leak and load anyway.
-
1
-
-
@kin
testmap isn't ideal when you're starting out because it ignores errors in dmap and loads anyway. It's likely a leak prevented your map from compiling properly.Regarding Mircea's speaker, it's meant to be part of an addon available to all maps and players, so he has to create the speaker via script rather than use DR. Would seem like something that startSound or demagogue's ambient override should be able to handle, though.
-
1
-
-
There's a script herethat identifies all entities on the map that meet a certain criterion. You may also ask @kingsal
what method he ended up using to check which entities are within a certain volume, he had asked that same question here a few months ago.Modifying the player's breath: that'd be a case for the breath potion. Alternatively look at the beta thread for ERH's Seed of Lodestar, he's made a diving suit script which automatically regenerates breath. I recall a discussion of using the breath system outside of water, i.e. room with gas, but it didn't seem to be natively supported.
Sounds started with startSound should be looping if the soundshader contains a looping flag. stopSound should stop it, just need to call on the same channel as the one it was started on. Alternatively, if the spawned speaker doesn't start playing you might need to do some more, i.e. trigger it (possibly one frame later), set s_looping & s_maxradius/s_minradius, precache the shader on the speaker.
As HMart points out, and as we saw with AIs, AI_ flags only work if the entity has been defined as the correct type of entity, i.e. ai or player. The player script was probably done as a scriptobject, so the definition wouldn't be visible to an external script.
-
2
-
-
1. Variables you define yourself aren't specific to entities if you're using map scripts. They're only specific to an entity if you're writing a scriptobject, in the sense that variables defined in that entity's scriptobject won't be visible to map scripts or other entities' scriptobjects.
So just do
float mycounter = 10;
2. I'm not aware of a method to call a script whenever the player's health is lowered. I know there is a system for checking which bone was hit when damage is applied to an AI, but I'm not aware of how it can be applied to the player, or whether the player even has bones (the optional player model probably has bones, but is it in any way used for hit detection?). The best I could offer would be a permanently looping script that checks the player's health every 0.x seconds. Maybe you can find out how the red blood effect on the screen gets triggered, i.e. via a GUI script or player scriptobject. There is the signal system which contains an onDamage signal, but I think that system applies only to func_movers.
3. VanishedOne has made a speed potion, worth looking into how that was scripted. Kingsal has increased bow draw speed, at least in Volta 3, but I think that was an entity tweak. Maybe check the player's entity defs and see if you can change some of the parameters in there, possibly the same way VanishedOne modified running speed. There is a force multiplier cvar for dragging moveable bodies, maybe you can find a way to change that from a script.
4. kcghost has scripted a GUI element (inventory item) which uses a script to update its text dynamically (stealth score): https://forums.thedarkmod.com/index.php?/topic/20245-view-stealth-score-during-gameplay/&do=findComment&comment=443437
5. See the GUI message scriptobjects to see how to fade a GUI overlay's transparency.
6. I have no idea. Maybe look at one of the existing HUD elements that does adhere to opacity settings, and dissect how it was made. It helps to unpack your TDM installation to more easily get at the files, without having GUI defs spread out over multiple .pk4s.
A to Z Scripting series
in TDM Editors Guild
Posted
I always believed that the console was meant to allow some basic scripting from the console, i.e. by combining a few events/functions, so a semicolon made sense to me. However, it seems quite limited in terms of what actually works, i.e. script $func_static_1.setFrobable(1) has no effect ingame, you'd have to write your own script function with that event and call that instead.
DoomScript doesn't support int as a data type, but you have the option of turning a float into an "int" with a script function (utility script) like this. Should probably integrate that into the guide somewhere.
float test_variable1 = int(5.8); //returns 5