That isn't working for me in testing. Are you sure textInput is present in PA's version of KnockOut? From what I can tell it's added in KnockOut 3.2.0; PA's ko.version is returning 3.1.0.
Oh. Okay other method: When I wrote PA Chat I needed this kind of thing as well and for some reason found this solution before the textinput binding. Like this it definitely works inside PA, the autocomplete names on tab features relies on it.
@cola_colin Yeah, I just tested valueUpdate and it seems to work fine. Thanks! While I've got you here, could you help me with a couple other things? I'd like to detect keypresses and use a file selector to grab a file path, but I have no idea how to do either.
Where do you want to detect keypressed? Everywhere? Then you can do something like $(document).keypress(function(e) {console.log(e);}) If you want to have it work together with the hotkey configuration of PA it will be more complex, I don't know how that works by heart. @proeleert probably is more an expert in that area. To open json files: api.file.loadDialog().then(function(f) {console.log(f);}) If the file is not json you will need to fallback to calling the base engine call yourself: engine.asyncCall('file.loadDialog', String(undefined)).then(function(raw) { console.log(raw); }); To save a file: api.file.saveDialog("name.json", "some string data"); I dont think there is a way to get file paths. Only filecontent.
New version now available with a few small features and bug fixes. Also, here's the Trello I'm using to keep vaguely organized. All the stuff listed there currently will be added or fixed before I put the mod on PAMM. I'll give that a shot. I don't need anything fancy, just simple detection. I was hoping to be able to get the paths to brush .JSONs with a file selector, since right now typos in the model field will crash PA.
I am not entirely sure, but from a quick look I would guess PA itself uses the file \media\pa\terrain\brush_list.json as the list for all brushes. I guess you could load that file and make a combobox with the json paths. Maybe add an "advanced" option to allow users to enter a path by hand in case the file does not contain it. Though you could also just ask the user to add the path to the file instead. Also I think maybe a dev (@masterdigital @jorgenpt @jables) could look into why it crashes when a wrong path to a csg brush in the editor is given. It should handle that issue more gracefully and not just flat out die. EDIT: Oh another way to get brushs I was using in my hack editor is: Open the biome files of known biomes and grab all brushes you can find from them. I found some csg brushes that were not part of the brush list at the time with that. Dunno if they were actually useful or broken. The brushlist might be enough for you.
Not sure if this is a PA thing or something with your mod, but the csg does not seem to be saving for me. Also this really needs a delete all CSG button.
It's a PA thing, one of your planet settings for height range, water height, water depth, or temperature isn't a whole number (has a decimal with a ton of numbers after it), so you have to edit the .pas file to make it whole or the CFGs won't load Also do you put this mod in the client_mods folder or the server_mods folder? I dont have one that just says mods EDIT: got it, didn't realize I had to also activate it in PAMM before launching the game
I'll give this some thought. There are a few ways we could go here, but I'm concerned in particular with making sure users have access to any brush defined in their directory, whether hidden or mod-created or otherwise. Could you give a few more details? If you mean this is happening after you save a system and reopen it, that is a known issue with PA; if you put the map on System Sharing I could try to debug it further. Right now the delete button auto-selects the next brush in the list, so you can spam it a bunch and get rid of everything. In future versions you'll be able to double click and select all brushes, which you can then delete in one go. If a planet has no CSG at all, though, it will generate it randomly, so you need to have at least one brush present to avoid this.
That is so weird, I wonder why it has to be a whole number. Well I guess now I just have to export/import whenever I want to edit a custom system/planet Yeah spamming gets annoying after doing it for 12 planets or so . But now that I know that you can't have decimals I should not have to do that that much.
I think I am starting to get the hang of it. [edit] Playtest shows that subtractive brushes or something is needed so that units can pass under the ring
For what it's worth, I make sure to set all planet parameters to whole numbers when DirectEdit writes them. I don't know if that fixes the problem for certain (unexpected decimals are one of several reasons this can happen), but I would hope it does, since the entire point of this mod is to avoid having to edit .pas files externally. Looks nice! Naval units can't path under bridges, but I've found that land units tend to do alright. If you need to debug your pathfinding, you can start a game and then turn the pathing visualizer on; I think the default hotkey is ctrl-shift-f11. Red boxes will appear on unpathable surfaces. no_features is meant to prevent feature objects like trees and metal spots from appearing on CSG brushes, but it is currently non-functional. That's a PA bug, not a mod bug. (@jables) The up/down buttons change the selected brush's position in the list. This can be important, since brushes are applied sequentially to the planet's Constructive Solid Geometry and can therefore act on one another as well as on the heightmap. For instance, a crater will carve away a mountain if the crater is after the mountain in the brush list.
New version now available: 0.3.0 Now with multiple brush selection! Use ctrl-click and shift-click to select multiple brushes in the list, and make changes to all of them simultaneously. You can also double-click to select every brush in the list. I've also replaced the overwrite function, since the old one occasionally failed to correctly delete planets due to a weird PA quirk. The new function basically clears the system and adds planets back in, so they will appear to unload after writing. I've done a little bit of testing and it seems okay, but let me know you're losing data somewhere.
Does not seem like units can't path there, it just seems like they want to go on the ring first. Also projectiles do not fire under it ether, they just hit an invisible wall...
Strange. This may have broken due to the recent pathing optimizations; I'm fairly certain maps like that worked in the past. Might be worth starting a bug report thread. @superouman's been having similar issues I think. https://forums.uberent.com/threads/about-tunnels-and-viaducts.67872/
figured it out. CSG needs to have mergeable set to true to be able to have units pass under it. [edit] play tested again. only bug is as you said naval units can't pass under csg, really annoying.
Might I request an ability to edit the landing_zones and metal_spots data? It would tie in nicely with my work on equidistant spawns/metal spots - https://forums.uberent.com/threads/fair-equidistant-metal-distribution-and-spawns.67907/