Log In  


I made this for use myself, because i couldn't find anything for this specific purpose. Thought I'd post it here in case anyone else gets some use out of it.

It converts a list of variables in the following format to a version optimised for tokens:

-- input
t=0
cam_x=0
cam_y=0
shake=0
floor=1
gold=0
current_music=-1
mode="splash"
title_s=1
lastdist=0
fadepos=0

-- output
t,cam_x,cam_y,shake,floor,gold,current_music,mode,title_s,lastdist,fadepos
=0,0,0,0,1,0,-1,"splash",1,0,0

To use it, paste the original variables into the cart and it will output the "crunched" version out to the clipboard.
Bit of a warning though, this format gets unreadable fast.

It also seems (in most cases) to work if some of the values are already in this format as it simply pairs what's before the equals with what's after, e.g.:

-- input
t=0
cam_x,cam_y=0,0
ey,et=256,0
shake=0

-- output
t,cam_x,cam_y,ey,et,shake
=0,0,0,256,0,0

-- input (don't put crunched variables on the last line)
t=0
cam_x,cam_y=0,0
shake=0
ey,et=256,0

-- output (note the extra commas on the end)
t,cam_x,cam_y,shake,ey,et,
=0,0,0,0,256,0,

On that note, it won't work properly if multiple equals signs are on the same line.

Make sure to press ctrl+c to copy

Here's the cart:

Cart #var_cruncher-0 | 2022-02-23 | Code ▽ | Embed ▽ | No License
2

2



[Please log in to post a comment]