Topic: Maratis3D - C++

Can I program in C++ without any additional stuff. I mean just create a .cpp file in the "Scripts" Folder and start writing code.
I don't like LUA(blah).
Why aren't there any tutorials, at least I can't find them it seems.
..help ?

Last edited by maximalista (2014-03-27 19:35:14)

Re: Maratis3D - C++

right now you have to compile all your c++ code in a game.dll , you can check those tutorials
http://www.maratis3d.org/?p=500

i would recommend sticking to lua for multiplatform compatibility:
you wouldn't have to recompile everything for windows/osx/android etc , and recompiling lua scripts is very fast
( very nice when you're designing a game )

despite it's ugly syntax , lua is apparently quite powerful
you can include multiple files via dofile command ( just like any other language )
and make classes
http://wiki.maratis3d.org/index.php?tit … in_Maratis

it's a good " game design oriented " language

Last edited by ulbex (2014-03-27 20:38:12)

Re: Maratis3D - C++

This seems as too much toying around for me. I guess I'm going back to the infinite loop of looking for a suitable engine.
What a shame, I really wanted to try something with this engine, unfortunately I won't be touching it again until C++ arrives(IF ti does).

I just can't stand Lua.

Last edited by maximalista (2014-03-27 20:40:16)

Re: Maratis3D - C++

you don't know what you're missing but okay...

Last edited by ulbex (2014-03-27 20:56:44)

Re: Maratis3D - C++

Hi,

like ulbex said, you can code in c++, follow the tutorial from the first link,
of course, you need a compiler installed on your system to compile the c++ code into a dynamic library.

Re: Maratis3D - C++

I am comming from another angle myself. I can't stand the syntax of C++, but after thorough investigation into learning C++, I see the power of it, and why it was designed the way it was.

I like Python and Lua also, and I am really liking the flexibility of LUA. I liike the syntax of LUA more than Python because with Python you have to indent correctly or else you will get errors. Not the case with lua. A statement is ended with the word "end."

I have a few tutorials on here about about programming in LUA.

Re: Maratis3D - C++

I think I will give Lua a shot after all.

Last edited by maximalista (2014-03-27 23:16:55)

Re: Maratis3D - C++

By the way, I wish I knew C++ better. I would love to add features to the engine itself (which you could do, since you know C++), and you can make game plugins and such. When I get a chance I will finish learning C++.

Re: Maratis3D - C++

Hm... Is it possible to build Maratis only with VS2012 and do everything from there ?

Re: Maratis3D - C++

Also, I'm trying to apply this to a cube, I see no errors to pop up from anywhere but nothing happens when I run the game.

--get stuff
Cube = getObject("Entity0")

function onSceneUpdate()
    if isKeyPressed("W") then
        addCentralForce(Player, {8, 0, 0}, "local")
    end

end


My first shot at Lua ...lol
Also when I exit maratis and I try to open a project and then load a level a first it seems all right but when I try to publish it (File->Publish Project) it says that I need to open a project first, but I have.
(Nevermind, fixed the publish thingy, but still wondering about the script I guess im going to sleep on it.)
Solved the code (feel so dumb) I left  typed Player instead of Entity in addCentralForce oh wells.
It would have been nice to see a message when you try to access something that isn't on your scene.

Last edited by maximalista (2014-03-28 08:01:41)

Re: Maratis3D - C++

If you are trying to add a force to the cube, the code should be:

addCentralForce(Cube,{8,0,0},"local")

Also, it is best to name objects in the Editor also:

cube = getObject("Cube")

Then your code would be:

addCentralForce(cube,{8,0,0},"local")

And you would be adding a force to the "cube" variable, which is getting the object named "Cube" in the editor.

Last edited by Tutorial Doctor (2014-03-30 13:23:59)