Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Rinart73

  1. Avorion: 0.26 During "xsotantransformed.lua" sector generation it picks random generator script, executes it and then destroys everything so it looks like it was an actual sector before. The problem is this part of the code (line 176-178): for _, script in pairs(sector:getScripts()) do sector:removeScript(script) end It removes ALL scripts, even the ones that shouldn't be removed like relationchanges, spawnpersecutors, boardingutility, warzonecheck and radiochatter+ modded scripts that should be persistent. My suggestion is replacing that code with this one: for _, script in pairs(sector:getScripts()) do sector:removeScript(script) end -- restore basic scripts include("data/scripts/sector/init.lua") This way sector will get back it's persistent scripts.
  2. Avorion: 0.26 "initializationFinished" doesn't trigger for an entity when script is being attached after entity creation. How to reproduce: data/scripts/entity/mymod.lua -- namespace MyMod MyMod = {} function MyMod.initialize() print("MyMod.initialize happened") end function MyMod.initializationFinished() print("MyMod.initializationFinished happened") end Try to attach this script to entity that already exists in a loaded sector: /run Entity():addScriptOnce("data/scripts/entity/mymod.lua") You will get only one message: MyMod.initialize happened If you'll then reload a sector (leave and come back after some time or restart the galaxy), two lines will be printed: MyMod.initialize happened MyMod.initializationFinished happened
  3. Yeah I got it. I'm just trying to prevent AI ships from attacking invincible entities.
  4. No, it stops. The problem is that when it comes to ShipAI commands like these setAggressive(var attackCivilShips, var canFinish) setFly(vec3 location, float arrivalRadius, var collisionException) and others, I can't just easilly reset them via "setIdle - setBackToOriginal", because I don't have a way to get their arguments. I don't know if certain ship was set to attack civil ships or not, which coordinates it's flying to etc.
  5. Avorion: 0.26 1. Pirate ship is attacking me 2. I'm using "ShipAI(pirateShip):registerFriendEntity(myShipId)" 3. As a result, entity targeter is now green and "ShipAI(pirateShip):isEnemy(myShipId)" returns false. But pirate is still attacking me.
  6. Add one more value to the "PlayerStateType" - "UsesUI". Initially I thought that "PlayerStateType.Interact" is set when player interacts with entities or opens UI windows. But apparently it's set only when player interacts with entities via dialogs. "PlayerStateType.UsesUI" should be set when player opens UI windows: Player window, Ship window, custom windows added via "ScriptUI():registedWindow". Reason: You show player resources when player opens any window. My mod needs to react to that, otherwise UI overlaps :/
  7. Since 0.25 you have to use createDirectory("moddata/YourModName") It's a shame modders weren't informed about this :/
  8. Basically, yes. Current workarounds work almost fine (although onPlayerEntered makes it delayed), so it's a low-priority request. Thank you. invokeFunction is much more important, since it would allow instant way of data transfer.
  9. Keep in mind that this mod will not be 100% clientside anymore. data/scripts/player/init.lua if onServer() then Player():addScriptOnce("data/scripts/player/ui/mymodname.lua") end data/scripts/player/ui/mymodname.lua -- namespace MyModName MyModName = {} if onClient() then function MyModName.initialize() if not GameSettings().infiniteResources then Player():registerCallback("onPreRenderHud", "onPreRenderHud") end end function MyModName.onPreRenderHud() local player = Player() if player.infiniteResources then return end local resources = {player:getResources()} local y = 10 local material, rect for i = 1, #resources do material = Material(i-1) y = y + 18 rect = Rect(5, y, 295, y + 16) drawTextRect(material.name, rect, -1, -1, material.color, 15, 0, 0, 2) drawTextRect(createMonetaryString(resources[i]), rect, 1, -1, material.color, 15, 0, 0, 2) end y = y + 18 rect = Rect(5, y, 295, y + 16) local color = ColorRGB(1, 1, 1) drawTextRect("Credits"%_t, rect, -1, -1, color, 15, 0, 0, 2) drawTextRect(createMonetaryString(player.money), rect, 1, -1, color, 15, 0, 0, 2) end end
  10. Some more API requests :) 1. Please add "initializationFinished" for Sector objects. Reasons: Modders need to know when sector was completely generated. Current workaround is a mix of onRestoredFromDisk + onPlayerEntered, which is not bad, but not instant the first time sector is being generated. 2. Also it would be very good to know when Player is in building mode (at least on client side). Reasons: Modders could stop drawing custom UI elements that are not needed in building mode (or start drawing useful bulding UI). For example both my Resource Display and Buffs mods are currently messing up building UI because they're overlaping it. 3. It would be great to have serverside player or alliance callbacks when player joins or leaves alliance. Reasons: Currently we have clientside callback. Which means modders have to rely on player (which is bad) 4. Please add some sort of "invokeFunction" Entity-like method, and also "secure" and "restore" functions for "main.lua". Reasons: Avorion really lacks centralized serverside mod controller, that would store data and would be accessible from any script. Adding functions that were mentioned above to the "main.lua" would turn this script into that mod controller. And mods would be able to communicate with each other efficiently! Examples: My Galaxy Map QoL mod that is quite popular needs mod controller in order to store, save and give alliance map markers. Currently I have to rely on horrible workarounds, like bouncing the data between online members and the slightest desync can result in losing data. Having something like: would make everything much better. My Server Guard mod (will be used on reborn Rusty's Galaxy server) currently has to fetch server variable in "update" function every X seconds via "getValue" in order to transfer data from sector script to the "main.lua".
  11. cepheni, I already play with everything closed. I have 4GB RAM and this was enough for 0.19.1 - 0.23
  12. Avorion: 0.25 - 0.26 Windows 10 x64, Ndivia 930MX Some gates have misaligned borders (entity targeters). It's like game thinks that center is in another place.
  13. Avorion: 0.25.2 - 0.26 Windows 10 x64, Nvidia 930mx I had no mods activated. During galaxy load game sometimes crashes. It happens both with new and old galaxies. Client log: https://pastebin.com/cNuwNezJ Server log: https://pastebin.com/CgGYxT45 And here is a client-side crash while playing: Client log: https://pastebin.com/ktk45dYg Server log: https://pastebin.com/KTxu3CEp
  14. Avorion: 0.25.2 When finding enemy faction script checks the same coordinates 3 times in a row ignoring "coords" pair from "locations" table: File: data\scripts\player\headhunter.lua - Line 71: local f = Galaxy():getNearestFaction(x, y) should be replaced with local f = Galaxy():getNearestFaction(coords.x, coords.y) UPD: Even though in 0.26 that file was completely changed, it has the same bug on lines 120 and 134.
  15. Avorion: 0.25.2 Windows 10 x64 I have a script "data/scripts/player/gatefounder.lua" that is attached to a Player object. When I look at the Player object in a dev-mode debug window, I see that for some reason it has following path: "data\scripts\player\gatefounder.lua". Some scripts have forward slashes in their path and some - backwards. I'm trying to execute following code on sever side: print(player:hasScript("data/scripts/player/gatefounder.lua")) -- returns 1, so script is attached local status, success = player:invokeFunction("data/scripts/player/gatefounder.lua", "found", tx, ty, "confirm") So I should get 0 as my 'status' (according to the Docs) and function return value as my `success`. But 'status' is 3, which means that "the given script was not found in the entity". But it is attached to the object. Then I try to use: local status, success = player:invokeFunction("data\\scripts\\player\\gatefounder.lua", "found", tx, ty, "confirm") And everything works just fine. Please either fix "invokeFunction" or make sure that Avorion transforms all paths to have forward slashes. Because currently I have to invoke function 2 times each time.
  16. Rinart73

    [MOD] TrashMan

    Sarok, Use workshop mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1788913474
  17. Avorion: 0.23.3 (and maybe earlier) If you remove and add a script back again without any delay, it's clientside counterpart will not be re-added. Is it a bug, unexpected behaviour or intentional mechanics of the game engine? Attached mod example: [*]Type "/refreshui" to add a script to an entity [*]Type something in a textbox [*]Type "/refreshui" to remove and add the script back [*]Textbox will not be cleared [*]Repeat, sometimes it happens from a second time RefreshUITest.zip
  18. Avorion: 0.18 (and maybe earlier) - 0.23.3 The closer you look at the jump animation or transport beams, the more FPS drops. I remember that one of the devs said this is probably something related to transparency and layer ovelaying (or something like that)
  19. This message refers to the factories only. Currently consumer stations (Research Station, Shipyard e.t.c): [*]Buy goods from traders [*]You don't pay money for these goods [*]Bought goods automatically decay over time This is completely another thing and it currently screw ingame balance. You can use my mod in order to: [*]Have the ability to turn trading off for consumer stations [*]Make players pay for these goods [*]Disable goods decay
  20. Avorion: 0.22 - 0.23.3, but I believe this is an old bug. Example: [*]Get a xanion turret [*]Place a xanion block [*]Place turret on that block [*]Replace the block with a lower material block [*]Turret still here and it works just fine So one of 2 things needs to happen in this case: Disallow replacing blocks with a lower material if they have a turret Remove a turret from block
  21. Version: 0.23.3 threatenState should be a table that will contain threaten state for each player. Otherwise if 2 players will try to rob the civil ship at the same time, a dialog for a first player will reset and won't accept their choices.
  22. I still have FPS drops, though they're not as big as before. I messaged screenshots and profiles in the Discord, koonschi.
  23. Version: 0.18 (and earlier) to 0.23.3 Each adventurer entity remembers players that got the upgrade independently. So in multiplayer each adventurer can give a Radar system upgrade. I know it's a minor bug, but still :) I guess you could set Player variable 'got_adventurer_upgrade' to 'true' and use it to check whether player already got the upgrade.
  24. 0 mods activated: Menu client profile: https://drive.google.com/open?id=1ygQOuhoCmz8g_I6NSw1naIW_a7EpPBLR Ingame client profile: https://drive.google.com/open?id=10-zxQM-8zPTaxFaM7KJYy_kE6GyYnqAC [spoiler=Screenshots] Menu: Ingame (sector had 2 NPC ships, 2 stations and few asteroids): 10 mods activated (all of them were "Example" mods made by the devs): Menu client profile: https://drive.google.com/open?id=1vYJfK9_nZaUojviIUdMRpo0GPgRX47US Ingame client profile: https://drive.google.com/open?id=1PHV9ViIzyj6ebLQeqS4IJ4yaxzmJImBv [spoiler=Screenshots] Menu: Ingame:
×
×
  • Create New...