AluminumHaste 1053 Posted April 22, 2020 Report Share Posted April 22, 2020 Yeah weird, no geometry pop in due to broken Visportals when the draw calls skyrocket. There are other things like light counts or shaders that can increase counts, but I don't see anything obvious there. Can you move your player start in DarkRadiant to that point and upload the map file somewhere? Quote I always assumed I'd taste like boot leather. Link to post Share on other sites
JackFarmer 475 Posted April 22, 2020 Report Share Posted April 22, 2020 @AluminumHaste Will do and PM you. Thank you for your help. Quote Link to post Share on other sites
ERH+ 661 Posted April 27, 2020 Report Share Posted April 27, 2020 I want a bound object to move with a particular master's joint, but maintain the same angular position (as world's axis). Can bind properties be partially disabled, or can I modify binding script? I can't see it in script files. Quote Link to post Share on other sites
STRUNK 270 Posted April 28, 2020 Report Share Posted April 28, 2020 @ERH+ I found thins in the doom script events: https://modwiki.dhewm3.org/BindToJoint_(script_event) There is also this (but I think you're looking for the first one ) https://modwiki.dhewm3.org/BindPosition_(script_event) Hope it works in DR/TDM Quote Link to post Share on other sites
joebarnin 246 Posted April 30, 2020 Report Share Posted April 30, 2020 I've been doing some script coding, and it looks like there is a maximum length for string variables in scripts: 127 characters. Any strings longer than that get truncated. Is this a known limitation? Let me explain what I'm trying to do. I want to dynamically create a readable, based on the status of the mission. Here's an example of the script code: ai guard = $atdm_ai_guard_elite_1; string msg; if (guard.AI_DEAD) { msg = "He's dead, Jim."; } else { msg = "He's fine, Jim."; } sys.setSpawnArg("gui_page1", "guis/readables/sheets/sheet_paper_calig_mac_humaine.gui"); sys.setSpawnArg("page1_body", msg); sys.setSpawnArg("num_pages", "1"); entity testnote = sys.spawn("atdm:readable_mobile_paper01"); $player1.addInvItem(testnote); This works great - the player gets a note in the inventory with the appropriate content. But, if I try to make the 'msg' text longer, beyond 127 characters, it gets truncated. I was excited about being able to dynamically create readables until I ran into this issue. Does anyone have an idea how to make this work? Yes, in this simple case I could just create two xdata_contents and dynamically point at one or the other. But what I really want to do is more complicated logic, involving several variables. I would have to create 10 or 20 different xdatas to handle all of the permutations. I'd rather not do that. Quote Link to post Share on other sites
duzenko 654 Posted May 1, 2020 Report Share Posted May 1, 2020 7 hours ago, joebarnin said: I've been doing some script coding, and it looks like there is a maximum length for string variables in scripts: 127 characters. Any strings longer than that get truncated. Is this a known limitation? Let me explain what I'm trying to do. I want to dynamically create a readable, based on the status of the mission. Here's an example of the script code: ai guard = $atdm_ai_guard_elite_1; string msg; if (guard.AI_DEAD) { msg = "He's dead, Jim."; } else { msg = "He's fine, Jim."; } sys.setSpawnArg("gui_page1", "guis/readables/sheets/sheet_paper_calig_mac_humaine.gui"); sys.setSpawnArg("page1_body", msg); sys.setSpawnArg("num_pages", "1"); entity testnote = sys.spawn("atdm:readable_mobile_paper01"); $player1.addInvItem(testnote); This works great - the player gets a note in the inventory with the appropriate content. But, if I try to make the 'msg' text longer, beyond 127 characters, it gets truncated. I was excited about being able to dynamically create readables until I ran into this issue. Does anyone have an idea how to make this work? Yes, in this simple case I could just create two xdata_contents and dynamically point at one or the other. But what I really want to do is more complicated logic, involving several variables. I would have to create 10 or 20 different xdatas to handle all of the permutations. I'd rather not do that. If this does not resolve with a simple workaround here, please start a new thread or a bugtracker entry Quote Link to post Share on other sites
duzenko 654 Posted May 1, 2020 Report Share Posted May 1, 2020 2 hours ago, duzenko said: If this does not resolve with a simple workaround here, please start a new thread or a bugtracker entry I think it's a script system limitation #define MAX_STRING_LEN 128 1 Quote Link to post Share on other sites
Abusimplea 168 Posted May 2, 2020 Report Share Posted May 2, 2020 (edited) 18 hours ago, duzenko said: I think it's a script system limitation That could maybe be worked around by having a variable per line of text. Does the page1_body spawnarg support sub-indexing (page1_body1, page1_body2, ...)? Edited May 2, 2020 by Abusimplea Quote Link to post Share on other sites
joebarnin 246 Posted May 2, 2020 Report Share Posted May 2, 2020 13 hours ago, Abusimplea said: Does the page1_body spawnarg support sub-indexing (page1_body1, page1_body2, ...)? Nope, I tried that, it doesn't work. I was able to implement something similar to that, by modifying the readable GUI (e.g., sheet_paper_calig_mac_humaine.gui) so that it supported _body1, _body2, etc. That enables me to put multiple strings in the body from a script, as long as each is less than 128 characters. This technique comes with significant limitations: each _body# is effectively a paragraph, and you have to manually position it using newline characters. Highly kluge-a-rific, but it may have to do for now. I'll submit something in the bugtracker too. Quote Link to post Share on other sites
duzenko 654 Posted May 2, 2020 Report Share Posted May 2, 2020 1 hour ago, joebarnin said: Nope, I tried that, it doesn't work. I was able to implement something similar to that, by modifying the readable GUI (e.g., sheet_paper_calig_mac_humaine.gui) so that it supported _body1, _body2, etc. That enables me to put multiple strings in the body from a script, as long as each is less than 128 characters. This technique comes with significant limitations: each _body# is effectively a paragraph, and you have to manually position it using newline characters. Highly kluge-a-rific, but it may have to do for now. I'll submit something in the bugtracker too. While you're at it, could you also create a test map for this? I suggest two readables - one truncating and the other makes use of xdata for reference Quote Link to post Share on other sites
JackFarmer 475 Posted May 2, 2020 Report Share Posted May 2, 2020 On 5/1/2020 at 1:13 AM, joebarnin said: "He's dead, Jim." Quote Link to post Share on other sites
joebarnin 246 Posted May 2, 2020 Report Share Posted May 2, 2020 3 hours ago, duzenko said: While you're at it, could you also create a test map for this? I suggest two readables - one truncating and the other makes use of xdata for reference Done: https://bugs.thedarkmod.com/view.php?id=5236 Quote Link to post Share on other sites
duzenko 654 Posted May 3, 2020 Report Share Posted May 3, 2020 11 hours ago, joebarnin said: Done: https://bugs.thedarkmod.com/view.php?id=5236 Thank you Just as a side note: better to put all map content in a single .zip with folders, to save on time to reproduce EDIT I can only see one readable - the one created in DR. Where's the other one? Did you forget to add the custom script that references the readabletest.script? I'm asking because I'm rather clueless about scripting Quote Link to post Share on other sites
joebarnin 246 Posted May 3, 2020 Report Share Posted May 3, 2020 Sorry about that. I updated the bug report with a test case - a complete mission zip with folders. The script file has the same name as the map, so the main() method within it will run automatically when you run the map. 1 Quote Link to post Share on other sites
duzenko 654 Posted May 4, 2020 Report Share Posted May 4, 2020 On 5/3/2020 at 6:13 PM, joebarnin said: Sorry about that. I updated the bug report with a test case - a complete mission zip with folders. The script file has the same name as the map, so the main() method within it will run automatically when you run the map. Can you try to create a readable from script using the xdata text please? Also, you test map is not an accurate case. Can I ask you to actually spawn the readable by user action? E.g. lever trigger, etc Ideally I'd like to have two levers - one creates a readable from xdata and another a string hardcoded inside the script Quote Link to post Share on other sites
duzenko 654 Posted May 4, 2020 Report Share Posted May 4, 2020 @stgatilov any insight? I can see that idVarDef's are allocated on multiple storages, including the script VM stack Significant increase of fixed string size is a clear danger I'm thinking about adding a new setSpawnArgFmt script function that should work like Printf() The big if is - whether the script compiler supports variable function arguments If not, maybe we can try adding smart accessors like 'My name is ${name}' since we can access script variables by name? Quote Link to post Share on other sites
Destined 615 Posted May 4, 2020 Report Share Posted May 4, 2020 I am not sure, if this is of help, but obsttorte has had released a method to create a diary/journal that is updated on certain events. You can find it here: 1 Quote Link to post Share on other sites
joebarnin 246 Posted May 4, 2020 Report Share Posted May 4, 2020 2 hours ago, Destined said: I am not sure, if this is of help, but obsttorte has had released a method to create a diary/journal that is updated on certain events. You can find it here: This is very clever. I just gave it a try, but unfortunately it runs into the same problem. As soon as the content of the diary reaches 128 characters, it gets truncated. Quote Link to post Share on other sites
joebarnin 246 Posted May 5, 2020 Report Share Posted May 5, 2020 4 hours ago, duzenko said: Can you try to create a readable from script using the xdata text please? Also, you test map is not an accurate case. Can I ask you to actually spawn the readable by user action? E.g. lever trigger, etc Ideally I'd like to have two levers - one creates a readable from xdata and another a string hardcoded inside the script All done - check the bug report. 1 Quote Link to post Share on other sites
NeonsStyle 572 Posted May 5, 2020 Report Share Posted May 5, 2020 (edited) I have a wierd texture problem. The material file for it is below. This is a tile, and it's trim texture. Both are defined correctly in the material file as diffusemap, and normalmap. wierdly, if I used the surfacetype15, description "tile" parameter, then the main tile (black here) shows up, and the trims (white) bumpmap is overlaid on top of the main tile (black). I've been scratching around trying to fix this now for 3 days and getting nowhere. The files themselves have been checked and triple checked, they are fine, tga, no RLE compression and set to bottom left. The normals were made in njob. Does anyone have a clue as to what's going wrong here? In the console, the only reference to this material file is line 17 expected { and got textures/darkmod/... some other texture that works fine and line 18 missing decl, but line 18 is a { ie here is line 17 and 18. These are not related to the above problem. textures/darkmod/stone/flat/tiling_1d/cement_002 { this is what it's supposed to look like textures/darkmod/stone/tiles/red_tile_flower_main_d { stone diffusemap textures/darkmod/stone/tiles/red_tile_flower_main_d bumpmap textures/darkmod/stone/tiles/red_tile_flower_main_n // TDN Ambient Method Related { if (global5 == 1) blend add map textures/darkmod/stone/tiles/red_tile_flower_main_d scale 1, 1 red global2 green global3 blue global4 } } textures/darkmod/stone/tiles/red_tile_flower_trim_d { "surftype15" description "tile" diffusemap textures/darkmod/stone/tiles/red_tile_flower_trim_d bumpmap textures/darkmod/stone/tiles/red_tile_flower_trim_n // TDN Ambient Method Related { if (global5 == 1) blend add map textures/darkmod/stone/tiles/red_tile_flower_trim_d scale 1, 1 red global2 green global3 blue global4 } } Edited May 5, 2020 by NeonsStyle Adding texture images Quote I have an eclectic YouTube channel making videos on a variety of games. Come and have look here:https://www.youtube.com/c/NeonsStyleHD Dark Mod Missions: Briarwood Manor - available here or in gamehttp://forums.thedarkmod.com/topic/18980-fan-mission-briarwood-manor-by-neonsstyle-first-mission-6082017-update-16/ Link to post Share on other sites
Dragofer 1357 Posted May 5, 2020 Report Share Posted May 5, 2020 @NeonsStyle 2 things to look into: to be on the safe side, I'd change the names of the normalmaps so that they end in _local instead of _n. Don't forget to update the material with the new names. surftype15 shouldn't be in quotation marks Also, these files don't happen to be stored in a dds folder? If they're .tga they don't belong there. Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide Link to post Share on other sites
NeonsStyle 572 Posted May 6, 2020 Report Share Posted May 6, 2020 9 hours ago, Dragofer said: @NeonsStyle 2 things to look into: to be on the safe side, I'd change the names of the normalmaps so that they end in _local instead of _n. Don't forget to update the material with the new names. surftype15 shouldn't be in quotation marks Also, these files don't happen to be stored in a dds folder? If they're .tga they don't belong there. Just tried that. Didn't work. Changing the file name shouldn't matter anyway, as the material file doesn't care what the filename is called, just what it is. Plus I don't like the _local idea as it's confusing, while trying to learn this stuff, I found it difficult to findout what _local meant. So I use Peters method of _d for diffuse, _n for normalmap, _ed for editor image, and _s for specularmap. No, the files are not in dds folders. They are in textures folder inside the fms mission folder with all the other new textures. I am completely stumped on this. Quote I have an eclectic YouTube channel making videos on a variety of games. Come and have look here:https://www.youtube.com/c/NeonsStyleHD Dark Mod Missions: Briarwood Manor - available here or in gamehttp://forums.thedarkmod.com/topic/18980-fan-mission-briarwood-manor-by-neonsstyle-first-mission-6082017-update-16/ Link to post Share on other sites
JackFarmer 475 Posted May 10, 2020 Report Share Posted May 10, 2020 Is there a way to split the title into two lines? Quote Link to post Share on other sites
Dragofer 1357 Posted May 10, 2020 Report Share Posted May 10, 2020 @JackFarmer Behind Closed Doors does this, maybe you'd like to take a closer look at its darkmod.txt? darkmod.txt Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide Link to post Share on other sites
JackFarmer 475 Posted May 10, 2020 Report Share Posted May 10, 2020 @Dragofer Thanks, I've looked into it, but it does not include a specific command for a line break. Indeed, moving the words around forces a line break but at the price that one receives a large space in the overall missions list. hmm.... Quote Link to post Share on other sites
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.