Skip to content

Kode for Unity(In game editor) #1597

@TN-1

Description

@TN-1

Thanks to Dunbaratu's tip about the compiler I think I have a basic understand of how it goes but I just want to clarify a few assumptions I have made.
For the most part, I think I can ignore the majority of the function for kOS(run) and so I am left with this bit which obviously does all the work:

string filePath = string.Format("{0}/{1}", shared.VolumeMgr.GetVolumeRawIdentifier(targetVolume), fileName);
var options = new CompilerOptions { LoadProgramsInSameAddressSpace = true, FuncManager =   shared.FunctionManager };
List<CodePart> parts = shared.ScriptHandler.Compile(filePath, 1, file.ReadAll().String, "program", options);
var builder = new ProgramBuilder();
builder.AddRange(parts);
List<Opcode> program = builder.BuildProgram();
shared.ProcessorMgr.RunProgramOn(program, targetVolume);  

For my purposes, I won't need line 1(I will have the filepath already worked out and can just use that)
Assumption 1: shared.ProcessorMgr.RunProgramOn(), Thats the command that runs the just compiled script on the VM? If so, I can get rid of it.
Assumption 2: Script.ksm is a file with extension .ksm that is filled with the contents of List program. If so, After that line I would then have a File.Save(file.ksm, program.ToString(Id need to parse it myself most likely)
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething new (not a bug fix) is being requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions