Transport Fever

Transport Fever

Painter (Experimental)
 此主题已被置顶,因此可能具有重要性
GrandT  [开发者] 2018 年 5 月 24 日 上午 3:57
Code Discussion
Use this thread to help me figure out ways to improve performance further. If you have further knowledge of how the API I'll gadly listen!
< >
正在显示第 1 - 6 条,共 6 条留言
cpu | skully 2018 年 5 月 26 日 上午 2:53 
As you can imagine, i also investigated to make this faster. I came up with something that 'almost' works. Just to save you from the misused time:

The IDs of assets are not consistent. Caching the assets by ID seems to work, first, but after a short time, the IDs are reassigned. I will still borrow the idea with the distance from you for my other mods, in case that's ok.
GrandT  [开发者] 2018 年 5 月 26 日 上午 3:02 
Thanks! It's a shame I had to go through the whole "why are the IDs changing". But, thanks for confirming they are not consistent. Sucks.

I've reached out to UG to hopefully allow us to have the last asset placed returned. That will allow us to always search within an area at least.

And you're welcome to incorporate my methods in to your ones too. I did however merge your Farmer textures in to this version. It could certainly prove useful for Forester and Streams!
cpu | skully 2018 年 5 月 27 日 上午 12:15 
I already suggested something similar to them. My idea was to introduce events like "onBuilt", "onDestroyed", "onSelected" and "onDeselected". I got an answer for that from UG, but it was nothing more like a "ok, we noticed that".
In fact I believe that our kind of mods are regarded as "hacky" and they're afraid of what's coming next when they extend the API.

Btw, in case you need help with the painter (e.g. translation), ask me. I think a parameter named 'plant' is a little bit funny for concrete fields :D
最后由 cpu | skully 编辑于; 2018 年 5 月 27 日 上午 12:16
cpu | skully 2018 年 12 月 14 日 上午 8:47 
With the next Patch they're going to introduce a function named game.gui.getTerrainPosition which returns the terrain mouse position. I've successfully tested this for a new aproach, which makes all lags in our mods disappear. In case you're OK with it, I'll publish something like my farmer, but also with concrete and cobblestones, including walls and other options.
GrandT  [开发者] 2018 年 12 月 14 日 上午 11:10 
Oh nice! Sounds good to me. :)
GrandT  [开发者] 2019 年 7 月 2 日 上午 4:25 
I've spent the day converting painter to use the new code you've created. I've renamed the script files as to not cause any issues with your mods should I decide to change them later. Hopefully this new Painter doesn't interfere with your mods.

Let me know if you have any objections with the code and/or if you notice any issues, I'll get them fixed ASAP! :)
< >
正在显示第 1 - 6 条,共 6 条留言
每页显示数: 1530 50