Line action/special across different map formats

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Line action/special across different map formats

Postby Apeirogon » Thu Nov 14, 2019 6:00 am

After some checks I turns out that gzdoom dont convert line special from doom/hexeretic/boom/etc. formats to specials defined here
https://zdoom.org/wiki/Action_specials

For example, my script which check line for doors special number, and expect that door would have action numbers 10, 11, 12, 13 and 14, simply dont work with doors from map01 because they uses
special 1 DR door open wait close(also monsters)
special 31 D1 door open stay
with no additional arguments provided. This is confuses my script and it return, after checking lines with such special, something like "this is impassable blank wall, cant do anything with it"

There are "native readonly int maptype;" variable in levellocals struct
https://github.com/coelckers/gzdoom/blo ... se.zs#L688
but looks like it uses internal enums for it
https://github.com/coelckers/gzdoom/blo ... nfo.h#L269
so technically I can use it to determine what map type loaded right now.

Question is, is that okay?
Did I understand correct and there are no more convenient way to do so? I mean, I must define doors line special definition for doom/hexeretic/boom/etc. in order to use it for checks "is this door"?
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Line action/special across different map formats

Postby Graf Zahl » Thu Nov 14, 2019 8:16 am

Since you did not post any code, I cannot say. The Doom format specials are one of the first thing to be converted when a map gets loaded. The main engine knows nothing about them.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Line action/special across different map formats

Postby Kappes Buur » Thu Nov 14, 2019 10:06 am

Are you trying to convert a map from DOOM in DOOM format to DOOM in Hexen format
and then keep working on it?

If so, then you have to use zwadconv.exe first.
User avatar
Kappes Buur
 
 
 
Joined: 17 Jul 2003
Location: British Columbia Canada

Re: Line action/special across different map formats

Postby Apeirogon » Thu Nov 14, 2019 5:12 pm

Code out of context, but looks like I forced it to work...or at least do something, since it now correctly recognizes doors/lifts
Code: Select allExpand view
    //if ceiling/floor of one sector higher/lower than floor/ceiling of other sector
    if(self_floor >= other_ceiling || other_floor >= self_ceiling || other_floor >= other_ceiling || other_ceiling <= other_floor)
    {
        //still need check is there are any special on line between this sectors
        if(boundary_lines[internal_sector_number].special > 0)
        {
            //doom line special maptype too primitive and it automatically apply to line backsector
            //so make assumption it is correct special true here
            if(level.maptype == MAPTYPE_DOOM)
            {
                movable_sector = true;
            }
           
            //hexen more complicated and it use line args[0]
            //which define sector tag which are activates by this
            //unfortunately it uses tags even if activating sector located on the line backside
            else if(level.maptype == MAPTYPE_HEXEN)
            {
                if(boundary_lines[internal_sector_number].args[0] > 0)
                {
                    //so try find this sector activation line in precomputed array of "line which activate sector(s) by its tag"
                    if(path_algorithm(all_graph_list).sector_to_line_special(node_base(representation).get_sector(), true )  != null)
                    {
                        //so assumption was correct
                        movable_sector = true;
                    }

                    //else, its acs/zscript script which do so
                    else
                        return false;
                }
            }
           
            //in udmf usually "args[0] > 0" means sector tag
            //also, args[1] must be greater than zero, because it usually define sector speed
            else if(level.maptype == MAPTYPE_UDMF)
            {
                //args[0] means activate backside sector
                if(boundary_lines[internal_sector_number].args[0] == 0 && boundary_lines[internal_sector_number].args[1] > 0)
                {
                    movable_sector = true;
                }
               
                else if(boundary_lines[internal_sector_number].args[0] > 0 && boundary_lines[internal_sector_number].args[1] > 0)
                {
                    //so try find this sector activation line in precomputed array of "line which activate sector(s) by its tag"
                    if(path_algorithm(all_graph_list).sector_to_line_special(node_base(representation).get_sector(), true )  != null)
                    {
                        //sector change height by some line
                        //it just point here that this is possible
                        //without explictly definig what exactly line, what activation type, etc
                        movable_sector = true;
                    }

                    //else, its acs/zscript script which do so
                    else
                        return false;
                }
            }
        }

        //probably sector have some specific activation logic like a_bossdeath
        else
            return false;
    }




Are you trying to convert a map from DOOM in DOOM format to DOOM in Hexen format

No, I want read map data after loading and then use it to do something.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest