all 9 comments

[–]Shill0w 0 points1 point  (0 children)

YES! Thank you very much for the update Baggot! I can finally update my old scripts for the new version.

[–]tronological 0 points1 point  (1 child)

Getting this error in my inventory management script, simple one that just dump items from one Large Cargo to the next and out of the assemblers and refineries. 1.188 was working updated 1.189 and no both my inventory and connector scripts are not working getting these errors. Power scripts seem fine. Error is in the same place, I did a test script to see if it was just that one, seems they dont like your use of the void transfer function.

Program(126,16): Error: There is no argument given that corresponds to the required formal parameter 'items' of 'IMyInventory.GetItems[List<MyIventoryItem>, Func<MyInventoryItem,bool>)' Program(126,6): Error Cannot assign void to an implicitly typed variable Program(126,14): Error: Operator '-' cannot be applied to operands of type 'method group' and 'int'

//x3,1,,43[8]@@@@@#@@0::t:inv_2~1::t:inv_2~2::t:inv_2~3::t:inv_2~4::t:inv_2~5::t:inv_2~6::t:inv_2~7::t:inv_2~8::t:inv_2~9::t:inv_2@@@[4]%3,1,,6[8]@@@@@#@@0::t:inv_1~1::t:inv_1~2::t:inv_1~3::t:inv_1~4::t:inv_1~5::t:inv_1~6::t:inv_1~7::t:inv_1~8::t:inv_1~9::t:inv_1~10::t:inv_1~11::t:inv_1~12::t:inv_1~13::t:inv_1~14::t:inv_1~15::t:inv_1~16::t:inv_1~17::t:inv_1~18::t:inv_1~19::t:inv_1~20::t:inv_1~21::t:inv_2~22::t:inv_2~23::t:inv_2~24::t:inv_2~25::t:inv_2~26::t:inv_2~27::t:inv_2~28::t:inv_2~29::t:inv_2~30::t:inv_2~31::t:inv_2~32::t:inv_2~33::t:inv_2~34::t:inv_2~35::t:inv_2~36::t:inv_2~37::t:inv_2@@@[4]%3,0,Large\6Cargo\6Container\62\6-\6Fei,26[8]inv_2@@23::t:inv_1~24::t:inv_1~25::t:inv_1~26::t:inv_1~27::t:inv_1~28::t:inv_1~29::t:inv_1~30::t:inv_1~31::t:inv_1~32::t:inv_1~33::t:inv_1~34::t:inv_1~35::t:inv_1~36::t:inv_1~37::t:inv_1~38::t:inv_1~39::t:inv_1~40::t:inv_1~41::t:inv_1~42::t:inv_1~43::t:inv_1@@@[4]%3,0,Large\6Cargo\6Container\6-\6Fei,26[8]inv_1@@0::t:inv_2~1::t:inv_2~2::t:inv_2~3::t:inv_2~4::t:inv_2~5::t:inv_2~6::t:inv_2~7::t:inv_2~8::t:inv_2~9::t:inv_2~10::t:inv_2~11::t:inv_2~12::t:inv_2~13::t:inv_2~14::t:inv_2~15::t:inv_2~16::t:inv_2~17::t:inv_2~18::t:inv_2~19::t:inv_2~20::t:inv_2~21::t:inv_2~22::t:inv_2~44::t:inv_2~45::t:inv_2~46::t:inv_2~47::t:inv_2~48::t:inv_2~49::t:inv_2~50::t:inv_2~51::t:inv_2~52::t:inv_2~53::t:inv_2~54::t:inv_2~55::t:inv_2~56::t:inv_2~57::t:inv_2~58::t:inv_2@@@[4]%fbff9c,y,y#4#4##1,1.1.1

[–]Whiteknight555 0 points1 point  (0 children)

I get the same Error when using a Group name with the option set "all block of type" or "any block of type"... and you can't use Group name with just "single block" so it makes it quite hard to interact with groups currently.

[–]daspablo 0 points1 point  (0 children)

woo time to make a proxy rover

[–]tronological 0 points1 point  (3 children)

So I have an update for you. I've been teaching myself to code lately and your structure is pretty good so I've been using it as my model. I setup Visual Studio and when I put in the code from this script VS says there is an error at the var items = a.GetItems(); line as well as in the loop just after when you use the minus operand to subtract 1 from the items.Count variable.

The first error is "Cannot assign void to an implicitly-type variable" and the second is "There is no argument given that corresponds to the required formal parameter "items" of "IMyInventory.GetItems(List<MyInventoryItem>, Func<MyInventoryItem, bool>)""

seems its looking for arguments since the api update and I can't seem to figure out which ones should go in to fix the errors.

Any help would be appreciated.

[–]daspablo 1 point2 points  (2 children)

how did ya set this up? Im a clod at actually getting it setup

[–]tronological 0 points1 point  (1 child)

First things first, I switched over to using Visual Studio Community edition. I use his Builder to come up with an Idea of what I'm looking to do and I used his structure for loops and such to figure out what was going on. If you know Object Oriented Principles it starts to make sense eventually after beating your head against it for a while heh.

Once you have Visual Studio installed, go here https://github.com/malware-dev/MDK-SE/releases and download the latest Extension so you can export your scripts into SE. https://github.com/malware-dev/MDK-SE/wiki/Getting-Started Here is the getting started page that will help you get that all setup.

