Dual Collision Scripting

If you have problems installing or running Algodoo Phun Edition, this is where you can get help.
This is also where you should post any bug reports relating to Algodoo Phun Edition.

Dual Collision Scripting

Postby FruitMonger » Sat Jul 24, 2010 11:25 pm

Okay, so I have this gun that spawns balls and sends them flying. It works fine, but it has a huge block on it that makes the balls fly fast and far by colliding inside of it. Not very practical for somebody to carry around a huge block, eh? So I thought, "Hey, I'll just make my bullets spawn with collision groups A and B on, and make a negative attraction bar (that collides with B) to send them flying faster without a huge block on there. Simple!" But it turns out it's not that simple.

Whenever I put in my dual collision script, it only makes the bullet ball collide with A or B, not both. The script for making them collide with both, is...

Code: Select all
collideset := 1;collideset := 2;


I've also tried:
Code: Select all
collideset := 1,2


So my problem is this: How in the world do I make something collide with A and B at the same time with scripting?
Image
User avatar
FruitMonger
 
Posts: 135
Joined: Thu Dec 10, 2009 8:20 pm
Location: Some fruit stand in Indiana

Re: Dual Collision Scripting

Postby Chronos » Sun Jul 25, 2010 12:23 am

For collidesets, you have to add the numbers together.

A = 1
B = 2
C = 4
D = 8
And so on.

F + B = 34
A + B = 3

So you'd want collideset := 3
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: Dual Collision Scripting

Postby FruitMonger » Mon Jul 26, 2010 3:18 am

OH, I can't believe I didn't think of that. Thanks allot, Chronos! This's gonna help with some many things. :D :thumbup:
Image
User avatar
FruitMonger
 
Posts: 135
Joined: Thu Dec 10, 2009 8:20 pm
Location: Some fruit stand in Indiana


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 2 guests