MiniC N.Edition (JS-like Scripting Language)

105 replies to this topic
Posted 2 months ago #102

I'll push out an update soon. Basically, what I did was to set a variable whenever you do "xyz as 'int'" that tells the variable if it gets cast to a string, to act like an integer. I haven't tested it and won't be testing it right now because I'm redesigning my house and I don't have much time to push this fix in.

To iterate, keep your code the way you have it right now. That's the only way this will work because all numbers are a float as far as the VM is concerned.

Edit: I pushed out the update, but I can almost guarantee there is probably a bug somewhere. So if you have any odd or unexpected output, alert me and I'll attempt to fix whatever it is.

Posted 2 months ago #103

It still returns it as floating point on glfw.
For my code it also never takes the code path for Case "string","str" (line 1374).
Thank you for your help :)

Posted 2 months ago #104

I am stupid. I had the intention to do something specific when I got to the code and then I totally ignored what I intended to do.

For now this should work.

(something as 'int') as 'str'

I'll attempt to do what I actually intended soon.

Posted 2 months ago #105

Dude, thanks! That works.
I totally get now why, now I feel stupid xD

I am planning on shipping a demo soon, and the whole battle system wouldn't have worked without this :)

Posted 1 month ago #106

I failed here. I should have just made an "intstr" or "intstring" conversion. The reason I added the other thing was so it would act like JavaScript. Basically, 'blah' + xyz as 'int' would be "blah0" or whatever, but then I didn't do it. Mmmm...

I mostly wrote this post as a reminder to myself when I have the time to update that. I think I'll add 'intstr' as an optional form of quickly doing that.