Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Sathaerz last won the day on December 6 2020

Sathaerz had the most liked content!

Community Reputation

6 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Sorry, I know I'm tossing in a lot of these but it would be awesome if we could have a way to bypass or remove the pauseTime in the event scheduler on a per-event basis. I added some events that have a % chance to simply terminate immediately and it causes a massive lack of events to happen due to incrementing the pauseTime. I implemented my own event scheduler, but I don't want to have to maintain it every time you guys end up changing the event scheduler as well. Ended up figuring out a better way to do this than completely reimplementing the event scheduler. Would still be a nice feature, though!
  2. Oh yeah, it would be nice if we could get a way to flag a ship as not counting for a warzone (other than setting is_pirate / is_xsotan / is_persecutor) without having to mess with the warzone script ourselves. I'm not too stressed about this one, though.
  3. --Custom AI script. package.path = package.path .. ";data/scripts/lib/?.lua" include ("stringutility") include ("randomext") local targetEntity local minDist = -1 --namespace PursuitAIScript PursuitAIScript = {} if onServer() then function PursuitAIScript.getUpdateInterval() --Per Koonschi, this needs to be run every single frame. return 0 end function PursuitAIScript.initialize(...) --Immediately set the AI idle. PursuitAIScript will tell it how to behave instead of the default ship AI. local ship = Entity() local ai = ShipAI() local ctlUnit = ControlUnit() --print("PursuitAIScript AI successfully attached to " .. ship.name) ai:stop() ai:setIdle() for _, t in pairs({ship:getTurrets()}) do local xt = Turret(t) xt.group = 8 local xw = Weapons(t) if xw.damageType ~= DamageType.Fragments and (xw.reach < minDist or minDist == -1) then minDist = xw.reach end end if minDist <= ship:getBoundingSphere().radius then --Make sure it is at least the bounding radius minDist = ship:getBoundingSphere().radius else --Make it a bit smaller than the minimum range to make sure we're always inside of it. minDist = math.max(ship:getBoundingSphere().radius, minDist - 200) end --print("minimum range is " .. minDist) end function PursuitAIScript.updateServer(timeStep) local ship = Entity() local ai = ShipAI() local ctlUnit = ControlUnit() local eng = Engine() for _, t in pairs({ship:getTurrets()}) do local xt = Turret(t) print("xt group is " .. tostring(xt.group)) end if not targetEntity then local ships = {Sector():getEntitiesByType(EntityType.Ship)} local possibleTargets = {} for _,p in pairs(ships) do if ai:isEnemy(p) then table.insert(possibleTargets, p) end end --print("PursuitAIScript AI picked " .. targetEntity.name .. " as a pursuit target.") targetEntity = possibleTargets[math.random(1, #possibleTargets)] end if targetEntity and valid(targetEntity) then --Set the aimed position of all the weapons in group 1. ctlUnit:setAimedPosition(targetEntity.translationf, 0) ctlUnit:setControlActions(ControlActionBit.Fire1, 0) ctlUnit:setKeyDownMask(ControlActionBit.Fire1, 0) --Use the AI to fly. local distanceToTarget = distance(targetEntity.translationf, ship.translationf) if distanceToTarget > minDist then --print("Distance to target is ... " .. distanceToTarget .. " desired is " .. minDist) ctlUnit:flyToLocation(targetEntity.translationf, eng.maxVelocity) --ai:setFlyLinear(targetEntity.translationf, minDist * 2, false) end else --print("PursuitAIScript AI lost track of its current target, and will pick a new one on its next update.") targetEntity = nil end end end So a while back, I was working on this custom AI script. The issue that I ran into was that it would only shoot at the exact position of the target ship, which would obviously only work for hitscan weapons like lightning guns, railguns, etc. I had the idea to reassign weapons into different groups and control the position that the weapons were aiming based on that. However, when the first section of the script executes (that ostensibly sets all turret groups to group 8 ) there are no errors BUT executing the code immediately afterwards shows that the AI has reassigned all of the turrets to group 1 (or group 2 - I can't remember) which makes it impossible to group up turrets by a metric like projectile velocity. It would be awesome if there was a way to hard stop the AI from attempting to reassign turret groups, especially while idle. Be careful attaching this to a ship btw - it will spam messages like no tomorrow.
  4. EDIT: Original post was so that we could make it so the "accept" button can be disabled in a mission bulletin. That would still be nice but I realized you can achieve something very similar with checkAccept.
  5. Let us add an explicit resistance to hulls. This is already possible by adding a negative weakness. Also it would be neat if we could edit shield colors independently of resistances, but that's not that big of a deal.
  6. This is pretty easily solvable via script. All the devs would have to do is something like this: local hpFactor = 10 --Or another appropriate number. if math.random() < 0.5 then traderShip = ShipGenerator.createTradingShip(traderFaction, MatrixLookUpPosition(-dir, vec3(0, 1, 0), traderPos)) else traderShip = ShipGenerator.createFreighterShip(traderFaction, MatrixLookUpPosition(-dir, vec3(0, 1, 0), traderPos)) end local traderDurability = Durability(traderShip) if traderDurability then traderDurability.maxDurabilityFactor = (traderDurability.maxDurabilityFactor or 0) + hpFactor end traderShip:addScript("deleteonplayersleft.lua") ShipAI(traderShip.index):setPassiveShooting(true) traderShip:registerCallback("onDestroyed", "onTraderShipDestroyed")
  7. The API for torpedoes could use some work. I have a ship with two torpedo tubes that each have 6 available slots. The following code: local _Player = Player(callingPlayer) local _Craft = _Player.craft local _Launcher = TorpedoLauncher(_Craft.index) local _Shafts = {_Launcher:getShafts()} for _, _Shaft in pairs(_Shafts) do print("K : " .. tostring(_) .. " - V : " .. tostring(_Shaft)) end print("numShafts : " .. tostring(_Launcher.numShafts) .. " - maxShafts : " .. tostring(_Launcher.maxShafts)) returns 10 shafts in _Shafts, and both numShafts and maxShafts returns 10. _Launcher:getFreeSlots(_Shaft) will also return 15 if the shaft is unavailable for use. Trying to dynamically load the launchers based on the number of available slots will KILL the game and corrupt a save to the point where it needs to be restored from a backup.
  8. Please report this. This is a months-old bug that I have repeatedly reported that nothing has been done about. Several other players have brought it up in the discord as well.
  9. I'm not sure if there's already a way to do this in structured mission, but a way to differentiate between client-only triggers and server-only triggers would be awesome. I guess I could always wrap the declarations in onServer / onClient but that feels kind of gross.
  10. Seconding this. I don't think I've ever seen anyone who actually likes the camo texture. Every opinion I have seen ranges from neutral to dislike. I actually end up coloring all of my ships dark grey specifically to hide the camo pattern.
  11. I warned them that the legendary turrets were too weak and they told me to try them first.
  12. Try going in creative mode and hitting "guns guns guns" about 10 times. Guarantee you that you will end up with more PDC / PDL / Anti-Fighter turrets than any other gun type.
  13. Is there an example of how to color dialogs or change the name in the upper left corner somewhere? I can't find any examples in the script or the documentation. EDIT / UPDATE: I actually managed to figure this out through pure guesswork / conjecture based on some of the mission utility functions / names, but I still think it would be a good idea to add a resource for others somewhere in the documentation. EDIT / UPDATE2: I just saw the updated documentation! Looks great!
  14. Thank you! I'll take a note of that.
  • Create New...