Page 1 of 1

IgeCannonComponent for physics collision

Posted: Tue Aug 27, 2013 2:30 am
by zaquanishak
Hi,
From the example 14.2-isoobjects-physics, i see u add the IgeCannonComponent in the index.js. Well i try to do the same for multiplayer but it's not working. I getting error
on the server 'C;\wamp\www\root\engine\core\IgeClass.js:130 var newComponent = new component(this, options); TypeError: object is not a function at IgeClass.addComponent (c:\wamp\www\root\engine\core\IgeClass.js:130:23) . But for single player it seem working. Could u help me out?

Regards,
Zachz

Re: IgeCannonComponent for physics collision

Posted: Tue Aug 27, 2013 7:43 pm
by robaldred
How are you running the server component?
You should run the server from the "server" folder in the examples

eg. node ige.js -g ../examples/14.2-isoobjects-physics

Re: IgeCannonComponent for physics collision

Posted: Tue Aug 27, 2013 10:11 pm
by hallsofvallhalla
If that's the case the setup tutorial I created shows how its done.

Re: IgeCannonComponent for physics collision

Posted: Wed Aug 28, 2013 2:33 am
by zaquanishak
Okay now i get why it give me error when i try to addComponent IgeCannonComponent. It is because i didn't put it inside if(!ige.isServer) statement. So that mean the IgeCannonConent can only run in the client side is it?

Regards,
Zachz

Re: IgeCannonComponent for physics collision

Posted: Wed Aug 28, 2013 2:41 am
by zaquanishak
Okay now i get why it give me error when i try to addComponent IgeCannonComponent. It is because i didn't put it inside if(!ige.isServer) statement. So that mean the IgeCannonConent can only run in the client side is it
So how do i create a collision detection for multiplayer in the server side? Do i use tileoccupy? If so how should i do it?

Regards,
Zachz

Re: IgeCannonComponent for physics collision

Posted: Wed Aug 28, 2013 8:37 am
by robaldred
Ahh sorry, I think there's some confusion.
example 14.2 is not a server side demo.

For server side physics checkout example 23.1
Also if you're want multiplayer, checkout the 24.2-multiplayer example.

Re: IgeCannonComponent for physics collision

Posted: Wed Aug 28, 2013 9:13 am
by robaldred
Also, there is a little issue with the IgeCannonComponent in master
Checkout the dev branch instead.

Or add the following to the bottom of the IgeCannonComponent.js to enable use within node

if (typeof(module) !== 'undefined' && typeof(module.exports) !== 'undefined') { module.exports = IgeCannonComponent; }

Re: IgeCannonComponent for physics collision

Posted: Wed Aug 28, 2013 9:14 am
by zaquanishak
thanks rob, but the thing is what i want is something like a collision for isometric. Similiar like 14.2-isoobjects-physics which use IgeCannonComponent. And another thing rob, how do i use occupyTile()? My scenario is like this, i created a building on client side and mount it to ige.client.foregroundMap on another hand i created a character and mount it on ige.server.foregroundMap. how do make this two entity know each other when i mount it on different IgeTileMap2d?

Thanks in advance.

Regards,
Zachz

Re: IgeCannonComponent for physics collision

Posted: Wed Aug 28, 2013 9:20 am
by robaldred
Call .streamMode(1) on entities to make them sync up, this will automatically take care of transformations.
Checkout http://www.isogenicengine.com/documenta ... streaming/

Re: IgeCannonComponent for physics collision

Posted: Wed Aug 28, 2013 11:36 am
by zaquanishak
Thanks for your help. I manage to get it working. :D