MirceaKitsune Posted May 14 Report Share Posted May 14 29 minutes ago, Geep said: Maybe that can be faked somehow. Create an AI that looks like a guard, but is really a civilian, and swap that character in to replace a real guard when the skeleton appears? Would be a rather ugly hack. Perhaps I'll suggest this on the tracker, if the feature is considered useful enough to bother it shouldn't be hard. Surprised no one's thought of it yet: Most undead FM's seem to take place in an universe where zombies and skeletons are known to exist... but imagine a more "grounded" one where it's so rare it's still considered fairytales by the people, then skeletons appear on the streets and guards are so scared by the unusual they drop their weapons and run instead of doing their job and attacking. 1 Quote Link to comment Share on other sites More sharing options...
datiswous Posted May 16 Report Share Posted May 16 (edited) Just a wild guess: If they see the skeleton, change health_critical spawnarg to higher than health. Or: Change spawnarg is_civilian to 1. (then they probably would also flee from each other though) Edited May 16 by datiswous Quote Link to comment Share on other sites More sharing options...
Jnon Posted May 19 Report Share Posted May 19 On 5/12/2023 at 9:16 PM, OrbWeaver said: You need to install the darkradiant-plugins-darkmod package. Ah, I see! Thank you, I just installed that package and now all of the missing menu items are where they should be. 1 Quote Link to comment Share on other sites More sharing options...
joebarnin Posted May 19 Report Share Posted May 19 I've got a window (func_static made of textures/darkmod/glass/clear_warp). Just on the other side of it is a frobable object. The player can see it and frob it. I want to prevent frobing through the glass window. Other than lowering the frob distance, is there a way to stop frobing through the window? I tried adding a tdm_nodrawsolid_glass func_static 'over' the window, and made it frobable (to catch the frob first), but that didn't work, I could still frob the object on the other side. Quote Link to comment Share on other sites More sharing options...
Frost_Salamander Posted May 19 Report Share Posted May 19 4 minutes ago, joebarnin said: I've got a window (func_static made of textures/darkmod/glass/clear_warp). Just on the other side of it is a frobable object. The player can see it and frob it. I want to prevent frobing through the glass window. Other than lowering the frob distance, is there a way to stop frobing through the window? I tried adding a tdm_nodrawsolid_glass func_static 'over' the window, and made it frobable (to catch the frob first), but that didn't work, I could still frob the object on the other side. I had this in In Plain Sight. I used a location script to only make the item frobable when the player entered the room (and turn it off when exiting). 1 Quote TDM Community Github: https://github.com/thedarkmodcommunity My fan missions: The Hare in the Snare, Part 1, In Plain Sight High Expectations Link to comment Share on other sites More sharing options...
joebarnin Posted May 19 Report Share Posted May 19 1 hour ago, Frost_Salamander said: I had this in In Plain Sight. I used a location script to only make the item frobable when the player entered the room (and turn it off when exiting). Clever idea, I’ll do that Quote Link to comment Share on other sites More sharing options...
DeTeEff Posted May 21 Report Share Posted May 21 Tiniest question...how do I kill the player via script if $player1.kill(); doesn't work? I have tested and yes, the script fires as it should... Quote Link to comment Share on other sites More sharing options...
Frost_Salamander Posted May 21 Report Share Posted May 21 31 minutes ago, DeTeEff said: Tiniest question...how do I kill the player via script if $player1.kill(); doesn't work? I have tested and yes, the script fires as it should... https://github.com/thedarkmodcommunity/scripts/blob/main/player/kill_player.script 1 Quote TDM Community Github: https://github.com/thedarkmodcommunity My fan missions: The Hare in the Snare, Part 1, In Plain Sight High Expectations Link to comment Share on other sites More sharing options...
Geep Posted May 23 Report Share Posted May 23 On 5/21/2023 at 11:21 AM, DeTeEff said: Tiniest question...how do I kill the player via script if $player1.kill(); doesn't work? I've changed the example code in wiki entries "Scripting basics" and "My first map script" to use what @Frost_Salamander indicated: $player1.setHealth(0); // kill the player instead of $player1.kill(); 3 Quote Link to comment Share on other sites More sharing options...
Frost_Salamander Posted May 28 Report Share Posted May 28 (edited) I've created a very simple tutorial on my Wiki home page on how to create a material/texture from an online source (e.g. textures.com) using GIMP. This is something I didn't know how to do and wished that it existed when I started. Yes, there are some existing Wiki pages that kind of describe how to do this, but they are wildly out of date with respect to the tools used and are full of gaps to the uninitiated. What I've pieced together mainly came from existing Wiki sources, but updated with the current version of GIMP. I obviously realise that to a lot of people here this is 101 level stuff, but for myself and other complete n00bs that want to build something, basic tutorials like this are invaluable. It's using GIMP just because it's free and does most things a n00b will want to do, especially when it comes to dealing with older file formats that TDM requires. Anyways, the point of this post is I would like to ask if anyone who DOES know what they are doing could cast their eye over the tutorial and point out any gaffes or downright incorrect/misleading information. Not so much in the proofreading sense or GIMP-specific things (although that would be welcome too), but more around the images/properties themselves. I've labelled some sections with (ADVICE NEEDED) for stuff that I really don't understand very well but the whole thing is fair game. The tutorial is very short, and if anything is glaringly wrong it should be easy to spot by knowledgeable people. The main things I don't understand are the image properties when exporting - there are a million options and I don't know what most of them do. I've looked some of them up, but I don't necessarily know what's best for TDM. All I know is that what I've written seems to work. Perhaps if this gets into a state that makes sense we can add it to the main Wiki and clean up some of the existing sections on this. Link here: https://wiki.thedarkmod.com/index.php?title=User:Frost_Salamander#Creating_a_material_using_existing_images_(e.g._from_textures.com)_using_GIMP Edited May 28 by Frost_Salamander 3 Quote TDM Community Github: https://github.com/thedarkmodcommunity My fan missions: The Hare in the Snare, Part 1, In Plain Sight High Expectations Link to comment Share on other sites More sharing options...
MirceaKitsune Posted May 28 Report Share Posted May 28 Once more something I'm not planning on using right away but was thinking of for an idea I had: Is it possible to have a random value that can be used on maps but global to a campaign so that it's the same on every map? This would be nice so whenever you start a campaign, you can have some things be unique each time. Example: Let's say you have an important character in your campaign, you'll meet this AI on multiple maps. You want to do something special and have the character be either male or female as a 50/50 change. The random choice would be saved when the campaign is started: On maps featuring them you define both the male and female version, but hide both and use a teleport target to only move one to the world area, with the hypothetical entity responsible for checking the random value triggering one teleporter if "chance < 0.5" and the other if "chance >= 0.5". Quote Link to comment Share on other sites More sharing options...
thebigh Posted May 28 Report Share Posted May 28 There's some scripting features that allow campaign-persistent variables to be stored: see the wiki Right at the very beginning of the first mission you'd call a function that looks something like this: void setup_campaign_vars() { float coinflip; coinflip = sys.random(2); if(coinflip<1) sys.setPersistantArg("person_is_male", "1"); else sys.setPersistantArg("person_is_male", "0"); return; } In that map or any later map in the campaign you can look up the persistent variable with float person_is_male = sys.getPersistantFloat("person_is_male"); 2 Quote { 0 | 🞵 } = funk_tastic My missions: Stand-alone Duncan Lynch series Down and Out on Newford Road the Factory Heist A House Call Link to comment Share on other sites More sharing options...
MirceaKitsune Posted May 28 Report Share Posted May 28 31 minutes ago, thebigh said: There's some scripting features that allow campaign-persistent variables to be stored: see the wiki Right at the very beginning of the first mission you'd call a function that looks something like this: void setup_campaign_vars() { float coinflip; coinflip = sys.random(2); if(coinflip<1) sys.setPersistantArg("person_is_male", "1"); else sys.setPersistantArg("person_is_male", "0"); return; } In that map or any later map in the campaign you can look up the persistent variable with float person_is_male = sys.getPersistantFloat("person_is_male"); Thanks... that's awesome, will gladly keep it in mind. Can't avoid needing a custom script but I cannot complain: I'll likely write a custom map entity for this, can use it to do both storing and triggering based on circumstance. Since I already asked, I kinda had a part two to my question: Is it possible to change AI definitions in realtime, so for minor changes you don't need to register a different AI altogether? Namely the model, skin, head definition, and voice; Can a script replace them? For the body model / skin I think that would work like on func_static, but def_head and def_vocal_set are probably read once on map load and not updated in realtime. It would also break precaching and cause a jitter. Problem is that if I leave the unused AI in a hidden box on the map, it's still loaded in memory and thinks thus wasting CPU. Can I at least delete an entity I don't want safely? The difficulty filter does that, entities not corresponding to a given difficulty are erased... this however is likely decided during loading which wouldn't work here. Quote Link to comment Share on other sites More sharing options...
joebarnin Posted May 28 Report Share Posted May 28 In a TDM script (in real time) I want to calculate the angle between two points ('vectors' in the scripting language). It's basically arctan - but there is no 'arctan' function in the TDM script language. Is there any way to call an external script or function? Like, jython? Worst case, I can hard-code a table of values, but that is kludge-a-rific. Quote Link to comment Share on other sites More sharing options...
thebigh Posted May 28 Report Share Posted May 28 What exactly are you trying to do? There is an acos function which, with some wangling, should be able to give you the angles you need? The angle between two vectors is given by acos( A·B/(|A||B| ) If you're after theta here: the angle theta is indeed atan(b/a), but it is also acos(a/√(b²+a²)) You just have to be careful about angles greater than 90, or greater than 180. 1 Quote { 0 | 🞵 } = funk_tastic My missions: Stand-alone Duncan Lynch series Down and Out on Newford Road the Factory Heist A House Call Link to comment Share on other sites More sharing options...
Dragofer Posted May 28 Report Share Posted May 28 26 minutes ago, joebarnin said: In a TDM script (in real time) I want to calculate the angle between two points ('vectors' in the scripting language). It's basically arctan - but there is no 'arctan' function in the TDM script language. Is there any way to call an external script or function? Like, jython? Worst case, I can hard-code a table of values, but that is kludge-a-rific. The way Id do it is sys.VecToAngles( point2 - point1 ); That gets you a set of angles from 0 to 360 - if you need their overall magnitude you could use sys.vecLength( angles ); Alternatively you can convert them with sys.angToForward( angles ); if you only need the angle on the horizontal plane. You can also use anglemod180( angles ); to convert angles to the range -180 to +180. I believe that function only lets you do 1 angle at a time. @thebighwere you able to get persistantargs to work? @MirceaKitsuneI think you'd be better off respawning an AI with the desired properties. I highly doubt TDM allows you to alter an AI to that extent. 1 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository Link to comment Share on other sites More sharing options...
thebigh Posted May 29 Report Share Posted May 29 (edited) 37 minutes ago, Dragofer said: were you able to get persistantargs to work? I confirmed they work within the same map, and persist over save-quitgame-load. I haven't tried a campaign before so I can't verify whether persistent args survive moving to a new map, I'm just going by what the wiki says. Edited May 29 by thebigh Quote { 0 | 🞵 } = funk_tastic My missions: Stand-alone Duncan Lynch series Down and Out on Newford Road the Factory Heist A House Call Link to comment Share on other sites More sharing options...
joebarnin Posted May 29 Report Share Posted May 29 1 hour ago, Dragofer said: The way Id do it is sys.VecToAngles( point2 - point1 ); That gets you a set of angles from 0 to 360 - if you need their overall magnitude you could use sys.vecLength( angles ); Alternatively you can convert them with sys.angToForward( angles ); if you only need the angle on the horizontal plane. Brilliant, this worked like a charm. 1 Quote Link to comment Share on other sites More sharing options...
grodenglaive Posted June 1 Report Share Posted June 1 I'm having trouble getting an AI character to follow the player. I have a path_follow_actor node at the end of the AI's path and the node targets Player1. The AI follows the rest of her path normally, but stops at path_follow_actor and just stands there like an idiot no matter what I do. Am I referencing the player incorrectly? Quote Link to comment Share on other sites More sharing options...
Frost_Salamander Posted June 1 Report Share Posted June 1 9 minutes ago, grodenglaive said: I'm having trouble getting an AI character to follow the player. I have a path_follow_actor node at the end of the AI's path and the node targets Player1. The AI follows the rest of her path normally, but stops at path_follow_actor and just stands there like an idiot no matter what I do. Am I referencing the player incorrectly? I tried this as well and couldn't get it to work either. Same result as you. It works if it targets another AI, but not the player. Would be interested to know if anyone else got it to work. 1 Quote TDM Community Github: https://github.com/thedarkmodcommunity My fan missions: The Hare in the Snare, Part 1, In Plain Sight High Expectations Link to comment Share on other sites More sharing options...
thebigh Posted June 1 Report Share Posted June 1 (edited) Can you maybe kludge this by creating a non-solid invisible and completely inert AI, and binding it to you? Then the AI that's meant to be pursuing you will follow the invisible dummy. Edited June 1 by thebigh Quote { 0 | 🞵 } = funk_tastic My missions: Stand-alone Duncan Lynch series Down and Out on Newford Road the Factory Heist A House Call Link to comment Share on other sites More sharing options...
grodenglaive Posted June 1 Report Share Posted June 1 4 hours ago, thebigh said: Can you maybe kludge this by creating a non-solid invisible and completely inert AI, and binding it to you? Then the AI that's meant to be pursuing you will follow the invisible dummy. interesting, I'll give that a try. Thanks! Quote Link to comment Share on other sites More sharing options...
grodenglaive Posted June 1 Report Share Posted June 1 (edited) 5 hours ago, thebigh said: Can you maybe kludge this by creating a non-solid invisible and completely inert AI, and binding it to you? Then the AI that's meant to be pursuing you will follow the invisible dummy. Unfortunately that didn't work, she still wont follow me. It's not a big deal, I just gave the AI her own path to follow to the exit. I can put in a couple path_waitfortrigger so the player doesn't fall too far behind. Edited June 1 by grodenglaive Quote Link to comment Share on other sites More sharing options...
AluminumHaste Posted June 1 Report Share Posted June 1 Oh that's your problem, you can't mansplain a women around like that with path nodes! 1 Quote I always assumed I'd taste like boot leather. Link to comment Share on other sites More sharing options...
Geep Posted June 1 Report Share Posted June 1 (edited) 9 hours ago, thebigh said: Can you maybe kludge this by creating a non-solid invisible and completely inert AI, and binding it to you? Then the AI that's meant to be pursuing you will follow the invisible dummy. Possibly the reason this doesn't work is because the FollowActorTask code screens out actors that are NULL, AI_DEAD, or AI_KNOCKEDOUT. Edited June 1 by Geep Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.