Fixed the music Widget.Hopefully. Fixed the lolui to show normal costs. fixed the armed mex.It now uses its former light laser. Juno is a LOS only weapon now.Juno missiles reveal los in a large area on impact. Raised the capture speed of the commanders. Removed the corpses of the commanders. Commanders now have 4k HP. Raised the cost of the arm decoy fusion a bit. Lowered hp of all scouts and raised their speeds. Added the smooth scroll widget. Added an updated formations widget. Removed all the special damages of turrets vs the commander. Removed the special damages of gunships vs commanders. Radar ranges decreased across the board. Subs now shoot 360 degrees. T3 amphibious bots now shoot torpedoes under water. The amphibious lab has been completely removed.All the units are spread across other labs anyway. T2 sea cons can now build the hover lab. Removed all nano turrets and added the assistance restriction gadget. All labs are now restricted to a maximum number of assisting cons based on the lab costs.
You should add the Command Insert and Z selector widgets. They are both the kind of widgets that are barely noticed because they become an extension of the interface.
Code:
function widget:GetInfo() return { name = "CommandInsert", desc = "When pressing spacebar and shift, you can insert commands to arbitrary places in queue. When pressing spacebar alone, commands are inserted on front of queue. Based on FrontInsert by jK", author = "dizekat", date = "Jan,2008", license = "GNU GPL, v2 or later", layer = 5, enabled = true } end
--[[ -- use this for debugging: function table.val_to_str ( v ) if "string" == type( v ) then v = string.gsub( v, "\n", "\\n" ) if string.match( string.gsub(v,"[^'\"]",""), '^"+$' ) then return "'" .. v .. "'" end return '"' .. string.gsub(v,'"', '\\"' ) .. '"' else return "table" == type( v ) and table.tostring( v ) or tostring( v ) end end
function table.key_to_str ( k ) if "string" == type( k ) and string.match( k, "^[_%a][_%a%d]*$" ) then return k else return "[" .. table.val_to_str( k ) .. "]" end end
function table.tostring( tbl ) local result, done = {}, {} for k, v in ipairs( tbl ) do table.insert( result, table.val_to_str( v ) ) done[ k ] = true end for k, v in pairs( tbl ) do if not done[ k ] then table.insert( result, table.key_to_str( k ) .. "=" .. table.val_to_str( v ) ) end end return "{" .. table.concat( result, "," ) .. "}" end --]]
local function GetUnitOrFeaturePosition(id) if id<=Game.maxUnits then return Spring.GetUnitPosition(id) else return Spring.GetFeaturePosition(id-Game.maxUnits) end end
local function GetCommandPos(command) --- get the command position if command.id<0 or command.id==CMD.MOVE or command.id==CMD.REPAIR or command.id==CMD.RECLAIM or command.id==CMD.RESURRECT or command.id==CMD.DGUN or command.id==CMD.GUARD or command.id==CMD.FIGHT or command.id==CMD.ATTACK then if table.getn(command.params)>=3 then return command.params[1], command.params[2], command.params[3] elseif table.getn(command.params)>=1 then return GetUnitOrFeaturePosition(command.params[1]) end end return -10,-10,-10 end
function widget:CommandNotify(id, params, options) local alt,_,meta,_ = Spring.GetModKeyState() if (meta) then local opt = 0 local insertfront=false if options.alt then opt = opt + CMD.OPT_ALT end if options.ctrl then opt = opt + CMD.OPT_CTRL end if options.right then opt = opt + CMD.OPT_RIGHT end if options.shift then opt = opt + CMD.OPT_SHIFT else Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"}) return true end
-- Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"}) local my_command={["id"]=id,["params"]=params,["options"]=options} local cx,cy,cz=GetCommandPos(my_command) if cx < -1 then return false end
local units=Spring.GetSelectedUnits() for i, unit_id in ipairs(units) do local commands=Spring.GetCommandQueue(unit_id) local px,py,pz=Spring.GetUnitPosition(unit_id) local min_dlen=1000000 local insert_tag=0 local insert_pos=0 for i, command in ipairs(commands) do --Spring.Echo("cmd:"..table.tostring(command)) local px2,py2,pz2=GetCommandPos(command) if px2>-1 then local dlen=math.sqrt(((px2-cx)^2)+((py2-cy)^2)+((pz2-cz)^2))+math.sqrt(((px-cx)^2)+((py-cy)^2)+((pz-cz)^2)) - math.sqrt((((px2-px)^2)+((py2-py)^2)+((pz2-pz)^2))) --Spring.Echo("dlen "..dlen) if dlen<min_dlen then min_dlen=dlen insert_tag=command.tag insert_pos=i end px,py,pz=px2,py2,pz2 end end -- check for insert at end of queue if its shortest walk. local dlen=math.sqrt(((px-cx)^2)+((py-cy)^2)+((pz-cz)^2)) if dlen<min_dlen then --options.meta=nil --options.shift=true --Spring.GiveOrderToUnit(unit_id,id,params,options) Spring.GiveOrderToUnit(unit_id,id,params,{"shift"}) else Spring.GiveOrderToUnit(unit_id,CMD.INSERT,{insert_pos-1,id,opt,unpack(params)},{"alt"}) end end return true end return false end
Code:
function widget:GetInfo() return { name = "Z Selector", desc = "Hold Z to select the same types of unit only v1.1", author = "TheFatController", date = "25 November 2008", license = "GNU GPL, v2 or later", layer = 0, enabled = true -- loaded by default? } end
local GetMouseState = Spring.GetMouseState local mouseDown = false local zDown = false local selDefs = {}
function mouseRelease() local zSelection = {} local selUnits = Spring.GetSelectedUnitsSorted() for i,v in pairs(selUnits) do if (i ~= "n") and selDefs[i] then for _,k in ipairs(v) do table.insert(zSelection, k) end end end Spring.SelectUnitArray(zSelection) end
function widget:MousePress(x,y,button) if (button == 1) then mouseDown = true end end
function widget:DrawWorld() if mouseDown and (not select(3,GetMouseState())) then mouseDown = false if zDown then mouseRelease() end end end
function widget:KeyPress(key, mods, isRepeat) if (key == 0x07A) and (not isRepeat) then local newSelDefs = Spring.GetSelectedUnitsCounts() if (newSelDefs.n > 0) then selDefs = newSelDefs end zDown = true end return false end
function widget:KeyRelease(key, mods, isRepeat) if (key == 0x07A) then zDown = false end return false end
Miners can now resume building mines. Removed com laser special dmg vs atlases. Fighters gadget has been polished. Music gagdet has been improved. Fixed some errors in the assistance restriction that Allowed core t1 vehicle cons to assists unrestricted. Fixed hover rocket range Fixed hover AA range.
credits go to Lurker,GoogleFrog,KDR(for his original build restriction gadget),CarRepairer and Cake for all their effort and time spent on making this Version release possible.
Reduced fighter build times. Reduced the metal output of mexes a bit. Improved the Assist restriction gadget so it wont give out errors. Added the Command insert and factory auto repeat widgets. Upped The commander's HP and upped the damage it takes from dguns and the commander blast accordingly. Trees will now get sucked in much faster.
Slightly lowered Leveler DMG to air. 5% to lab costs. All land scouts got their hp and speed lowered a bit and dmg dealt raised a bit. Fixed lolui sometimes showing numbers after the decimal point in the tooltip.
For the next SA release,which will arrive sooner than expected due to the new spring release,I have decided to add some new models. I will add the entire core t1 vehicle models and maybe some of the other models made by MR.D and cremuss. From now on the official SA policy will be to update models as they are released instead of waiting for the entire model collection to be remade and only than adding them in.
In general I think TA remakes need to look dirt,rusty and beat down and of course they should be similar to the originals.
Another thing is that from the next version there will be a mod option that will allow players to use their own widgets.
Joined: 13 Oct 2008, 01:57 Location: Internet Crime Squad HQ D:<
Would you consider adding Z-Selector as a default widget? It has become pretty essential for me in regular gameplay and I know there are others who use it a lot too.
Thing is you can do exactly the same thing with the selection key editor.
How? Z selector doesn't select all units of a type when ctrl-Z is pressed. I think it acts as double clicking on a unit if Z is held when units are selected.
Yeah.I know. I made a shortcut key in the selection key editor. When i select a single unit and press the shortcut,all units of the same type seen on screen are selected. It's like a double click but is easier for when your units are moving all the time.
Using 3rd party widgets or not is now a mod option. Widgets and gadgets updated. Music volume control updated and improved(thx lurker). Added MR.D core models. The Core and Arm shield colors were changed. T1 mexes M output was reduced by 1/11. Air cons build power slightly increased. T1 Bombers drop bombs a bit closer one to the other. Added a close range weapon to sea scouts. Annihilator and DD were changed to be a much heavier,2.5T defenses. the commander clocking ability was changed to only cost 500 E. Sea cons,hover cons,and amphib cons were given a small sonar range. Light T2 pop ups were added back in. T1 con ships can now build shore llts to balance the ability of land cons to build sea defenses. T1 con ships can no longer build the offshore torpedo launchers. T1 storage capacity lowered. Amphibious cons were moved to the Sea lab.
Joined: 13 Oct 2008, 01:57 Location: Internet Crime Squad HQ D:<
Gota wrote:
Yeah.I know. I made a shortcut key in the selection key editor. When i select a single unit and press the shortcut,all units of the same type seen on screen are selected. It's like a double click but is easier for when your units are moving all the time.
It's not the same - with this z is held and you can make box with mouse instead of having to zoom so that the units you want are on screen. It is far more accurate than the modded ctrl-z you mentioned (which I also use). It is particularly good for fast moving stuff and nanos. I would recommend trying it to see why people like it. Anyway did you PM Forb about new release?
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum