OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Finnik on January 06, 2020, 07:55:35 pm

Title: [DONE][Suggestion] Possibility to choose groups in addLine mapScript command
Post by: Finnik on January 06, 2020, 07:55:35 pm
We are making rather complicated terrain with roads moved to different terrain, so we add them with mapscript like that:
Code: [Select]
    - type: addLine
      label: 100
      terrain: URBAN_ROADS
      direction: vertical
We have a lot of interesting ideas for the roads - highways, railroads, etc, but we can't mix different type of roads into one terrain. So we need one terrain for ground roads, one for highway, and if we want to make crossroads with different type of roads - railroad under the highway, we need separate terrain for any possible combination, in order to make sure that addLine command will choose blocks of only one needed type per line. So, it would be very practical for mod developing to have an option to choose groups for addLine.
Title: Re: [SUGGESTION] Possibility to choose groups in addLine mapScript command
Post by: Solarius Scorch on January 06, 2020, 08:02:14 pm
I wholeheartedly support this idea in the name of free road/highway intersections.
Title: Re: [SUGGESTION] Possibility to choose groups in addLine mapScript command
Post by: Meridian on January 07, 2020, 04:47:29 pm
Seems to be trivial to add.
in BattlescapeGenerator::addLine()

How about you try locally and PR it when tested and working...
Title: Re: [SUGGESTION] Possibility to choose groups in addLine mapScript command
Post by: ohartenstein23 on January 07, 2020, 05:24:57 pm
I think it would be easy to add, but there's the difficulty of how it should handle an addLine with "direction: both" - should the group(s) you defined be applied to the vertical part of the line, the horizontal part of the line, or the crossing part?
Title: Re: [SUGGESTION] Possibility to choose groups in addLine mapScript command
Post by: Meridian on January 07, 2020, 05:50:03 pm
I think it would be easy to add, but there's the difficulty of how it should handle an addLine with "direction: both" - should the group(s) you defined be applied to the vertical part of the line, the horizontal part of the line, or the crossing part?

You need to send 3 parameters in such case (direction both), 1 for each group.
In other cases (direction vertical or horizontal), you need to send 2 parameters (one for direction group and one for crossing group).
Title: Re: [SUGGESTION] Possibility to choose groups in addLine mapScript command
Post by: Finnik on January 10, 2020, 02:22:54 am
https://github.com/MeridianOXC/OpenXcom/pull/33

I hoped I will manage to make its step size moddable (not hardcoded 10) but for now no visible progress on that. sample mod for testing is attached.

btw, I noticed that lines tend to stick to lower boundaries, but it can't see if my code affects that.
Title: Re: [SUGGESTION] Possibility to choose groups in addLine mapScript command
Post by: davide on January 10, 2020, 08:52:14 am
I remember a very old outdated thread about multi-line map design:
https://openxcom.org/forum/index.php/topic,2934.0.html (https://openxcom.org/forum/index.php/topic,2934.0.html)

Original "Siberia" terrain from ufo2k (cross-line)

(https://openxcom.org/forum/index.php?action=dlattach;topic=2934.0;attach=30981;image)

and "normandy" terrain from ufo2k (parallel ordered line)

(https://openxcom.org/forum/index.php?action=dlattach;topic=2934.0;attach=27866;image)


Title: Re: [SUGGESTION] Possibility to choose groups in addLine mapScript command
Post by: Finnik on January 10, 2020, 10:01:16 am
For Normandy, I'd use regular addBlock as it is very limited with rects, but can use 20x20 blocks. As every line is solid defined with rects I see no big difference. But for things with several lines that should be mixed it could be handy
Title: Re: [DONE][Suggestion] Possibility to choose groups in addLine mapScript command
Post by: Meridian on January 11, 2020, 11:36:54 am
https://github.com/MeridianOXC/OpenXcom/pull/33

Merged.