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 ! Thank you!
1 2014-10-02 04:40:31
Re: How to get the position of a clone? (2 replies, posted in Scripting)
2 2014-10-01 15:15:28
Topic: How to get the position of a clone? (2 replies, posted in Scripting)
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 2014-08-04 10:15:56
Re: How to make buttons in Maratis (3 replies, posted in Scripting)
Ah, yes, it's working!
Many, many thanks, Sponk! That helps a lot.
It's solved now. Thank you .
4 2014-08-04 08:41:36
Topic: How to make buttons in Maratis (3 replies, posted in Scripting)
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 ). 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 2014-08-03 01:28:28
Re: Call for contribution : we need you ! (64 replies, posted in News)
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.
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 2014-08-02 16:19:01
Re: Call for contribution : we need you ! (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 2013-03-19 04:06:29
Re: GUI with Lua (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 2013-03-18 20:04:45
Re: GUI with Lua (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 2013-02-03 00:21:38
Re: Functions request (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 2013-02-03 00:20:13
Re: GUI with Lua (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
11 2013-02-02 07:35:37
Topic: GUI with Lua (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 2011-12-06 05:53:27
Topic: Ragdoll in Maratis? (0 replies, posted in General)
Hi,
Any chance for a ragdoll example/ tutorial in Maratis?
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 2011-10-17 04:54:12
Topic: Particle system (4 replies, posted in Engine)
Particle system in Maratis, pleeease
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