Jump to content

Rinart73

Members
  • Posts

    416
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Rinart73

  1. This is another bug that many players faced, including myself. There a ~2-4 threads about this issue already)
  2. Same for the first part. Also it seems that player needs to revisit sector with AI ships after server restart to give orders again, at least for mining/salvaging ships. It would be good to see this fixed.
  3. Thanks for using it :) Devs noticed this mod too and promised to add built-in getCurrentLanguage function in the next patch. As soon as it will be released, I will add it to the mod.
  4. A perfect way to ruin any game.
  5. New version - 0.0.4: Fixed: Clientlog will now calculate correct timestamp to compare with old one Improved: Clientlog performance - regex is fast now Changed: Due to the improvements, default detect mode was changed to "full" (which uses clientlog)
  6. I agree. It would make NPC ships stronger and more diverse. But I disagree with 100% chance drop. It will be too easy to farm. Yes, you can. You can do this without friend. Due to the testing, I created few small ships without modules. Then I destroyed one and got yellow energy module.
  7. Currently upgrade/turret drops with some chance from every destroyed block. I suggest to change this, because this can be easilly exploited by players. Player can build a cheap ship with a bunch of small blocks and just destroy them. Also xsotan are often generated with a bunch of small blocks, which makes farming upgrades from them preferred way instead of NPC faction fights e.t.c. 1. Upgrade drop should be based on ship size (or this new variable that determines how many upgrades you can use) and some chance. As an example, let's say we have an enemy ship which can hold 3 upgrades and drop chance is 20%. As battle goes, if due to the loss of volume ship can have installed only 2 modules, there is a 20% chance that it will drop a module. If ship is destroyed, there is a 20% chance for every slot to 'drop' a module. 2. Turret drop should be limited to the amount of turrets on NPC ship. Again, with some chance, some turrets might be destroyed in battle and not drop. 3. Player/Alliance owned ships can't drop additional modules/turrets (only those which were installed on ship). This will prevent players from exploiting mechanics.
  8. Originally this mod was developed to show devs that we really need built-in 'getGameLanguage()' function. Also I just wanted to know if it's even possible. Thanks to the devs since game version 0.16.5, there is a 'getCurrentLanguage()' function on client-side. Now the main purpose of this mod is to help modders to easily provide localization files for their mods. GitHub Doesn't need to be installed on server. Version 1.1.0 works with Avorion 0.21.x+. Making a few small changes in structure of your mod and adding just one line of code, you can easilly provide localization for your mod! Installation 1. Unpack mod archive in your Avorion folder, not in data folder 2. Open "data/scripts/lib/stringutility.lua" and add following code to the bottom of the file: if not pcall(require, "mods/i18n/scripts/lib/stringutility") then eprint("[ERROR][i18n]: failed to extend stringutility.lua!") end --MOD: i18n Uninstallation It is safe to uninstall, this mod can't corrupt your galaxy. Just remove the line you added during installation and "i18n" folder from "mods". For users There is a config file in "mods/i18n/config" folder that has 'SecondaryLanguages' option. There you can specify your secondary languages, i18n will try to load localization files for them if some mod doesn't have translation files for your main language. Also, first language in this array will be used as language for the server side (if you launched server in console). How to adjust your mod 1. First of all, you need to create a folder for your mod localization files - "Avorion/mods/YourModName/localization". 2. Create localization files: "de.lua" for Deutsch, "ru.lua" for Russian, "zh-hk.lua" for Hong Kong Chinese e.t.c These files should have following structure: return { ["This is how it works"] = "So funktioniert es", ["i18n /* Internationalization */"] = "Internationalisierung" } There is no need to create files for languages that you don't have translation yet. Also, if your native language is not english (you're writing a mod in Russian for example), you can easilly switch places for phrases and create "en.lua": return { ["При наличии необходимых файлов это работает и в обратную сторону"] = "If you have the necessary files, this also works in the opposite direction" } 3. Now, just require "stringutility" and register your mod once in every file that you need to localize: require ("stringutility") -- some code if i18n then i18n.registerMod("YourModName") end 4. Write your mod as usual, any "YourPhrase"%_t will be shown as translated from now on. API Explanation Changelog Credits Thanks to Dirtyredz for coding hints and new mod structure. Download Second file - the mod itself. First file - mod example for modders. i18n-example-1.0.0-0.16.5.zip i18n-1.1.0-0.21.4.zip
  9. That's because most of this checks use CheckPlayerDocked function from "scripts/lib/player.lua", but "scripts/entity/transfercrewgoods.lua" uses getNearestDistance: 20 for Crew, 2 for Cargo and Fighters. I agree, this should be unified.
  10. Correct me if I'm wrong, but I checked a few times and factory/station/mine price margin doesn't affect spawning traders in any way, though it should. Calculation when traders should spawn and how much they should by happens on Lua-side in "sector/traders.lua" and "lib/tradingutility.lua". And neither of this files has anything to do with station price margin.
  11. Please if you have spare time, check this out and tell me what do you think about it. I'll pull request on github in the near future maybe too. From my point of view, it's as fast as your code, but maybe I missed something. This is mine implementation of ingame formula for your mod. I tested it, it works (there might be a few bugs though). It's not precise as default (rounded a few things) ingame algorithm, but still. oospConfig.consumptionFormulaMultiplier is 1.0 by default Instead of calculating every 5 seconds independently (apply 50% chance, select random good, decrease count 1 to 6), we take: 1) 10 seconds, assuming that 50% means 1 fail and 1 success in 10 seconds. 2) Important moment: default ingame formula doesn't check if station has enough good. And I like it, it's like people on the station needed it, but there is no more processors. And they're like "well ok". So: 1) Divide timeDelta / 10 and round it to the smaller value. This is the number of "steps" (times that our ingame function worked). 2) Spread steps equally amongst all goods. In case we have some leftovers or like 3 steps and 10 goods, I added an algorithm that will randomly choose goods. 3) Take result value for every good, and get a random number between result and result * 6 4) Decrease. function consumption(station, timestamp) ... --CUSTOM: OOSP adjustments if oospConfig.consumptionUseGameFormula then local goodsCount = #boughtGoods local steps = math.floor(timeDelta / 10 / oospConfig.consumptionFormulaMultiplier) local part = math.floor(steps / goodsCount) local extra = steps % goodsCount for i = 1, goodsCount do local good = boughtGoods[i] local amount = part if extra > 0 and math.random() <= extra / (goodsCount - i + 1) then amount = amount + 1 extra = extra - 1 end amount = math.random(amount, amount * 6) debugPrint(4, "(ingame)removing", nil, amount, good.name, "from", station.name, maxStock, percentageToTake, currentStock) local status = station:invokeFunction("scripts/entity/merchants/consumer.lua", "decreaseGoods", good.name, amount) end else --CUSTOM for _,good in pairs(boughtGoods) do local status, currentStock, maxStock = station:invokeFunction("scripts/entity/merchants/consumer.lua", "getStock", good.name) local percentageToTake = (timeDelta / oospConfig.consumptionTime) * (1 + (math.random() * 2 * oospConfig.consumptionTimeVariation) - oospConfig.consumptionTimeVariation) local amount = math.floor(maxStock * percentageToTake) debugPrint(4, "removing", nil, amount, good.name, "from", station.name, maxStock, percentageToTake, currentStock) if amount > 5 then local status = station:invokeFunction("scripts/entity/merchants/consumer.lua", "decreaseGoods", good.name, amount) end end end --CUSTOM: OOSP adjustments
  12. Hi, your mod is great, thanks for your work. Found a bug: Trading Post uses "oospConfig.consumptionTime" for both soldGoods and boughtGoods. So basically config variable "generationTime" doesn't affect anything. Version 0.99_2d Is there any chance for a version, that will use current "TradingManager:useUpBoughtGoods" algorithm? function TradingManager:useUpBoughtGoods(timeStep) if not self.useUpGoodsEnabled then return end self.useTimeCounter = self.useTimeCounter + timeStep if self.useTimeCounter > 5 then self.useTimeCounter = 0 if math.random () < 0.5 then local amount = math.random(1, 6) local good = self.boughtGoods[math.random(1, #self.boughtGoods)] if good ~= nil then self:decreaseGoods(good.name, amount) end end end end So, basically, this uses 1 to 6 of a 1 random good(that station buys) every 5 seconds with 50% chance. Why I think that this algorithm is better that current one? Because current one doesn't really care about how many goods can fit in the station. If "config.consumptionTime = 86400" it will eat all goods from Shipyard or Upgrade station regardless of its size in 1 day. I'm currently in stating sector and I already see that Shipyard has almost 6 times more goods than an Upgrade station and ingame algorithm will use all goods from Upgrade station in 20 hours and from Shipyard in 6 days.
  13. I guess that even stations with properly placed docking ports (that work with NPC traders) don't give true for object:hasComponent(ComponentType.DockingPositions) in scripts/lib/player.lua. Because me and my friends almost always get "You must be closer to the object for this" instead of "You must be docked to the object for this". We need to almost hit the station with our ships to be able to transfer anything. Let's look at the code: function CheckShipDocked(faction, ship, object, errors, generic) ... local error if object:hasComponent(ComponentType.DockingPositions) then if not object:isDocked(ship) then error = errors[object.type] or generic or "You must be docked to the object for this."%_T end else if object:getNearestDistance(ship) > 50 then error = errors[object.type] or generic or "You must be closer to the object for this."%_T end end So, if station has docks, then one error message. If not, another. And we always getting second message. Tried with different stations and mines.
  14. Player sends localized letter text to the server. Server sends a letter with received text to player. But server uses it's own localization for sender and letter header. ... local mailText = [[ Hello, It looks like you have been betrayed by Bottan and his smugglers, too, and I think we might have a common enemy now. I'd like to work with you. Meet me at (${x}:${y}). - A Friend ]]%_t if onServer() then ... else -- if not on server function getUpdateInterval() return 12 end function updateClient() invokeServerFunction("sendMail", mailText) end end function sendMail(text) local player = Player() if player:hasScript("story/smugglerretaliation") then return end local specs = SectorSpecifics() local center = directionalDistance(280) local location = specs:findFreeSector(random(), center.x, center.y, 0, 5, Server().seed) local mail = Mail() mail.sender = "A Friend"%_t mail.header = "The Enemy of my Enemy is my Friend"%_t mail.text = text % location player:addMail(mail) player:addScriptOnce("story/smugglerretaliation", location.x, location.y) terminate() end So basically this should look like this (added or for compatibility): ... local mailSender = "A Friend"%_t local mailHeader = "The Enemy of my Enemy is my Friend"%_t local mailText = [[ Hello, It looks like you have been betrayed by Bottan and his smugglers, too, and I think we might have a common enemy now. I'd like to work with you. Meet me at (${x}:${y}). - A Friend ]]%_t if onServer() then ... else -- if not on server function getUpdateInterval() return 12 end function updateClient() invokeServerFunction("sendMail", mailText, mailSender, mailHeader) end end function sendMail(text, sender, header) local player = Player() if player:hasScript("story/smugglerretaliation") then return end local specs = SectorSpecifics() local center = directionalDistance(280) local location = specs:findFreeSector(random(), center.x, center.y, 0, 5, Server().seed) local mail = Mail() mail.sender = sender or mailSender mail.header = header or mailHeader mail.text = text % location player:addMail(mail) player:addScriptOnce("story/smugglerretaliation", location.x, location.y) terminate() end
  15. data/scripts/lib/utility.lua:322: attempt to concatenate field 'index' (a userdata value) Function printEntityDebugInfo. print ("Index: " .. entity.index) This should be replaced with: print ("Index: " .. entity.index.value)
  16. Few days ago our bug has changed. Now it seems that traders are bugged, not docks. Here is a workaround to a current bug - command "/flushtraders" that just makes all spawned traders to jump out of the sector. Maybe someone will find it useful. Other workaround could be is just make traders jump out of the sector by themselves if they can't find a dock for 2 minutes. FlushTradersCmd.zip
  17. Updated Casino Gambling to work with 0.15.x. If you find any bugs, please contact me. I may completely rewrite this mod in the future. CasinoGambling-0.15.x.zip
  18. I agree, some kind of notepad would be a cool addition.
  19. Hi. Recently tried your mod. Noticed a few things that I'd like to discuss: Firstly, FactionNotifier. This is how it looks for me (look at the screenshot). It is supposed to look like this? I mean, it eats a lot of space without any reason and faction name is way bottom. Also, I have a few suggestions/questions: [*]My friends just want to install modpack and play, they're not very good at settings e.t.c. Usually I'm getting all mods together for our server. Can you add a way to export/import settings? As far as I know devs disabled ability for Lua on client-side to access file system. But you can use something like json/other format string. Just a popup, textbox with settings string. And user can copy/paste it and apply. [*]Can you please add a way to set UI element position in pixels? It's hard to properly drag ResourcesWindow, for example, to match ingame resource view.
  20. Please tell me "how" then. Because maximum that I've achieved is moving tiny asteroid at 3km/s speed while constantly firing at it with current force turrets.
  21. Agree. Maybe current force turrents need to be changed to work like that. They're currently useless anyway.
  22. Starting from game version 0.23 mod is moved to the Steam Workshop. Client-side features work perfectly even if mod is not installed on a server side and vice versa. Versions: 1.4.0 is for 0.21.x+ 1.3.0 is for 0.17.1-0.18.3 1.0.0 is for 0.15.x+ GitHub Playing with friend who likes to destroy NPC stations and bring all their goods to ours, I've noticed really fast that I don't find current Transfer Cargo tab practical enough. All goods are in random (from user point of view) order, you either need to remember their icons or scroll and watch for blinking tooltips e.t.c Of course, many modders and devs improved transfer cargo tab from it's original state so I decided to participate. Client Features Goods are sorted in alphabetical order now (in all supported languages) Each good (and crew 1.2.0+) row has overlay name that is displayed on top of their statistics bar You can search cargo by name Fixed vanilla bug that resets numbers in textboxes if you have the same good in different states (like usual and stolen) Added option that allows to increase the amount of rows in cargo transfer tab in case you have a lot of different cargo in your station/ship (can be set in 'mods/TransferCargoTweaks/config/config.lua') You can transfer 5/10/50 goods/crew simultaneously by holding Ctrl/Shift/Alt while clicking transfer button (1.2.0+) You can mark goods as favorites or trash. Favorites will be sorted to the start of the list, trash in the bottom (1.2.0+) When transfering the crew you now see how much crew workforce your and other ship/station has and needs (1.2.0+) Server Features Crew, cargo and fighters transfer distance can be changed in the config (1.3.0+) You now need to be docked to a station instead of being really close to it to transfer stuff (1.3.0+). You can toggle the default behaviour back on in the config Installation [*]Make a copy of 'data/scripts/entity/transfercrewgoods.lua' [*]Unpack mod archive into Avorion folder [*]Optionally install i18n - Internationalization mod, if you want to use this mod in your language Uninstallation
  23. Since now game is being localized into several languages, we faced new problem: most of non-English languages use some characters that are being encoded with more that 1 char. Currently we have Lua 5.2. Upgrading to Lua 5.3 will give some basic UTF-8 functions implemented on C-level, but it will not be enough for comfortable coding. Of course, you might say, there is a pure-lua libraries that allow you to search and even replace UTF-8 strings. It is true. But when it comes to such simple things as string.lower/upper, real problems start. It's kinda hard and not performance-wise to map all character table upper-lower variants in Lua. I recently tried to make a cargo search mod. And believe me, utf8.find function and my string.upper workaround are really not performance-friendly. So, please, add UTF-8 support on C++ level. You can use free solutions like this one (Github link)
  24. So.. the difference in singleplayer between no wiki when offline and nonexistent ingame wiki? Which will happen only if you're using it. So, who's forcing you to use it? Do you really think that devs are going to write an entire wiki for you? Game community usually does that. And current wiki are made by community. Yes, it's somewhat outdated. But being able to access it from the game its a good idea. Though I'm against integrating browser in game. This thing is slow and eats a lot of memory. Better be just making a HTTP-request and using really simple formatting on retrieved info.
  25. I play in Russian language. Galaxy map search: I'm typing "Верфь" (Shipyard) and no sectors highlighted. I can still search for specific sector names, because they're in English. Inventory filter: typing "наонит лазер" (naonite laser) and there is no turrets hightlighed. I tried to switch to English: I can successfully search for facton names, stations e.t.c on galaxy map and for turret/upgrade rarity/type. Maybe your search/filtering doesn't use utf-8 search/strpos functions, but ascii-ones? Please fix this, because currently this cool feature almost doesn't exists for non-English players.
×
×
  • Create New...