Could you explain better your test application? All that happens is I click the button and get "base.idCarteActive not a number"
But is it safe to assume that your problem is related to either Run String, or reading global variables?
Could you explain better your test application? All that happens is I click the button and get "base.idCarteActive not a number"
But is it safe to assume that your problem is related to either Run String, or reading global variables?
I'll explain better soon (i'm not home at the moment)... On my computer it crashes, and closes the app, with a memory error.
I didn't explain more because I was sure it would crash for you too
thanks for looking into it
Is there any way to REMOVE an object from the MMF Interface? I tested and found that you can only Export 736 different objects before it crashes (on your 737th export), and I need to be able to clear up memory from old objects so I can replace them...
You can overwrite existing exported objects by reusing IDs. But that's beside the point. There is no hard-coded limit, so there is an underlying problem that must be investigated.
Have you tried approaching this limit in different scripts? I just ran a test script that created 800 objects without crashing.
I ran a simple script. All it did was this:
I had an active object, a counter, and an xLua extension.
*Always:
xLua: Export Active Object
add 1 to counter
I would watch as the counter went up and up. It would stop at 736, when the game crashed. I tried putting that inside a loop that ran X times, doing that each time, and it would always crash at the next multiple around 736. So I draw the conclusion that that is how many objects you can have exported.
I did this both reusing the same ID and using different IDs (going up by 1 each time), same result
I dug out my old laptop to throw another machine at the problem. I observed it crash at 1025 using your exact example.
Since I have something I can physically debug now, I'll start working on it.
http://hocuspocus.taloncrossing.com/rii/xlua-dist.zip
This release should hopefully fix that problem. it MAY also fix Corentin's problem but I am far from sure on that.
Thanks for reporting it.
Thanks a ton for the update, I reworked my project (ONCE AGAIN) to use my LUA script instead of a binary array. I tried testing it to see how many objects it can handle now, but it was at 50 FPS no matter how many I put in there O_o. Freakish
I've got another one, or maybe its just a question; whats the deal with the return type on the MMF interface's Object.GetAngle and SetAngle functions? I have them set up exactly the same as the rest of my work, but whenever it tries to retrieve them, its all garbled up values, like its trying to convert the bits from a float to an integer or something. I know Lua's a little leery with all its mojo going on with data types, the way it converts everything to a homogeneous long-float-whatever. But is there some special trick I need for that function?
Oh and btw its being quite stable. I'm still getting a crash or two when I really try to abuse my game by smashing my keyboard (Offset: 00015962) but I definitely can't reproduce them. I think I'm probably somehow exceeding my array bounds by having too many objects which is sinking it. But overall I'd say your extension is shaping up nice! No major flaws or random crashes or anything
I think there's still a few places that I need to guard the stack better, so that might be where some crashes originate. Let me know if it becomes a bigger problem or you find something reproducible.
As far as I'm aware, MMF angle is an integer value only, in case you were trying to work with floats. But you are probably correct, both MMF and lua especially are a little hazy with the distinction between int and float. Try downloading the file again from any of the links above and see if that helps.