Oh I see... So I can't get the position of the object if I clone it during runtime.
That's interesting. Okay, lesson learned! Thanks alot Ant0n! That really helps big_smile! Thank you!

Hi, everyone!
I have a question. Is it possible to get the position of a clone object?
Let's say I have simple script like this:

Sphere = getObject("Sphere")

function onSceneUpdate()

    bullet = getClone(Sphere)
    translate(bullet, {0, 1, 0}, "local")

end

Now, I can get the position of the Sphere using getPosition(Sphere). But how can I get the position of the bullet? I tried using the same getPosition function, but it doesn't seem to work. Anyone can help?

3

(3 replies, posted in Scripting)

Ah, yes, it's working!
Many, many thanks, Sponk! That helps a lot.
It's solved now. Thank you big_smile.

Hi, everyone

I know that there are some discussions about how to make buttons in Maratis. Unfortunately, after doing some search and test, I still can't create buttons using rayHit (sorry for my noobiness hmm). So I tried to follow this tutorial about getUnProjectedPoint but I got stuck again.
In my scene, I have three buttons: moveLeft, rotate, and moveRight. I want to use those buttons to move and rotate a cube.

Following the tutorial, I can make the rotation button to rotate the cube. However, when I moved the mouse cursor over the other buttons (moveLeft and moveRight), the cube also rotating. Can someone give me a hint of how to fix my script?

Here is the project file to download. https://www.dropbox.com/s/wzh0ioat20q8v … r_test.zip
And here is the script based on the documentation:

moveRight = getObject("moveRight")
moveLeft = getObject("moveLeft")
Rotate = getObject("Rotate")
Cube = getObject("Cube")
Camera = getObject("Camera")

point = getUnProjectedPoint(Camera, vec3(x, y, z))

function onSceneUpdate()
  mx = getAxis("MOUSE_X")
  my = getAxis("MOUSE_Y")    
    
  V1 = getUnProjectedPoint(Camera, vec3(mx, my, 0))
  V2 = getUnProjectedPoint(Camera, vec3(mx, my, 1))
    
  point, Rotate = rayHit(V1, V2)

  if point then
    rotate(Cube, {0, 0, 1}, 4)
  end 

--[[
  if point then
    translate(Cube, {1, 0, 0}, 2)
  end 
  ]]--
  
end

Thanks for any help.

5

(64 replies, posted in News)

anael wrote:

Does it happen also in windows ?

No. It doesn't happen on windows 32 bit I downloaded from Vegas's link. The windows build looks fine so far.

anael wrote:

I found a bug in Bullet : https://github.com/bulletphysics/bullet … t-50972842
I uploaded a fix, can you try again ?

Sweet! The physics is working correctly now on OSX.
Thanks a lot, Anael. That was fast.

6

(64 replies, posted in News)

Thanks for the update, Anael!

I've downloaded the OSX build. And I think I found a bug, but I'm not sure. Before I'm posting a bug report on the bug tracker, I would like to make sure if it really is a bug.

I created a simple level with a plane as a floor, and a cube on top of the floor. I enabled the physics for both objects and there is no script at all for the scene.

If I set the collision shape to Box, the cube sliding endlessly on the floor. And if I change the collision shape to Convex-hull for both objects, the cube sliding and spinning faster and faster.

This doesn't happen in the previous build (Maratis 3.21).
In the previous build, the box just dropped and stopped which means that the physics works correctly. I tested it on 64 bit Mac OSX 10.7

Is it just me or I should post a bug report?


Edit:
It works fine on Win 32 bit build posted by Vegas in post 36. Thanks for the build, Vegas.

7

(5 replies, posted in General)

Oh, i'm such a noob at coding. I misplaced the mx and my!!
Thanks a lot, Vegas. That's a very helpful example. Thank you.

8

(5 replies, posted in General)

Hi, sorry for bumping this thread.

I just found out that Maratis 3.2 has been released. And i notice there is this GetUnProjectedPoint addition. Is this something like"Mouse Over" in Maratis?

I've tried the script in the given example on that link. However, i can't make it works, and i don't get any error report in the console.
I have a cube (with physics enabled) in front of the camera, and it doesn't rotate when i move the mouse over the cube. Could it be that i missunderstood this function?

9

(36 replies, posted in Scripting)

Hi, this is a nice thread.
Unless i missed something, i think Pause function is needed, so we don't have to hard code everything, if we want to pause the game.

10

(5 replies, posted in General)

Thanks, for the suggestion Vegas. I've just found out this Function request thread, and apparently mouse over is already on the to do list. Glad to see that. For the time being, i guess i'll play around a bit more to see if i can get some luck with current engine.
Thank you smile

11

(5 replies, posted in General)

Hi, everyone.

Is there any tutorial on making GUI menu with Lua? I would like to make something like 'mouse over' on a button. My first try was to getAxis for mouse positions and i've failed. In my second attempt, i tried with rayCast, and still can't get work either.
I'm still a beginner in coding in general. And apparently this simple task is still too difficult for my level.

Thanks for any help.

12

(0 replies, posted in General)

Hi,
Any chance for a ragdoll example/ tutorial in Maratis? smile
I mean... skinned and animated ragdoll, with controlled bone from an imported entity from blender. Not a ragdoll from separated meshes.
I was just started learning Lua a while ago and the progress is slow. But right now i'm really curious about how easy/ hard it would be to make a skinned and animated ragdoll in Maratis.

13

(4 replies, posted in Engine)

Particle system in Maratis, pleeease big_smile
Fire, water, explosion, etc.
Dust trails every time Jules (or the sheep from Yo Frankie) walking would be perfect.
Thanks for the engine. I like the light and shadows in Maratis very much smile