on the onEvent function, I have it testing for too many event names, and it lags. However, I can't just remove them because I need them for my custom HUD to work. Is there a way to test for all of the events without doing it every time an event is called? All of the events I test for start with "dc-trig-" followed by a number. In my normal levels it is testing for 5 of them and still runs smoothly, but in some, I'm testing for 10, and it causes lag. So, what I basically want to do is be able to parse only the first few letters of an event's name and not test all of them unless the "dc-trig-" part is present.
| ||
The probably easiest way is:
Code: Select all if(myEventName:find("dc-trig-"))thenBtw, next release comes with luajit. Luajit should run code x2 to x100 faster than the normal lua. ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ | ||
Code: Select all function onEvent(eventName)This doesn't seem to work; the events won't trigger anything in Lua with the find() function there. EDIT: You don't need to help me fix that. It turns out that the lag was actually caused by a bad onLoop function routine that was placing 2 sprites on the screen per frame. | ||
Who is online (over the past 5 minutes)Users browsing this forum: 1 guest | ||