Re: Functions request

Add already function spawn! Is it so difficult??? Something like these:
spawnEntity("file path") or loadMesh("file path")
Pleeeease!

Re: Functions request

Well, if you want to spawn an entity, make a single instance of the entity you want to spawn (with all the properties) and create a table for all the clones. Then use getClone(parent), which will create a clone of the parent entity and return it, and just put that in the table. Then you can just use a for loop to cycle through all the clones and make them do stuff.

Re: Functions request

So I do. But it's not comfortable.

Re: Functions request

An isSoundOver() function would be useful to me right now, hehe. Also, just more sound functions in general (lua side). Or even being able to adjust the pitch of the sound or all the other parameters that are in the editor through script. This really goes for all editor parameters really.

Last edited by Tutorial Doctor (2013-10-17 15:53:27)

Re: Functions request

1. debug (text) - write "text" on screen/console. If lua file contains errors then error text display on same place.
2. dostring (str) - execute lua string, e.g. dostring("On"..<getObjectUnderCursorName>.."Click()")
3. I think that GetSystemTick is not necessary function and can be replaced by os.clock() (standard lua function).
4. timer(msDelay, AfterDelay_LuaStringToDo). It's can be realized as lua-library throught "dostring".
5. if <smth>.lua is not-correct then dofile(<smth>.lua) must return error. 
In MScript.cpp -> doFile change luaL_dostring(L, text); to

int result = luaL_dostring(L, text);
if (result != 0)
         printf(lua_tostring(L, -1));

Last edited by Aikon (2013-12-19 20:21:10)

Re: Functions request

A suggestion for scene switching :

Right now i don't see a good way to make use of scene switching or level switching as
you can't import/keep objects from the previous scene/level.

while i was searching on the subject, i found this :
DontDestroyOnLoad from unity, which is preserving the objects you want for the next scene

Something similiar would be great !

Re: Functions request

Can't you duplicate the level file and change the name? This would be a temporary fix. A good way for this to be added is to have a groping system.

Re: Functions request

That would be an important function.

Re: Functions request

I posted a link to LuaSQL in the General category, which is a Lua-based persistent store that can utilize multiple database types.

You would simply write the needed data to the database and then load it in your next scene. This would supplement the modular design paradigm that the engine currently uses.

------

LuaSQL post: http://forum.maratis3d.com/viewtopic.php?id=945

Last edited by sunnystormy (2014-03-07 21:26:29)

Re: Functions request

My requested functions would be (adopted from the Blender Game Engine):

    1.) getAverageFrameRate() -> framerate
    2.) getMaxLogicTic() -> ticrate
    3.) getMaxPhysicsTic() -> ticrate
    4.) getMaxLogicFrame() -> framerate
    5.) getMaxPhysicsFrame() -> framerate
    6.) setMaxLogicTic( ticrate )
    7.) setMaxPhysicsTic( ticrate )
    8.) setMaxLogicFrame( framerate )
    9.) setMaxPhysicsFrame( framerate )

Re: Functions request

Hey ReubenUnicruz!

I think all logic and physics runs at 60Hz so getting the framerate would be quite useless.
What in fact is useful is the average frame rate of the graphics.

I already implemented this feature in my game plugin and will port it to the standard engine.

Sponk

Re: Functions request

My Lua functions request:
->SendMessage()
->Material.color(r,g,b) - To add highlights on selected objects or when mouseover them.