Jump to content

Paulquappe

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. When issuing a "Escort/Repair Target" command, the respective menu is not filled with the possible targets in the target sector, but with those in the sector the selected craft is currently in. Revision: r22541 Steps to reproduce: - Open galaxy map - Select sector (say, sector A) with controllable ships - Select controllable ship - Enchain multiple jump orders with ship (say ->B->C->D) - Enchain "Repair Target" or "Escort Target" - Now the menu displays targets from sector A but not from sector D Cause of failure: MapCommands.fillTargetCombo in scripts/player/map/maproutes.lua only fetches coordinates for the current sector. Partial Fix: To get the coordinates for the target sector, append after the following line local x, y = GalaxyMap():getSelectedCoordinates() this code block (copied from MapCommands.updateTransitArea): if MapCommands.isEnqueueing() then local selected = MapCommands.getSelectedPortraits() if #selected > 0 then local ix, iy = MapCommands.getLastLocationFromInfo(selected[1].info) if ix and iy then x, y = ix, iy end end end However, in OrderChain.addEscortOrder in scripts/entity/orderchain.lua the names are resolved to entity IDs, which would fail here. So there would need to be something like "player:getNamesOfShipsInSector(x,y)" for IDs for this to work. Alternatively, the IDs could be resolved only in the end, when executing the order (CraftOrders.escortEntity) for this to work. Edit: Noticed that my fix only solves half of the problem
  2. Some UI stuff would be kinda nice: [*] Callbacks for when an window is shown/hidden. I need the latter to implement a lock that will be released when the window is closed. [*] SelectionItem with a string instead of an icon/texture [*] Multiple selectable items in Selection or ListBox. Alternatively, labels that can be highlighted would also suffice (so I can implement it myself). I second that. Limiting maximum velocity could create some more "dogfighty" battles.
  3. So I'm currently working on a mod that contains some of these suggestions. Particularly, it'll include - An "Abort after X minutes" checkbox for buying/selling (see screenshot) - A menu for editing command chains (see other screenshot) However, modifying the command chain is actually a bit more complicated, because you need to think about how you could possibly edit a jump order. See, editing a buy/sell order is easy. You can just edit some values (or remove them entirely), because no other command after that directly depends on it, i.e. removing a "Refine" order will not influence a "Sell" order afterwards. But deleting a jump order could possibly mean that your ship cannot execute the jump after that, because it's too far away. I'll show you some possibilities I've thought of to handle this in an example: Original order: A>>>B>>>C>>>D These are jumps through sectors A, B, C, D and in the last sector we want to buy something. Now we want to remove/edit the jump to B 1st Possibility - Just jump from A>>>C: Only possible if C is in range of A. Otherwise, we have a gap. 2nd Possibility - Don't remove the jump to B, just make a jump less. So A>>>B>>>C. Easy to implement, but rarely something you want, unless you wanted to buy the goods in "C" in the first place. 3rd Possibility - Let the player create a new path: The player has to create a new path with the restriction that it should start at A and end at C. E.g. A>>>J>>>K>>>L>>>C>>>D, whereas J,K,L are chosen by the player. That's what I'm currently planning to do. 4th Possibility - Automatic path creation: Like the 3rd one, but automatic. Would be a nice gimmick, but will just create the same path anyway if you have used automatic path creation for the original route. Tell me if you have more ideas about that or the mod in general. The following features I also consider to implement: - Saving and loading command chains - undo/redo (unsure, because tricky on the technical side) - reassign the command chain to another craft - pausing the command chain Because it's less complicated. Maybe I'll modify that too when I'm done with the other stuff.
  4. The command summary on the galaxy map (lower left corner) does not display all commands correctly. It only displays the respective icon, but no text. Revision: r22541 Steps to reproduce: - Open galaxy map - Select sector with controllable ships - Select controllable ship - Order Repair (/ Repair Target/ Escort) Cause of failure: MapRoutes.getOrderDescription in scripts/player/map/maproutes.lua does not handle every OrderType. Fix: Append following code to the if/else-block: This requires the craft name in the order chain (querying it here would result in performance loss, since getOrderDescription is called every frame). I included the name in scripts/entity/orderchain.lua. For example: local order = {action = OrderType.Escort, craftId = craftId.string, craftName = craftName} in OrderChain.addEscortOrder. See the attachment for the full source. maproutes.lua.txt orderchain.lua.txt
  5. Paulquappe

    Explosion API

    No, I don't think so. The weapongenerator.lua seems to generate the weapons as items, whereas I need a one-time explosion at the entity's position,
  6. Paulquappe

    Explosion API

    Hi, I'm implementing explosive mines, though I need custom explosions for that. Is there any kind of API for that? Like, with options for position, size, damage, damage type, shockwaves, etc.. I couldn't find anything like that. I also looked for ways to spawn torpedoes as a workaround, though the only thing I found is this post. Unfortunately, it only adds torpedoes to the ship but does not spawn them (or detonate them). At last I tried to implement explosions manually. Server: local explosiveMine = Entity() local explosionSphere = Sphere(explosiveMine.position.translation, explosionRadius) nearby = {sector:getEntitiesByLocation(explosionSphere)} for i, entity in pairs(nearby) do -- do damage calculation here end Client: Sector():createExplosion(position, radius, false) However, I can only guess how the damage calculation is done (with undocumented API-calls such as "Balancing_GetSectorWeaponDPS") and there is a lack of fancy effects like shockwaves and screenshake. Does anyone know more about that? Thanks in advance.
×
×
  • Create New...