[Code Bounty] Update UpdatePaths for Multiple Inputs

How, what and why to code in BYOND.
Locked
User avatar
san7890
In-Game Game Master
Joined: Mon Apr 15, 2019 8:12 pm
Byond Username: San7890
Github Username: san7890
Location: here
Contact:

[Code Bounty] Update UpdatePaths for Multiple Inputs

Post by san7890 » #643053

This is either a very trivial task or something incredibly difficult. If you suck at Python, this may not work for you.

I wrote about this in coderbus, but no one got back to me (probably because I sent a wall of text), so I'm going to rescue it out of there in the hopes that one brave coder will accomplish this:

Does anyone know if it's possible to retool the UpdatePaths tool to allow multiple paths in the input field? I was able to find Spacemaniac have it work for multiple outputs back in 2018 via https://github.com/tgstation/tgstation/pull/40072 . The reason I ask was because that same PR mentioned in the body of the one previously linked (tgstation/40065) introduced a behavior where it would add multiple corners onto one tile, causing much larger map files. I've introduced turf decals to rectify and reconcile such behavior (https://github.com/tgstation/tgstation/pull/65290 and https://github.com/tgstation/tgstation/pull/65455), but it will continue to be CBT until an UpdatePaths Script can be written. This is an example map key:

Code: Select all

"qp" = (
/obj/effect/decal/cleanable/dirt,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden,
/obj/effect/turf_decal/tile/blue,
/obj/effect/turf_decal/tile/blue{
    dir = 4
    },
/turf/open/floor/iron{
    initial_gas_mix = "TEMP=2.7"
    },
/area/shuttle/caravan/freighter1)
(if you have absolutely zero clue what a map key even is, you can read a little bit about it here: https://hackmd.io/@tgstation/ry4-gbKH5# ... lds-barred

Basically, in short terms, I want to reaccommodate this file: https://github.com/tgstation/tgstation/ ... _main__.py to accomodate such a line in a script:

Code: Select all

/obj/effect/turf_decal/tile/blue , /obj/effect/turf_decal/tile/blue {dir=4} : /obj/effect/turf_decal/tile/blue/half/contrasted {dir=4}
Then, hopefully get the following map key output:

Code: Select all

"qp" = (
/obj/effect/decal/cleanable/dirt,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden,
/obj/effect/turf_decal/tile/blue/half/contrasted{
    dir = 4
    },
/turf/open/floor/iron{
    initial_gas_mix = "TEMP=2.7"
    },
/area/shuttle/caravan/freighter1)
However, I do not know even a penny's worth of python. In my test example, I'd probably have to layer the way that I run such scripts (to prevent false/incorrect matching), but that's a later issue.

There are a few issues with this:

Firstly, DMM files format themselves in different manners. That example I posted above with the pre-update map key "qp" could potentially be layered as such:

Code: Select all

"qp" = (
/obj/effect/turf_decal/tile/blue,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden,
/obj/effect/decal/cleanable/dirt,
/obj/effect/turf_decal/tile/blue{
    dir = 4
    },
/turf/open/floor/iron{
    initial_gas_mix = "TEMP=2.7"
    },
/area/shuttle/caravan/freighter1)
I know that UpdatePaths is written for the TGM format, but I am not sure if it is able to fully parse a key to ensure that no matter what order the paths in a key are located that it would still catch, match, and replace it accordingly. Do keep in mind that in my test example (which I eventually want to make scripts for to happen for real), turf_decal objects are 99% of the time formatted like the first example given. The change that I want does not really "break" maps, but it is definitely something that should be kept in mind.

This whole thing will probably require a bit of time, and I appear to be the only person who wants it (aside from a potential case in https://github.com/tgstation/tgstation/pull/66044). It will likely require completely new functionality not seen in UpdatePaths, and it is unlikely to be trivial.

I have money, but I am going to start it off by setting the floor for this bounty at $15. Please do feel free to DM me via Discord at (@san7890#7890) if you would like to ask for a higher rate, because I do not feel it would be fair to make someone do something that I have absolutely no idea how to accomplish with a meager salary. I can use PayPal, Apple Cash, Venmo, or maybe some gift card to something if you'd rather that for any reason. Thank you for your time.
Simultaneously making both the best and worst jokes on the internet. I like looking at maps and code. Learn how to map today!. You may rate me here.
User avatar
san7890
In-Game Game Master
Joined: Mon Apr 15, 2019 8:12 pm
Byond Username: San7890
Github Username: san7890
Location: here
Contact:

Re: [Code Bounty] Update UpdatePaths for Multiple Inputs

Post by san7890 » #646338

I sat down for a solid hour trying to see if I could do this myself and I have realized that I can not.
Simultaneously making both the best and worst jokes on the internet. I like looking at maps and code. Learn how to map today!. You may rate me here.
User avatar
san7890
In-Game Game Master
Joined: Mon Apr 15, 2019 8:12 pm
Byond Username: San7890
Github Username: san7890
Location: here
Contact:

Re: [Code Bounty] Update UpdatePaths for Multiple Inputs

Post by san7890 » #672046

beestation already made a tool that does the exact thing i wanted now so i'll be closing this bounty. thanks for your interest https://github.com/BeeStation/BeeStatio ... regator.py

(i ported it over in https://github.com/tgstation/tgstation/pull/74169)
Simultaneously making both the best and worst jokes on the internet. I like looking at maps and code. Learn how to map today!. You may rate me here.
Locked

Who is online

Users browsing this forum: No registered users