[Added] Assign line ID using LevelCompatibility in UDMF?

Moderator: GZDoom Developers

Assign line ID using LevelCompatibility in UDMF?

Postby gramps » Mon Jan 14, 2019 8:16 pm

Can LevelCompatibility be used to give a line an ID in a UDMF map?

Line_SetIdentification and other line specials that would set an ID in other formats don't work in UDMF, as described on wiki. Is there another way?

I'd like to auto-generate IDs for some lines, so they don't need to be defined on the map. But right now each ID needs to be specified twice on each line in the map, once as an actual id and once as a UDMF user field, since IDs can't be read by LevelCompatibility.

If IDs can't be written in UDMF format by LevelCompatibility, it looks like the only way to generate them will be to switch to Doom or Hexen format, which seems backwards. Would also have to hack another UDMF user field in as something else, like an unused special arg, and throw it out later in LevelCompatibility.
gramps
 
Joined: 18 Oct 2018

Re: Assign line ID using LevelCompatibility in UDMF?

Postby Graf Zahl » Wed Jan 16, 2019 6:39 am

Internally there is such a function that returns a line's first ID but it was never needed on the script side so far.
The main problem you are facing is simply that the compatibility handler only got functions added on an as-needed basis. So far there haven't been maps that needed line ID manipulation to fix problems so there are no functions for it.

Since you are basically the first person to use this feature for programmatic map manipulation your only choice is to make feature requests to get the needed features in.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Assign line ID using LevelCompatibility in UDMF?

Postby gramps » Wed Jan 16, 2019 2:52 pm

Got it. I guess this can go in feature suggestions as-is; requested a move.
gramps
 
Joined: 18 Oct 2018

Re: Assign line ID using LevelCompatibility in UDMF?

Postby Graf Zahl » Wed Jan 16, 2019 3:02 pm

For that, please report it. I cannot do it.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Assign line ID using LevelCompatibility in UDMF?

Postby gramps » Thu Jan 17, 2019 4:09 am

Saw this in https://github.com/coelckers/gzdoom/commit/3df112a7

Really nice, this completely removes the need for tedious ID assignment when cut-n-pasting my "zones."

OT: finally got these static portals working. LevelCompatibility is very powerful. :)
gramps
 
Joined: 18 Oct 2018

Re: Assign line ID using LevelCompatibility in UDMF?

Postby Nash » Thu Jan 17, 2019 5:40 am

At this point I wonder what really separates compatibility scripting (as in, fixing glitchy, previously-working maps) from "powerful level altering scripting made for modern mods"...
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: Assign line ID using LevelCompatibility in UDMF?

Postby Graf Zahl » Thu Jan 17, 2019 5:54 am

At the moment: The feature set. You still need a working level in which you can change stuff, but not add or remove.

If you look at some of the compatibility code you'll see that for some maps it's not just filling in some blanks but heavily restructuring of certain areas that were made with hacky constructs. Especially the fixes for Kama Sutra MAP01 and Alien Vendetta MAP01 are quite complex.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Assign line ID using LevelCompatibility in UDMF?

Postby gramps » Thu Jan 17, 2019 5:00 pm

I guess the conversation to have is whether it makes sense to rework the API a bit so this all works through the event handlers, say in a LevelLoaded event, with LevelCompatibility passed in as a param.[1]

If so, what should the actual scope of it be... should it be able to add and remove stuff?

[1] - Just to make it a normal feature, not undocumented, and not feel too much like subverting an unrelated feature. Also because an EventHandler is likely sort of the "main class" in a mod, and this would avoid the need for a thinker singleton to get stuff back and forth between your LevelCompatibility and your EventHandler.
gramps
 
Joined: 18 Oct 2018


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: TheLightBad96 and 1 guest