So, just wanted to know if there is script for getting object (name) where another object is colliding.
I know that there is these functions:
isCollisionTest(object)
isCollisionBetween(object1, object2)
getNumCollisions(object)

but these dont give object name where something (for example bullet, part of explosion) has collided,
I need object name from collision..

I do have few ideas how to go around this, but they are kind of. bad
1) rayhit
2) loop all objects (object tables)

Is there anyway around this than these two?
is there coming some script function for maratis on this one?

Edit: missed some text >.<

2

(7 replies, posted in Scripting)

Thanks alot smile again big_smile

Ok, i did try that setParent, but apparently if I set parent in editor, it does not work (setParent to none)?  (not problem for me tho tongue )
So for more info what i tried and did:
-I had a gun where it shoots bullets, bullet had gun as parent (set on editor) so it rotates..and then i cloned bullet..but setParent did not work..
-I then just added box in the gun where the bullet start (bullet had no parent) and then cloned the bullet. (alltho now that im writing, why not just use the gun as starting point >.< .....)

oh and just quick question, ( i did went for that wiki list of functions thru, did not see any function for this) but is there a way to draw a line in lua scripts?
I would like to draw line from a to b..
Or how to do it in lua script other ways of doing it, if there is not?

3

(7 replies, posted in Scripting)

anael wrote:

Hi, there is no delete as it can be a bit unsafe to deal with memory from lua (as getObject handle pointers),
deactivate will totally disable the object.

If your initial need is to clone / delete lot of objects, try to see it as a buffer to reuse the same objects a maximum.
Even getClone should on maximum be used out of the update loop (for better performance).

Reason why I asked is that im doing FPS game, where i will make bullets (clone bullets) and if they are near object i would like to delete them.
But i think the bullets will go so fast that there would not be too much of them..so i can disable them and then use them again.
Is there delete in c++? big_smile

well last night i tried coding and tested and made (cloned) about 2000 objects big_smile and it still went smoothly..(very simple object)
(but also the all cloned ones rotated same time O.o cos did not have script done complete yet)
Thanks for tips smile will help me out big_smile

EDIT:
Further questions: when i clone the object will get the position of reference object?
also the clone object will have same parent ( or then i got some error in my code big_smile ) , so how i can just remove the parent of the object? tongue

4

(1 replies, posted in Scripting)

Hmm in lua i think its like this:

if answer == "take"..item then 

(then it does not matter if "item" is a number too...for example item=11  so take11 is result...

5

(7 replies, posted in Scripting)

Hm did not want to make new threat so..
is there function to delete object in LUA script..
I see deactivate but is there delete? big_smile thanks for help in advance big_smile

6

(7 replies, posted in General)

How simple are you looking for?
in my game "very stupid" ai  is just randomly moving
(im still doing that ai...but im doing other stuff atm)

I done the moving like this:
i got randomNumber
if its below 7 : rotate to one direction
if its below 10 (7-10) move straight
else move and rotate same time.
if player is in vision reduce health of player (but will add more in this part, like shoot, aim etc)

well it is very stupid ai, havent done yet detection of walls, will do better when got time.

7

(9 replies, posted in Showcase)

Nice smile is it done all in LUA script? or ? big_smile
err i think you done it in C++ big_smile nevermind big_smile

8

(7 replies, posted in Scripting)

That solved the problem smile thanks big_smile and thanks for the updateMatrix tip too big_smile will come useful smile

i was looking that list of functions but somehow my eye did not catch those functions :-/ . (all tho im not suprised, i cant even see if my colleague is walking past me big_smile )

9

(7 replies, posted in Scripting)

I got few objects map, and the problem comes when object has parent. If it has parent it seems i only get starting position or rotation (getposition etc), but the collision test of the object works fine... And if i try getting another object position it works (if has no parents)..

is this bug? And is there some way to get the position object which has parent?

10

(1 replies, posted in Scripting)

Hmm i dont know if this work (havent try it...)
but you could make a variable and in SceneUpdate for example pause=0 at start of the game, pause=1 when pause.
and just wrap "if"-statement the game logic (player move etc).
So when player goes to menu, other things goes to pause (i think this atleast work with LUA, and in C++ , well might take few more lines of codes because you write ai in c++? maybe add behaviour that just dont do anything or something)
also if you have object you have to getCentralForces ( i think, im noob in coding with LUA still...) and somehow save them and stop all forces (clearForces)

Correct me if im wrong tho smile
but basically i think  that you have to save current scenes forces, behaviours etc, clear them (stop them moving) when going menu,
and when coming back put all forces back... but this will be problem when multiple objects... (first objects have their forces and the other dont yet (end of the list))

11

(2 replies, posted in General)

Code is correct.
Try this in your GUI scene: rotate the camera and the text to different positions... 180 degrees rotation etc.
This was the case for me at least.. even tho the camera did show text in gui scene, the game scene did not show anything.
After i rotated objects around they did show in game.

Edit:
I also did some other stuff in the scene, so im not sure if it was the rotation or the other stuff.. smile
but i will check it on my own GUI scene later (if i remember big_smile )

12

(3 replies, posted in General)

Crucio777 wrote:

Why not experiment yourself? get a free animation from blendeswap export it to maratis , and do the box thingy ? why not try it out.
Not to sound rude i cannot understand the question but i get the gist so i am not gonna reply if its possible Somebody else can help you out but i would say try it yourself not that hard , and if you fail post here we will help you out big_smile

Sorry big_smile dunno how to explain it better. (bad english also so big_smile )
I just making player with animation on it, and want to see where person is hit when someone is shooting. So was thinking putting some boxes around hands etc to check collision(/or rayhit), but was just thinking if i make animation (hand move, leg move) does the box also move according where its located (moving according hand) or is it moving according central point of the player.

I did experiment big_smile and the boxes are moving according the central point of the player (which makes sense...) .

Thanks for answers tho smile

but i think i can make different kind of solution for this anyway smile
Still learning LUA and what i can make with it (and Maratis), but anyways thanks smile

13

(3 replies, posted in General)

Okey, so im new to maratis so forgive me if putting this to wrong place (and if its silly question) big_smile

Anyway,
If i create a object, which has animation (for example human walking when pressing button),
and i make box to cover the hand/arm, does the box move according the animation when human is walking..
If not, how should i do it big_smile

So, reason for this is that i could check where person is shot.

Again, sorry if its too silly question big_smile