Space Engineers
Недостаточно оценок
Queue Projector Components Script
   
Наградить
В избранное
В избранном
Удалить
Размер файла
Добавлен
Изменён
63.589 KB
30 янв. 2020 г. в 15:41
30 янв. 2020 г. в 15:43
Обновлений: 2 (просмотреть)

Подпишитесь, чтобы загрузить
Queue Projector Components Script

Описание
This script lets you queue needed components for an active projection.

Usage:
1. Add "{SP}" to the projector block and the main assembler
2. Activate a projection
3. Trigger the run option for the programmable block, either through a different block, or on the Control Panel
4. The needed components are added to the queue

Notes:
- Projector blocks do not report individual armor block types, only a total amount. For now the script ignores these in favour of queueing only for the non-armor blocks
- The script does not look at what your current inventory contains.
Комментариев: 7
TastyTankRound  [создатель] 16 мар. 2020 г. в 8:17 
I unfortunately think that'll be another limitation of the scripting API. The projector block is very limited in what it allows you to do with it via the code, and nested projectors evidently throw a pretty nasty spanner in the works.

I'll have another tinker when I get the chance to see if I can mitigate this somehow, but I can't promise that it'll be any time soon.
Reimu Hakurei x3 15 мар. 2020 г. в 9:33 
"so the main projection shows 3"
Meant to say, so the main projection shows 400.
Reimu Hakurei x3 15 мар. 2020 г. в 9:32 
Ok so the results, this was some intense inception stuff to find this out but I managed to track the problem to the ship's projector. For whatever reason deleting the projector from the BP fixed the problem, I was also able to reproduce the problem with other structures, for some reason when I add mis-matched blueprints to the projector INSIDE the projection it gets that problem. Adding the main ships' blueprint to a different ship causes the issue, but also adding a blueprint of that same ship with a different design(without cube being involved) also causes that issue, seems like some sort of game bug, because another thing is that when you do this, it counts the blocks of the projection within the projection as being part of the design, for example if I want to project a ship that has 100 blocks, but it also has a projector in the design that projects a ship of 300 blocks so the main projection shows 3, then it glitches out and the script doesn't allow it.
Reimu Hakurei x3 15 мар. 2020 г. в 7:37 
Thanks for responding! No mods or anything, fully vanilla, I'm using Adaline's Borg Cube, modified with some ship stuff inside, like vanilla Jump Drives, Medical Bay, ChryoPod thing, Programmable blocks, LCDs, batteries, large cargo containers, refineries, assemblers and speed upgrades. Making that list in case, I'll be troubleshooting to see if I can see what's bugging it.
TastyTankRound  [создатель] 15 мар. 2020 г. в 4:09 
Interesting; I have to hardcode each block's components in the script because there is no programmatical way of getting it. Maybe one of the blocks in your blueprint is a modded block, or maybe it's from a newer DLC that I haven't included yet.

Are you using non-vanilla blocks?
Reimu Hakurei x3 14 мар. 2020 г. в 17:03 
Oh also the blueprint is projected and all, just in case, setting "Keep Projection" is on.
Reimu Hakurei x3 14 мар. 2020 г. в 17:01 
Oh fudge, so this was working this morning but now I can't get it to work, it get some sort of error. I'm hoping this will help you help me! To reproduce it I simply have a Large Projector named {SP} Projector and an assembler with speed upgrades named {SP} Assembler in survival, attempted in creative too just to check with same results. The Assembler is also empty, just wanted to see what I would need.

"Caught exception during execution of script:The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary'2/get_item[Tkeykey]

at
Program.K[]

at
Program.Main[String
S,
UpdateType
A]

at
Sandbox.Game.Entities.Blocks.MyProgrammableBlock.<>C__DisplayClass46_0.<ExecuteCode>b__0[IMyGridProgramProgram]

at
Sandbox.Game.Entities.Blocks.MyProgrammableBlock.RunSandboxedProgramAction[Action'1
action,
String&
response]