Open Sylph opened 12 years ago
This one is pretty hard to avoid because you don't even have to write to the stream. Opening and directly closing the stream will break the plugin on the current master.
I'm also having issues with this. Was looking to use pex for our particles.
This also happens if you use a "require()" statement anywhere before loading the plugin. Irritating.
Edit - I've just noticed that the error I'm getting only occurs when running through ZeroBrane Studio, If I just run it from the command line then everything's fine. Can you other guys confirm whether you were using ZBS too?
(cross-posting from pkulchenko/ZeroBraneStudio#87)
@TheGribble, this doesn't seem to be a ZBS problem. The problem appears to be with Moai corrupting something internally when it does path search (not sure about cpath). For example, the following code works (assuming you have dummy.lua in the current folder):
package.path = "./?.lua"
require('dummy')
print(MOAIParticlePexPlugin.load('deathBlossomCharge.pex'):getMaxParticles())
but this one doesn't (it returns 32182168 instead of 40, but your number may be different):
package.path = "foo/?.lua;./?.lua" -- foo/ folder doesn't exist
require('dummy')
print(MOAIParticlePexPlugin.load('deathBlossomCharge.pex'):getMaxParticles())
I'm experiencing a similar problem using ZBS and the XML sample in MOAI (pkulchenko/ZeroBraneStudio#96)
I use IntelliJ IDEA, TheGribble. I'm probably switching to cocos2d-x for my next game, but i'll keep watch on this because MoaiSDK is a pretty wonderful tool as well.
Using the following code
results in the last line printing 81202816 0 or other similarly invalid numbers, rather than 40 9 that it should have printed.
This happens on the latest source (debug, release build), and released SDKs (build 98, and build 119).