#struct for each shuffling variables!

1 messages · Page 1 of 1 (latest)

deft shard
#

im trying to make a bullet editing tool thingy and im trying to copy the struct below to a clipboard so i can copy and paste it but it's jumbling up the order of the variables, is there anything i can do about this

also the ssecond picture is the function

amber whale
#

Structs are unordered, there's not much you can do about it

#

Unless you make your own stringifier process, or use a third party json stringifer

frank crest
#

what's the reason for needing to put it in the clipboard via code?

deft shard
frank crest
#

why not copy it in the IDE?

deft shard
#

because im altering the values of the struct in runtime

frank crest
#

aah gotcha

#

yeah you'll need to write code to specifically write out the string in order

#

since structs are unordered like tab mentioned

#

you could define the order with something like an array of strings, then loop through the struct and add them to the clipboard string in order

deft shard
#

that is quite unfortunate

#

im honestly not sure if this is even the best way of doing this

frank crest
#

if you don't need the bullet code written directly in the IDE, you could just export the info to JSON and load it in when you need the bullet info

#

if you do want it written into the IDE, something like what I mentioned to order and format the stuff you copy to clipboard would be the way

deft shard
#

i think prefer it written in the ide, and what i have isn't too bad since i just need the stats

#

just tedious i guess

pastel girder
#

Or you could use Figgy.

deft shard
deft shard
pastel girder
#

Oh yeah, it does not. And it doesn't need to, since deltas are saved to datafiles and then loaded.

#

Replacing code directly is a major pain and would require you to follow a very specific, limited code formatting.