Completely disable collision checking on unit?

Completely disable collision checking on unit?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Completely disable collision checking on unit?

Post by Anarchid »

I have a following setup flying around in something i play around with occasionally:

1) A donut-shaped gunship builder
2) A little gadget that does set-unit-piece-collision-data so that the collision volumes when viewed in alt-v are just as donut-shaped as the unit.
3) An invisible, invincible, zero-radius, zero-height, zero-everything factory unit with blocking=0, collision=false, everything possible collision-related set to false and a yardmap of a single letter "o"
4) a unitscript for said flying donut that keeps the factory attached to the donut.

What this results in: on first attempt of motion, donut is launched into space by some hideus force. Then it falls back from the sky, and starts jittering around. This jitter also seems to grant it superpowers, so it can fly across the map in half a second when given the order (without order, jiter is brownian and fairly constrained)

What do i do? My aim is a flying factory/builder unit that can shoot stuff, and the factory products should fall freely from within the donut.

Any way to completely disable collisions on the factory sub-unit would be perfect, of course.

(bonus level: how do i make the factory sub-unit non-selectable?)
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Completely disable collision checking on unit?

Post by zwzsg »

Bonus answer: Spring.SetUnitNoSelect(unitID, true)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Completely disable collision checking on unit?

Post by knorke »

Did you see http://springrts.com/phpbb/viewtopic.ph ... 03&start=0 ?
I gave that script to a flying unit and it worked. (no bouncing)
factoryID = Spring.CreateUnit ("NAME_OF_FACTORY", x,y,z+100, 0, teamID)
Had to make the +100 a bit larger though, otherwise the factory would not build. (maybe the aircraft I used was bigger than the groundunit so it blocked or w/e)

Another problem with such flying factories was that the factory refuses to start construction when something is under the factory:
Image
(The vehicles "block" the factory)
The factory might be flying but appearently it still cares whether the constructed unit will have a free place on the ground.
Did you figure out something for that? (beside lua new factory-building code)

Similiar to sea factory in BA:
If a submarine is in the factory, the factory refuses to start construction of a ship because the submarine "blocks" the ship.
(which is nonsense because the ship can drive over the submarine, so it should not block the factory)
http://springrts.com/phpbb/viewtopic.php?f=21&t=28205

The bouncing might be because the aircraft collides with the factory, though I could not reproduce it. (think they will still collide even with zero radius, maybe try SetUnitBlocking)
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Completely disable collision checking on unit?

Post by Anarchid »

factoryID = Spring.CreateUnit ("NAME_OF_FACTORY", x,y,z+100, 0, teamID)
I''ve resorted to this to prevent it from jumping, but it still does if i put factory inside. Though in my case it does start building (which causes even whackier jitter).
Did you figure out something for that? (beside lua new factory-building code)
Didn't even stumble into this yet.

Oh, and i also tried the transport/fireplatform approach, and found out that my master unit refused to build buildings when turned into a transport. Are transports forbidden from being cons? 0_0

(i remember though that there was some crazy bug report that factories being loaded into transports caused crash. but i couldn't get mah unit to load the fac, probably because stupid)
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Completely disable collision checking on unit?

Post by zwzsg »

Anarchid wrote:Are transports forbidden from being cons? 0_0
Yes.
Post Reply

Return to “Game Development”