It's not like you can't fix things of course but it will require a decent amount of work, especially in big bases (which I assume yours is if you spent hundreds of hours in that world).Īmong the changes that don't break your base but that will throw you off are the changes on the UI in 0.17, in particular the hotbar/belt because it is no longer inventory slots and you are forced to use filters (something that apparently many people didn't even know if existed prior to that). If X is not yet zero, starting with the newest entities in the creation queue, create X entities, move from the creation queue to the current queueĮssentially, newest turrets in range have priority on drawing ranges, oldest turrets have highest priority for removing ranges.0.18 doesn't change much but 0.17 does change a lot of things for existing bases.īasic oil refining only produces petroleum gas and a decent amount of mid and end game recipes changed (only a bit but for existing bases it still means a pretty heavy rework since it touches science among other things). Starting with the oldest entities in the Destruction queue, remove X (Where X is some fine tuned number) entities, decrementing X Move entities from current queue to destruction queue for these turrets Remove entities from creation queue for these turrets Remove turrets from turret queue that are out of range (Maybe only every 10 ticks or something, probably not required 'every' tick) Add entities to creation queue for these turrets I've not had time to look at the code, but with a few assumptions:Įntity creation queue - contains all entities that need to be addedĬurrent entity queue - contains all entities already addedĮntity destruction queue - contains all entities that need to be destroyedĪctive turrets queue - all the turrets that 'should' be showing a rangeĪdd turrets to turret queue that are now in range (Maybe only every 10 ticks or something, probably not required 'every' tick) You'll have to play around to decide, but either one turret per tick, or x entities per tick. If you are concerned with the performance impact, best to limit the number of entities changed per tick. For Science, here is the a that I've been playing with that can be dropped into the v1.1.1 turrets-range mod.Ĭurrently, the mod renders all turret ranges: within 5 units of every player, or if a player has selected (mouse hover) a turret. Just a few more features, but if that doesn't come to pass. I intend to properly release a mod in the relatively near future. Not sure if prototype.turret_range is auto set to 0 through a metatable _index, if so then prototype.turret_range > 0 is sufficient (otherwise attempt to compare number with nil) Turret range should be a debug tool anyway. That way, other mods like Bobs mod (sniper turret) will be supported, because I think checking turret_range should be sufficient. If entity.type = "electric-turret" thenĭraw_turret_range(turret_type,, , _range)įor i = 1, #global.turret_range_entities do If #entity > 0 and _range and _range > 0 then if entity.type = "electric-turret" or entity.type = "ammo-turret" or entity.type = "turret" then Code: Select all entity = game.get_surface(1).find_entities
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |