//! loaddata

PurgeandFire

zxcvmkgdfg
Reaction score
509
Can anyone properly explain/show me how to use this? Or a test map would be nice. I'm interested in this function but I could never get it to work. (Yeah, I read the manual)
 

DioD

New Member
Reaction score
57
Loading structs from SLK files

It is possible to load (convert) an slk into code to be added to the map's script, specifically struct assigments. This can be really useful when a system uses structs to store data, since SLK is a table format it can save some work and make things easier to edit without the manual struct assigning.

The preprocessor to load an slk file is //! loaddata "path.slk" . The file path argument follows exactly the same rules as the ones I already specified in import (including lookup folders)

Both the slk and the struct type to be loaded need to follow very specific rules.
The SLK

The SLK file requires to have an struct name at (row 1, column 1) Then the first row contains field names, the next rows contain a [key] and values for the names specified
Code:
up there.stname	this	is	just	an	example
1	2	3	4	5	6
7	8	9	10	11	12

In the example, the name of the struct type to be loaded is stname, the keys of the instances that will be loaded are 1 and 7, and the rest is information about fields and values.

post your own slk file and code, i will fix any errors.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top