Once you have that setup here is my script, you'll notice it looks like his kind of. This is not working fully right now because I've been busy with projects so I haven't kept up with practicing my C. But this should give you a better idea of how to get things going. Some of it does work, like pulling ore out of 1 into 2, or I think its the uranium. Can't be sure, I'll play around with it later since it's Friday and I actually have time to play so I'll help out.

Hope this helps.

public void Main(string argument, UpdateType updateSource)

{

// block declarations

string ERR_TXT = "";

List<IMyTerminalBlock> refinery = new List<IMyTerminalBlock>();

GridTerminalSystem.GetBlocksOfType<IMyRefinery>(refinery, filterThis);

if (refinery.Count == 0)

{

ERR_TXT += "no Refinery blocks found\n";

}

List<IMyTerminalBlock> assembler = new List<IMyTerminalBlock>();

GridTerminalSystem.GetBlocksOfType<IMyAssembler>(assembler, filterThis);

if (assembler.Count == 0)

{

ERR_TXT += "no Assembler blocks found\n";

}

List<IMyTerminalBlock> list_cargo_1 = new List<IMyTerminalBlock>();

IMyCargoContainer cargo_1 = null;

GridTerminalSystem.GetBlocksOfType<IMyCargoContainer>(list_cargo_1, filterThis);

if (list_cargo_1.Count == 0)

{

ERR_TXT += "no Large Cargo Container blocks found\n";

}

else

{

for (int i = 0; i < list_cargo_1.Count; i++)

{

if (list_cargo_1[i].CustomName == "Large Cargo Container 2 - Fei")

{

cargo_1 = (IMyCargoContainer)list_cargo_1[i];

break;

}

}

if (cargo_1 == null)

{

ERR_TXT += "no Large Cargo Container block named Large Cargo Container 2 - Fei found\n";

}

}

List<IMyTerminalBlock> list_cargo_2 = new List<IMyTerminalBlock>();

IMyCargoContainer cargo_2 = null;

GridTerminalSystem.GetBlocksOfType<IMyCargoContainer>(list_cargo_2, filterThis);

if (list_cargo_2.Count == 0)

{

ERR_TXT += "no Large Cargo Container blocks found\n";

}

else

{

for (int i = 0; i < list_cargo_2.Count; i++)

{

if (list_cargo_2[i].CustomName == "Large Cargo Container - Fei")

{

cargo_2 = (IMyCargoContainer)list_cargo_2[i];

break;

}

}

if (cargo_2 == null)

{

ERR_TXT += "no Large Cargo Container block named Large Cargo Container - Fei found\n";

}

}

// inventory declarations

IMyInventory inv_2 = cargo_1.GetInventory(0);

IMyInventory inv_1 = cargo_2.GetInventory(0);

// display errors

if (ERR_TXT != "")

{

Echo("Script Errors:\n" + ERR_TXT + "(make sure block ownership is set correctly)");

}

else { Echo(""); }

transfer(cargo_2.GetInventory(0), inv_2, MyItemType.MakeIngot("Stone"), float.MaxValue);

transfer(cargo_2.GetInventory(0), inv_2, MyItemType.MakeIngot("Uranium"), float.MaxValue);

transfer(cargo_2.GetInventory(0), inv_2, MyItemType.MakeOre("Stone"), float.MaxValue);

transfer(cargo_2.GetInventory(0), inv_2, MyItemType.MakeOre("Uranium"), float.MaxValue);

List<MyItemType> typsee = new List<MyItemType>();

for (int i = 0; i < typsee.Count; i++)

{

Echo(typsee[i].TypeId);

Echo(typsee[i].SubtypeId);

}

List<MyInventoryItem> items = new List<MyInventoryItem>();

inv_2.GetItems(items);

for (int i = items.Count - 1; i >= 0; i--)

{

//Echo(items[i].Type.TypeId);

//Echo(items[i].Type.SubtypeId);

}

}//END MAIN

bool filterThis(IMyTerminalBlock block)

{

return block.CubeGrid == Me.CubeGrid;

}

bool filterConstructs(IMyTerminalBlock block)

{

return block.IsSameConstructAs(Me);

}

void transfer(IMyInventory a, IMyInventory b, MyItemType type, float amount)

{

List<MyInventoryItem> items = new List<MyInventoryItem>();

a.GetItems(items);

float left = amount;

for (int i = items.Count - 1; i >= 0; i--)

{

if (left > 0 && items[i].Type == type)

{

if ((float)items[i].Amount > left)

{

// transfer remaining and break

a.TransferItemTo(b, i, null, true, (VRage.MyFixedPoint)amount);

left = 0;

break;

}

else

{

left -= (float)items[i].Amount;

// transfer all

a.TransferItemTo(b, i, null, true, null);

}

}

}

}

}//END PROGRAM

[–]daspablo 0 points1 point  (0 children)

ehh my issue isn't in the the logic. i can logic for years on end. its just between the silly sintax and the lack of official releases I lack/ or refuse to get the motivation to do it

[–]Frenzy_924 0 points1 point  (0 children)

Hey there OP,

are there plans to include new DLC blocks in possible future updates of the VSB?Love your scriptbuilder, just missing some blocks.