F4llfield Posted April 1, 2023 Share Posted April 1, 2023 (edited) Hi, The creation kit Wiki is saying "Assigning one struct to another struct, or passing a struct to a function, is done just like any other variable." But I can't get it to work. I tried different wording but it I'm always getting the error: no viable alternative at input 'Struct' I tried: Function myFunction(Struct myStruct) ;Do thingsEndFunction I also tried: Function myFunction(Struct[] myStruct) ;Do thingsEndFunction What I'm I missing ? Edited April 1, 2023 by F4ll0uta Link to comment Share on other sites More sharing options...
dylbill Posted April 1, 2023 Share Posted April 1, 2023 First you define your struct, then you can pass that specific struct type to a function: Struct SomeStruct int A = 1 int B = 2EndStruct Function MyFunction(SomeStruct MyStruct) EndFunction Link to comment Share on other sites More sharing options...
F4llfield Posted April 1, 2023 Author Share Posted April 1, 2023 Thanks for the info. I wouldn't have think about this and google was not returning anything valuable. Link to comment Share on other sites More sharing options...
dylbill Posted April 1, 2023 Share Posted April 1, 2023 No problem, happy modding! Link to comment Share on other sites More sharing options...
Recommended Posts