PWAD%l--AlterMap v1.2 by Chaobrother. This is a script remodeled from Paradise Illusion. --Toggles the normal look of a stage to something else. -- Parameters -- 0: Normal Standard, Encore Alternate -- 1: Normal Alternate, Encore Standard -- 2: Normal and Encore Standard mode. This is the default. -- 3: Normal and Encore Alternate mode. -- Level Header parameters: --[[ lua.altermap: This level has an alternate mode where the default can be changed with a console command. Make sure to call ALTERMAPDECLARATION with your map number in an external script for proper operation. lua.altermapsky: Sets the sky to the number defined when loaded into alternate mode. lua.altermapexecute: A linedef number to execute when in alternate mode. lua.altermapbrightness: Increments all sector brightnesses by the number defined. lua.altermapflats: A comma seperated list of flats to replace. The pattern is oldflat, newflat. If there are too many caracters to fit in one argument use altermapflats1 to altermapflats[n] instead, where [n] is any number (without brackets). lua.altermaptextures: Same usage as altermapflats but for textures. lua.altermapencore: Enables an Encore mode hack which will force the map to load in its Encore style without the palette at the expense of the map not flipping. This will only occur if the unused style is shown in Encore with altermap command parameters 0 or 1. ]] --Linedef executor ALTERMAP does alternate mode operations without needing a console --variable or being an altermap. if AlternateMapLib return end rawset(_G,"AlternateMapLib",true) rawset(_G, "ISALTERMODE", false) if not ALTERMAP_COMMTABLE rawset(_G,"ALTERMAP_COMMTABLE",{}) end -- Call this function in a different script to setup an altermap. -- i is map index, command is a custom command which can be -- used to change value and be called for other checks outside of this script. -- value is the default altermap argument for your map. -- You may need to change or add a command to your map if there is a netid conflict. rawset(_G, "ALTERMAPDECLARATION", function(i,command,value) if not ALTERMAP_COMMTABLE[i] if command ~= nil ALTERMAP_COMMTABLE[i] = CV_RegisterVar({ name = command, defaultvalue = value or "Off", flags = CV_NETVAR, possiblevalue = {Off = 0, On = 1, Never = 2, Always = 3} }) rawset(_G,command,ALTERMAP_COMMTABLE[i]) else ALTERMAP_COMMTABLE[i] = CV_RegisterVar({ name = "alter"..string.lower(G_BuildMapName(i)), defaultvalue = value or "Off", flags = CV_NETVAR, possiblevalue = {Off = 0, On = 1, Never = 2, Always = 3} }) end end end) local function tableparse(x) if not x return {} end local y = {} local i = 0 for word in x:gmatch('[^,%s]+') do y[i+1] = word i = $+1 end return y end -- garbage string for swapping, B311RGIM --[[Converts a level header with texture swaps (A->B) (B->A) to a list which facilitates practically doing so (A->C)(B->A)(C->B) currently non-functional due to some unknowns and combos of swaps/nonswaps]] local function swapparse(x) local haveSeen = {} local swapindex = {} for i = 1, #x do local element = x[i] if not haveSeen[element] then haveSeen[element] = {i} else table.insert(haveSeen[element],i) end end for k,v in pairs(haveSeen) print(#v) end for i=1, #x do --0,1,1,0 --1,2,0,1,2,0 if #haveSeen[x[i]] == 1 --unique value table.insert(swapindex,x[i]) else for j = 1, #haveSeen[x[i]] if haveSeen[x[i]][j] % 2 ~= 0 and i > haveSeen[x[i]][j] --from value table.insert(swapindex,x[i+1]) table.insert(swapindex,"GFZROCK") table.insert(swapindex,x[i]) table.insert(swapindex,x[i+1]) table.insert(swapindex,"GFZROCK") table.insert(swapindex,x[i]) --haveSeen[x[i]][j] = i end break end end end for i = 1 , #swapindex do if swapindex[i] --print(swapindex[i].." ") end end return swapindex end local function tableconcat(param) local i = 1 local z = tableparse(mapheaderinfo[gamemap][param]) local y = {} repeat y = tableparse(mapheaderinfo[gamemap][param..i]) if not y break end for j = 1 , #y table.insert(z,y[j]) end i = $1 + 1 until not mapheaderinfo[gamemap][param..i] return z end --Function which handles all altermapalterations --[[Linedef Properties -Backside texture: Name is appended to altermapflats and altermaptextures for the potential of multiple textureswaps. -Front side X offset determines global brightnees increment. -Block Enemies will make the linedef only affect global brightness. ]] local function doaltermap(j,mo,d) local flatset = {} local textureset = {} local brightmod = 0 if not j if mapheaderinfo[gamemap].altermapsky P_SetupLevelSky(tonumber(mapheaderinfo[gamemap].altermapsky), true) end if mapheaderinfo[gamemap].altermapexecute P_LinedefExecute(tonumber(mapheaderinfo[gamemap].altermapexecute)) end end if not j or ~(j.flags & ML_BLOCKMONSTERS) if j and j.backside if mapheaderinfo[gamemap]["altermapflats"..string.lower(j.backside.text)] flatset = tableconcat("altermapflats"..string.lower(j.backside.text)) end if mapheaderinfo[gamemap]["altermaptextures"..string.lower(j.backside.text,"ALTERMAP")] textureset = tableconcat("altermaptextures"..string.lower(j.backside.text,"ALTERMAP")) end else if mapheaderinfo[gamemap].altermapflats or mapheaderinfo[gamemap].altermapflats1 flatset = tableconcat("altermapflats") end if mapheaderinfo[gamemap].altermaptextures or mapheaderinfo[gamemap].altermaptextures1 textureset = tableconcat("altermaptextures") end end end if j brightmod = j.frontside.textureoffset/FRACUNIT elseif mapheaderinfo[gamemap].altermapbrightness brightmod = tonumber(mapheaderinfo[gamemap].altermapbrightness) end --Texture Replacement for s in sectors.iterate s.lightlevel = $1 + brightmod for i = 1 , #flatset, 2 if s.floorpic == flatset[i] s.floorpic = flatset[i+1] end if s.ceilingpic == flatset[i] s.ceilingpic = flatset[i+1] end end end local function textureswap(l,old,swap) if (l.special == 439) return end --Front side local this = l.frontside if (this.toptexture == old) this.toptexture = swap end if (this.midtexture == old ) this.midtexture = swap end if (this.bottomtexture == old) this.bottomtexture = swap end if l.backside == nil return --One-sided stops here. end --Back side local this = l.backside; if (this.toptexture == old) this.toptexture = swap end if (this.midtexture == old) this.midtexture = swap end if (this.bottomtexture == old ) this.bottomtexture = swap end end for l in lines.iterate for i = 1 , #textureset, 2 textureswap(l,R_TextureNumForName(textureset[i]),R_TextureNumForName(textureset[i+1])) end end end addHook("LinedefExecute", doaltermap,"ALTERMAP") addHook("MapChange",function() if not mapheaderinfo[gamemap].altermap == true return end if not ALTERMAP_COMMTABLE[gamemap] ALTERMAPDECLARATION(gamemap) end end) addHook("MapLoad", function(mapnum) if not mapheaderinfo[gamemap].altermap == true return end if (ALTERMAP_COMMTABLE[gamemap].value == 1 and encoremode == true) or (ALTERMAP_COMMTABLE[gamemap].value == 0 and encoremode == false) or (ALTERMAP_COMMTABLE[gamemap].value == 2) ISALTERMODE = false --See what you are missing in Encore mode. return end ISALTERMODE = true doaltermap() end) local oldaltvar local function altmodevars(net) oldaltvar = net($) end addHook("ThinkFrame",function() --Hacky method to supress encore when altermap is on or off. if not mapheaderinfo[gamemap].altermap or not (ALTERMAP_COMMTABLE[gamemap].value == 1 or ALTERMAP_COMMTABLE[gamemap].value == 0) or(encoremode == false) return end --Using flashpals in encore did not work as intended; the palette would always be a --default one (%75 tinted white) --[[for p in players.iterate P_FlashPal(p,7,1) end]] --Reload the map instead if mapheaderinfo[gamemap].altermapencore if leveltime == 1 oldaltvar = ALTERMAP_COMMTABLE[gamemap].value local changeval if ALTERMAP_COMMTABLE[gamemap].value == 1 changeval = 2 end if ALTERMAP_COMMTABLE[gamemap].value == 0 changeval = 3 end COM_BufInsertText(server, ALTERMAP_COMMTABLE[gamemap].name.." "..changeval) if CV_FindVar("kartencore").value == 1 COM_BufInsertText(server, "map "..gamemap.." -e") else COM_BufInsertText(server, "kartencore off") COM_BufInsertText(server, "map "..gamemap) end COM_BufInsertText(server, "wait 1") COM_BufInsertText(server, ALTERMAP_COMMTABLE[gamemap].name.." "..oldaltvar) end end end) --Object skins v1.2 --Script made by Chaobrother, special thanks to Ashnal for the initial rewrite. --Object spawn state swapping may crash with objects that have MF_RUNSPAWNFUNC. --This is a script which changes a particular property of an object. --Hopefully it will cut down on freeslot/thing starvation. --There are also server commands for global overrides. --Map Header Setup: Use Lua.ObjectSkin then a comma separated list. --Each object to change can have all of its properties modified. The order can vary, but: --Start off with your object type you want to modify starting with "MT_" --The following arguments should alternate until the end of the level header or you want to use a new object. --The first argument is the type of property to change: S_RAISESTATE, S_SPAWNSTATE, etc. --this should be written as the property appears in an object definition (e.g spawnstate) --Changing the spawn state will also alter the current state. --The second is the property's new value. Use _G[MT_Object] if the new value is an object. --Lua.spawnskin merely changes the frame and sprite of an object on spawn. --Like object skin enter your parameters as a comma separated list. --The first argument is the object to look for. --The second is the new sprite prefix with SPR_ in the front. --The third is the new frame. --If you run out of space on a line add a number starting from one to a new level header parameter. --Example: Lua.spawnskin, Lua.spawnskin1,Lua.spawnskin2,... --The script will concatenate each header. --[[Server Commands obsk_add: Defines custom state overrides for all maps. By default changes here do not take precedence over custom overrides defined by level header parameters. Argument: A comma seperated string that is formatted the same as lua.objectskin level header parameter. --Start off with your object type you want to modify starting with "MT_" --The following arguments should alternate until the end of the levelheader or you want to use a new object. --The first argument is the type of property to change: S_RAISESTATE, S_SPAWNSTATE, etc. --this should be written as the property appears in an object definition (e.g spawnstate) --Changing the spawn state will also alter the current state. --The second is the new property. obsk_remove: Removes a custom overide from all maps Argument: A comma seperated list with the object and all states that need to be cleared to follow. Every custom override for a given object is cleared if no states are given. e.g: MT_OBJECT, spawnstate obsk_clear: clears all of the server's custom overrides for all maps. No Arguments obsk_disable: Prevents (but does not remove) the server's custom overrides from loading. Arguments: on or off. obsk_serverpriority: Determines if the server's overrides or the maps should take precedence. Arguments: on or off. obsk_fastload: Makes changes to the server's overrides immediate. May cause issues if enabled. Arguments: on or off. ]] --The complete script is not to be modified as it would change the behavior of other map packs which use it. --It is free to be packaged with your file. --Any part of the script is free to reuse for external purposes, however. if (objectskin_initialized) then return end -- Check if the script has already been run local function tableparse(x) local y = {} local i = 0 if x for word in x:gmatch('[^,%s]+') do y[i+1] = word i = $+1 end end return y end local function tableconcat(param) local i = 1 local z = tableparse(mapheaderinfo[gamemap][param]) local y = {} repeat y = tableparse(mapheaderinfo[gamemap][param..i]) if not y break end for j = 1 , #y table.insert(z,y[j]) end i = $1 + 1 until not mapheaderinfo[gamemap][param..i] return z end local function stroperators(val1,token,val2) if token == "<<" then return val1 << val2 elseif token == ">>" then return val1 >> val2 elseif token == "|" then return val1 | val2 elseif token == "&" then return val1 & val2 --[[elseif token == "^^" then return val1 ^^ val2 elseif token == "~" then return val1 ! val2 elseif token == "!" then return val1 ! val2]] end if token == "-" then return val1 - val2 elseif token == "+" then return val1 + val2 elseif token == "/" then return val1 / val2 elseif token == "*" then return val1 * val2 elseif token == "%" then return val1 % val2 elseif token == "^" then return val1 ^ val2 else print("Operation error with "..(val1 or "nil")..","..(token or "nil")..", and "..(val2 or "nil")) return nil end end local function strtomath(str) local operators = {} local operands = {} for w in str:gmatch("[%+%-%*%/%|%^%%%%&(%<)(%>)]+") do table.insert(operators,w) end for w in str:gmatch("[^%+%-%*%/%|%^%%%%&(%<)(%>)]+") do table.insert(operands,w) end local num = _G[operands[1]] or tonumber(operands[1]) local num2 for k=1 , #operands do if operands[k+1] and operators[k]then num2 = _G[operands[k+1]] or tonumber(operands[k+1]) num = stroperators(num,operators[k],num2) end end return num; end local function swaptablemake(sswaptable, restable, instr) local mobjtype = 0 local propertykey local restableticker = 0 local stateswapval = 0 local alreadykey = 0 for i = 1, #instr if string.sub(instr[i],1,3) == "MT_" mobjtype = _G[instr[i]] restableticker = 0 if restable[mobjtype] == nil restable[mobjtype] = {} end if sswaptable[mobjtype] == nil sswaptable[mobjtype] = {} end continue else --If you need to use objects for other purposes. --Use _G[objectype] without quotes in the brackets. instr[i] = string.gsub(instr[i],"_G%b[]", function(w) return _G[string.sub(w,4,-2)] end) if restableticker == 1 if tonumber(instr[i]) stateswapval = instr[i] else if not _G[instr[i]] stateswapval = strtomath(instr[i]) else stateswapval = _G[instr[i]] end end sswaptable[mobjtype][propertykey] = stateswapval else propertykey = instr[i] alreadykey = 0 --Setting up restoration. for j = 1, #restable[mobjtype] if instr[i] == restable[mobjtype][j] alreadykey = 1 break end end if alreadykey == 0 table.insert(restable[mobjtype], instr[i]) table.insert(restable[mobjtype], --[[ZBno]]mobjinfo[mobjtype][instr[i]]) end end restableticker = $1 ^^ 1 end end return sswaptable,restable end local function obskinparse(sswaptable) for k,v in pairs(sswaptable) for l,w in pairs(sswaptable[k]) if l == "spawnstate" continue end --[[ZBno]]mobjinfo[k][l] = w end end end local serverswaptable = {} local serverrestoretable = {} local serverrestoreclear = 0 local skinremoval = {} addHook("NetVars",function(net) serverswaptable = net{$} serverrestoretable = net{$} serverrestoreclear = net{$} skinremoval = net{$} end) local obsk_disable = CV_RegisterVar({ name = "obsk_disable", defaultvalue = 0, flags = CV_NETVAR, possiblevalue = CV_OnOFF }) local obsk_serverpriority = CV_RegisterVar({ name = "obsk_serverpriority", defaultvalue = 0, flags = CV_NETVAR, possiblevalue = CV_OnOFF }) local stateswaptable = {} local skinswaptable = {} local restoretable = {} local function mapobjskin() if mapheaderinfo[gamemap].objectskin or mapheaderinfo[gamemap].objectskin1 stateswaptable,restoretable = swaptablemake(stateswaptable, restoretable, tableconcat("objectskin")) obskinparse(stateswaptable) end if mapheaderinfo[gamemap].spawnskin or mapheaderinfo[gamemap].spawnskin1 skinswaptable = tableconcat("spawnskin") end end local function serverobjskin() local mobjtype = 0 if CV_FindVar("obsk_disable").value == 0 obskinparse(serverswaptable) else for k, v in pairs(serverrestoretable) for i = 1,#serverrestoretable[k],2 --[[ZBno]]mobjinfo[k][serverrestoretable[k][i]] = serverrestoretable[k][i+1] end end end if skinremoval ~= nil and #skinremoval > 1 obskremove(skinremoval) end end addHook("NetVars",function(net) stateswaptable = net($) skinswaptable = net($) restoretable = net($) end) addHook("MapChange",function() for k, v in pairs(restoretable) for i = 1,#restoretable[k],2 --[[ZBno]]mobjinfo[k][restoretable[k][i]] = restoretable[k][i+1] end end --restoretable = {} if serverrestoreclear == 1 for k, v in pairs(serverrestoretable) for i = 1,#serverrestoretable[k],2 --[[ZBno]]mobjinfo[k][serverrestoretable[k][i]] = serverrestoretable[k][i+1] end end serverswaptable = {} serverrestoretable = {} serverrestoreclear = 0 end if CV_FindVar("obsk_serverpriority").value == 1 mapobjskin() serverobjskin() else serverobjskin() mapobjskin() end end) addHook("PlayerJoin",function() if CV_FindVar("obsk_serverpriority").value == 1 obskinparse(stateswaptable) obskinparse(serverswaptable) else obskinparse(serverswaptable) obskinparse(stateswaptable) end if mapheaderinfo[gamemap].spawnskin or mapheaderinfo[gamemap].spawnskin1 for mt in mapthings.iterate do if not mt.mobj continue end for i = 1,#skinswaptable,3 if mt.mobj.type == _G[skinswaptable[i]] if (mt.mobj.flags & MF_NOTHINK) mt.mobj.flags = $1 & ~(MF_NOTHINK|MF_NOBLOCKMAP|MF_SCENERY) P_RemoveMobj(mt.mobj) break end end end end end end) addHook("ThinkFrame",function() if not mapheaderinfo[gamemap].spawnskin or mapheaderinfo[gamemap].spawnskin1 or leveltime != 1 return end for mt in mapthings.iterate do if not mt.mobj continue end for i = 1,#skinswaptable,3 if mt.mobj.type == _G[skinswaptable[i]] if (mt.mobj.flags & MF_NOTHINK) local obskin = P_SpawnMobj(mt.mobj.x,mt.mobj.y,mt.mobj.z,MT_THOK) obskin.tics = -1 mt.mobj.flags = $1 & ~(MF_NOTHINK|MF_NOBLOCKMAP|MF_SCENERY) K_MatchGenericExtraFlags(obskin, mt.mobj) obskin.sprite = _G[skinswaptable[i+1]] obskin.frame = _G[skinswaptable[i+2]] P_RemoveMobj(mt.mobj) break end end end end end) addHook("MobjSpawn",function(mo) if not mapheaderinfo[gamemap].spawnskin or mapheaderinfo[gamemap].spawnskin1 return end for i = 1,#skinswaptable,3 if mo.type == _G[skinswaptable[i]] and mo.valid mo.sprite = _G[skinswaptable[i+1]] mo.frame = _G[skinswaptable[i+2]] break end end end) addHook("MobjSpawn",function(mo) if CV_FindVar("obsk_serverpriority").value == 1 if stateswaptable[mo.type] and (mapheaderinfo[gamemap].objectskin or mapheaderinfo[gamemap].objectskin1) mo.flags = $1 & ~(MF_NOTHINK|MF_SCENERY) mo.state = stateswaptable[mo.type]["spawnstate"] or mo.info.spawnstate end if serverswaptable[mo.type] and CV_FindVar("obsk_disable").value == 1 mo.flags = $1 & ~(MF_NOTHINK|MF_SCENERY) mo.state = serverswaptable[mo.type]["spawnstate"] or mo.info.spawnstate end else if serverswaptable[mo.type] and CV_FindVar("obsk_disable").value == 1 mo.flags = $1 & ~(MF_NOTHINK|MF_SCENERY) mo.state = serverswaptable[mo.type]["spawnstate"] or mo.info.spawnstate end if stateswaptable[mo.type] and (mapheaderinfo[gamemap].objectskin or mapheaderinfo[gamemap].objectskin1) mo.flags = $1 & ~(MF_NOTHINK|MF_SCENERY) mo.state = stateswaptable[mo.type]["spawnstate"] or mo.info.spawnstate end end end) rawset(_G, "objectskin_initialized", true) --[[LUA_BARR v1.0 by Chaobrother. This script is free to be modified, but is not to be included in published releases. Lua Functions: ROADMK: Spawns evenly spaced things along a path. --The linedef tag is the start tag for the the path. Things will start spawning along this path in the direction of the linedef --The linedef's x distance is the distance between spawned objects. --The Front x offset is the termination tag if it is not 0. The path will end and things will stop spawning at this linedef and any connected to it afterward. The path will naturally terminate in the case of a closed loop. --The front y offset it the tag of the lines considered the path if not 0. This will terminate the path if no more connected lines with the correct tag are found. --The back texture is a string for the object type to spawn. --Block Monsters will increment the thing angle by 1 for every thing in the path. --Slope Skew will make the spawned thing's angle perpendicular to the linedef instead. Things spawned by this function will have their info output to BorderThingOut_[gamemap].txt. Export the things lump from your map and paste the output to the end of it using a hex editor. Reimport the modified things lump to your map wad. BRCRT: Snaps objects defined by the back texture to thier floor. This is useful if you are pasting your evenly spaced things from a simpler version of your map. This will create new thing info with corrected heights to BorderHeightThingOut_[gamemap].txt. Replace any instance of your old path objects in your things lump with the new information in the order that is given. ]] function string.tohex(str) return (str:gsub('.', function (c) return string.format('%02X', string.byte(c)) end)) end local function hxdparse(str) str = string.format("%04x",str & 0xffff) local str2 = string.sub(str,3)..string.sub(str,1,2) return str2 end local function intable(a,x) local y = 0 for i = 1, #x if a == x[i] return true end end return false end local function printthing(bt) io.write( hxdparse(FixedInt(bt.x)).. hxdparse(FixedInt(bt.y)).. hxdparse(FixedInt(AngleFixed(bt.angle))).. hxdparse(bt.info.doomednum).. hxdparse((FixedInt(bt.z)-(FixedInt(bt.subsector.sector.floorheight)))<<4), "\n" ) end local function ROADMK(line, mo) local spacing = abs(line.dx) local barrier = _G[sides[line.sidenum[1]].text] local halttag = FixedInt(sides[line.sidenum[0]].textureoffset) local bartag = FixedInt(sides[line.sidenum[0]].rowoffset) local linetable = {} local bt local mt = mapthings local outputfile local m = 0 outputfile = io.open("BorderThingOut_"..G_BuildMapName(gamemap)..".txt","w+") io.output(outputfile) for l in lines.iterate linetable = {} if l.special == 443 or l.tag != line.tag continue end ---find all lines this line is connected to table.insert(linetable, l) m = 0 while (m <= #lines) do if m >= #lines or #linetable >= #lines if #linetable >= #lines print("Something went wrong!") end break end if (bartag > 0) and lines[m].tag != bartag m = $1+1 continue end if ((#lines[m].v2 == #linetable[#linetable].v1 ) or (#lines[m].v1 == #linetable[#linetable].v2 ) ) if not intable(lines[m], linetable) if (lines[m].tag != halttag and (halttag > 0)) or (halttag == 0) table.insert(linetable, lines[m]) --print(m) m = 0 else m = $1+1 end else m = $1+1 end else m = $1+1 end end --draw the things local spacewidth = 0 local startwidth = 0 local barangle = 0 local bardist = 0 local bardir local obardir local btcnt = 0 if #linetable >= 2 if (#linetable[2].v2 == #linetable[1].v1 ) bardir = 2 obardir = 1 else bardir = 1 obardir = 2 end else bardir = 1 obardir = 2 end for i = 1, #linetable barangle = R_PointToAngle2(linetable[i]["v"..tostring(bardir)].x,linetable[i]["v"..tostring(bardir)].y,linetable[i]["v"..tostring(obardir)].x,linetable[i]["v"..tostring(obardir)].y) bardist = R_PointToDist2(linetable[i]["v"..tostring(bardir)].x,linetable[i]["v"..tostring(bardir)].y,linetable[i]["v"..tostring(obardir)].x,linetable[i]["v"..tostring(obardir)].y) m = 0 while (m*spacing+startwidth <= bardist) do --[[if (m*spacing+startwidth > bardist) break end]] bt = P_SpawnMobj(linetable[i]["v"..tostring(bardir)].x+FixedMul(m*spacing+startwidth,cos(barangle)), linetable[i]["v"..tostring(bardir)].y+FixedMul(m*spacing+startwidth,sin(barangle)), P_FloorzAtPos(linetable[i]["v"..tostring(bardir)].x+FixedMul(m*spacing+startwidth,cos(barangle)), linetable[i]["v"..tostring(bardir)].y+FixedMul(m*spacing+startwidth,sin(barangle)), R_PointInSubsector(linetable[i]["v"..tostring(bardir)].x+FixedMul(m*spacing+startwidth,sin(barangle)), linetable[i]["v"..tostring(bardir)].y+FixedMul(m*spacing+startwidth,sin(barangle))).sector.ceilingheight, mobjinfo[barrier].height) ,barrier) if line.flags & (ML_BLOCKMONSTERS) bt.angle = FixedAngle((btcnt % 360)*FRACUNIT) elseif line.flags & (ML_EFFECT1) bt.angle = barangle - ANGLE_90 else bt.angle = 0 end printthing(bt) m = $1+1 btcnt = $1 + 1 end --print(FixedInt(startwidth).." "..#linetable[i].v1) if i == 1 spacewidth = (bardist-startwidth) % spacing startwidth = abs(spacing - spacewidth) else if bt startwidth = spacing - R_PointToDist2(linetable[i]["v"..tostring(obardir)].x,linetable[i]["v"..tostring(obardir)].y,bt.x,bt.y) else startwidth = $1 - bardist end end bt = nil end m=0 end outputfile:flush() outputfile:close() print("Output created in luafiles/BorderThingOut_"..G_BuildMapName(gamemap)..".txt") end addHook("LinedefExecute", ROADMK, "ROADMK") local function BRCRT(line, mo) local barrier = _G[sides[line.sidenum[1]].text] local linetable = {} local bt local outputfile outputfile = io.open("BorderHeightThingOut_"..G_BuildMapName(gamemap)..".txt","w+") io.output(outputfile) for bt in mapthings.iterate if bt.type == mobjinfo[barrier].doomednum --P_GetZAt(pslope_t slope, fixed_t x, fixed_t y) bt.mobj.z = P_FloorzAtPos(bt.mobj.x, bt.mobj.y, bt.mobj.z, bt.mobj.info.height) printthing(bt.mobj) end end outputfile:flush() outputfile:close() print("Output created in luafiles/BorderHeightThingOut_"..G_BuildMapName(gamemap)..".txt") end addHook("LinedefExecute", BRCRT, "BRCRT") "#LUA_ALTM.#*.LUA_OBSKXQÍLUA_BARR