Collision different in Mac and Win versions
by Andy Hawkins · in Torque Game Builder · 05/19/2009 (8:23 pm) · 9 replies
I exported my game from TGB 1.7.4 to Mac and Win. In the Win version when you fire the bullets fly away as expected. In the Mac version (same code base/ same session when exporting) when you fire the bullets drag you along with them. How do I make sure bullets don't effect npc's and players in this way?
Here's the demos...
Mac version
Win
and the instructions...
Keys
1 - Laser bullet - shoots aliens
2 - Fire extinguisher - puts out fires
Arrow keys - move up down left and right. Can only fire sideways for now.
Tasks:
Touch women (yes sounds suss) to make them follow you - if only life was so simple :)
Lead them to the EXIT (word)
Put out all fires - aliens and women wont walk through fires.
Kill aliens.
Something, something... not finished yet.
And a pic...

Here's the demos...
Mac version
Win
and the instructions...
Keys
1 - Laser bullet - shoots aliens
2 - Fire extinguisher - puts out fires
Arrow keys - move up down left and right. Can only fire sideways for now.
Tasks:
Touch women (yes sounds suss) to make them follow you - if only life was so simple :)
Lead them to the EXIT (word)
Put out all fires - aliens and women wont walk through fires.
Kill aliens.
Something, something... not finished yet.
And a pic...

#2
I'm not sure how to set groups but I'm having a look now. Thanks :)
05/22/2009 (3:53 am)
From TGB export (a file option) I built as a Win version, then used the dropdown to make it a Mac version, so all within the same program.I'm not sure how to set groups but I'm having a look now. Thanks :)
#3
.
05/22/2009 (12:04 pm)
When you are on the edit tab, you can set the collision layers (groups) here...
#4
05/23/2009 (3:48 am)
Oh yeah I know about that, but the bullets are spawned on the fly. Don't I have to set their groups as well? How do I set groups in script?
#5
How then do I make sure npc's collide with walls?
05/25/2009 (5:30 pm)
Okay I tried this and it works, the bullets no longer push the npc's, but if I turn off Recieve Physics for my npc's, my npc's are able to walk through walls. How then do I make sure npc's collide with walls?
#6
08/24/2009 (12:48 am)
and Bump! can anyone help?
#7
Good to see you on the 2d side... :)
Have you tried leaving 'Receive Physics' on for NPC's and in your onCollision callback for you projectile, check if %obj is an NPC and deal damage (or whatever it is you do) and remove the projectile?
Something like that should work.
08/24/2009 (12:09 pm)
Hey Andy,Good to see you on the 2d side... :)
Have you tried leaving 'Receive Physics' on for NPC's and in your onCollision callback for you projectile, check if %obj is an NPC and deal damage (or whatever it is you do) and remove the projectile?
Something like that should work.
#8
08/24/2009 (12:52 pm)
Great, thanks Patrick. I will try that and report back.
#9
www.garagegames.com/community/forums/viewthread/27310
08/24/2009 (2:01 pm)
Btw, the safeDelete function seems to work best for removing projectiles from what I've seen.www.garagegames.com/community/forums/viewthread/27310
Torque Owner Michael Hartlef
how did you actually ported it over? Manually?
Make sure that your collision setting (groups) are set identically. I ran into this before too and at the end it was a different setting.