Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Rinart73

  1. Example: We have an enemy faction or entity. We register it as friend:

     

    ShipAI():registerFriendFaction(faction.index)
    ShipAI():registerFriendEntity(other.index)

     

    Then we want to check if this faction/entity was registered as a friend. And.. we can't. We can only check if there are enemies in the sector or try to get nearest enemy.

     

    So, please add a way to check this for both enemy and friend registration.

    local bool = ShipAI():registeredFriendFaction(factionIndex)
    local bool = ShipAI():registeredEnemyFaction(factionIndex)
    local bool = ShipAI():registeredFriendEntity(entityIndex)
    local bool = ShipAI():registeredEnemyEntity(entityIndex)

  2. Energy Suppressor Satellites allow to get Ogonite even when you're outside of the barrier. You can also get Xanion even if you're just started the game on the edge of Galaxy.

     

    When you use them they spawn a mini-station that uses a function that generates a station plan. The thing is that it uses "Faction Home Sector" to calculate plan materials. You know what home coordinates Alliance-faction has? (0, 0).

     

    Each station has 700-2000 (~1200) resource units. And from what I can see, it's usually 3 Xanion : 1 Ogonite. So.. it's ~83 credits per unit which is not that bad.

  3. [*]It would be cool to add toggleable option that shows all Alliance Ships on the map (similar to how you can see your player ships)

    [*]Also it's kinda annoying to open Alliance Ships tab each time to look where certain ship is, then close it and open map. Maybe to add a feature when you double click a ship in Alliance/Player Ships tab, it would open a Galaxy Map and select a sector where that ship is.

  4. Today I noticed that ships count claimed asteroids of enemy faction as any other enemy. Which results in them standing near and attacking it even when I started to fire at them. Eventually I killed them with no resistance from their side, because claimed asteroid was more interesting target than me (or maybe they tried to insult me in such way?  ;D )

     

    So I have 2 suggestions:

    [*]Add priority to targets so ships in AI attack mode will first attack ships, then stations, then claimed asteroids

    [*]Add some chance for Attack AI to change target. For example enemy ship attacks my miner. I warp in and start firing at the enemy. Enemy with a certain chance (or after reaching some damage threshold) will switch targets from defenceless miner to me.

  5. 0.18.2

    How to reproduce:

    1. Install some auto-turrets on your ship (anti-torpedo turrets for example). Change their mode to "Defend" or "Auto"

    2. Buy a captain

    3. Find an enemy ship

    4. Exit the ship

    5. Look at how these turrets fire at the enemy. Even in Idle/Passive mode.

    6. Try to turn Passive Shooting off. Watch as it has no effect.

    ShipAI():setPassiveShooting(false)

    7. Try to mark this entity as your friend. Watch as it has no effect.

    ShipAI():registerFriendEntity(entity.index)

     

    I understand that turrets in defend mode should always protect ships from torpedos. But why are they keep firing on befriended entities? Or when passive fire is clearly off? Please fix.

     

    Update: Apparently turrets in the "Auto" mode don't care either

  6. Decided to add some server-side features as well, since it's all in the same file :) You still can install this mod on client-side only if you want.

     

    1.3.0

    • Added: A way to change max transfer distance for crew, cargo and fighters via config (if mod is installed server-side)
    • Added: If you transfer goods to/from station you should now be docked instead of being really close. You can toggle default behaviour on in config (if mod is installed server-side)
    • Added: Partial Deutsch and French translation
    • Fixed: Minor fixes

  7. I need to rotate one ship so it would face another. I need to do this gradually and fairly (so it would not exceed ship's yaw and pitch).

    I thought that "Velocity():addRotation(vec3 axis, float angle)" or "Velocity():setAngularVelocity(vec3 axis, float angle)" could help me with this.

     

    Currently my code looks like this.

     

    function MyMod.doServer(self, other)
        -- finding where we need to look to look directly at other ship
        local lookOther = normalize(other.translationf - self.translationf)
        -- vector that is perpendicular to the both should be an axis
        local axis = cross(lookOther, self.look)
        -- angle in radians
        local angle = -atan2(length(axis), dot(lookOther, self.look))
        
        Velocity():addRotation(axis, angle)
        broadcastInvokeClientFunction("rotateOnClient", axis, angle)
    end
    
    function MyMod.rotateOnClient(axis, angle)
        Velocity():addRotation(axis, angle)
    end
    

     

    I have no problems with axis, I think. Ship rotates in the correct direction. But it's either rotates too much or not enough.

    Apparently there is something wrong with the "addRotation" function. Because if we'll multiply axis vector by 50 for example ship will spin like crazy. Why? It's an axis, it affects direction of rotation, not the rotation 'power'. We have an angle argument for that.

     

    I really need help with this guys :(

  8. When mining/salvaging AI ship can't find an asteroid/wreckage it does this:

     

    ShipAI(ship.index):setPassive()
    ship:invokeFunction("craftorders.lua", "setAIAction")
    

     

    But CraftOrders.setAIAction calls checkEntityInteractionPermissions function:

    local owner, _, player = checkEntityInteractionPermissions(Entity(), AlliancePrivilege.ManageShips)

    this functions uses callingPlayer and since it's nil in this case, this check will not be passed and icon will not be changed.

     

    Two ways to fix this:

     

    1. To fake 'callingPlayer':

    if ship.playerOwned then
        callingPlayer = ship.factionIndex
    elseif ship.allianceOwned then
        callingPlayer = Alliance(ship.factionIndex).leader
    end
    ship:invokeFunction("craftorders.lua", "setAIAction")
    callingPlayer = nil
    

     

    2. To change checkEntityInteractionPermissions code so if callingPlayer is nil, the result of check is true

  9. 0.18.2 - r12552, Windows 10 x64

     

    I'm in the singleplayer game.

    I add some code to the "data/scripts/server/server.lua" file, at the end of "update" function:

    local players = {Server():getPlayers()}
    print("#players = ", #players)
    local playersOnline = {Server():getOnlinePlayers()}
    print("#playersOnline = ", #playersOnline)

     

    In the first case I get 0, in the second - 1. So I guess something is wrong with the "Server():getPlayers()" function?

  10. I don't personally use this mechanics to get money, but I don't see a problem with turrets that cost more that their components. That's basically how any factory should work. It's not like we're getting money from nothing - we need to find all these components first.

    But if this happens, I think that the difference between final cost and cost of ingredients shouldn't be too high. So if all these Servos and Steel could be sent to a different factories the final profit would be slightly more than making them into a turret and then selling it.

     

    Build time - fine, that sounds okay.

     

    will always be preferable end-game over creating factories as close to the core as possible
    I agree that there should be a balance between Research and Crafting. But it's important to do this gently so it will not kill turret factories near the center.

    Plus then we need to rework Research mechanics - not just "place any - get random", but "place the best stuff to get even better stuff".

     

    Ideally turrets should also be completely detached from the commodities and just use resources and credits
    Why do you think that this is a good idea? Currently I think it's the only thing that prevents current mechanics from being exploited even more. If devs will remove component price you can just forget about commodities completely, get some cash, ai miners and drown in turrets.
  11. 0.18.2 - r12552

     

    Wanted to rely on "onAIStateChanged", but it seems that after some time, it just stops firing it.

    I checked, there are no errors in my scrip:

     

    -- namespace MyTest
    MyTest = {}
    
    function MyTest.initialize()
        Entity():registerCallback("onAIStateChanged", "onAIStateChanged")
    end
    
    function MyTest.onAIStateChanged(entityId, state)
        print("onAIStateChanged", entityId.string, state)
    end
    

  12. 0.1.1

    • Fixed: 'basic' module - Now can remove custom ai scrips that were added by other mods (as longs as they're placed in "mods/ModName/scripts/entity/ai" folder)
    • Fixed: 'basic' module - No more reapplying already executed commands (this caused problems with Mining)
    • Fixed: 'basic' module - Temporal fix to distinguish escort/follow actions
    • Improved: 'basic' module - Now you can use space, ", " or ";" to separate coordinates for "At Coordinates" condition and "Jump To" action

×
×
  • Create New...