New coded object have no collision..

Ask questions, discuss ideas, get answers
Post Reply
User avatar
Dennis|8749236
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth
Contact:

New coded object have no collision..

Post by Dennis|8749236 »

Code: Select all

ObjectTemplate.create Bundle MissileTestObject_m1
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.setHasCollisionPhysics 1
ObjectTemplate.setHasResponsePhysics 1
rem -----------------------------------
ObjectTemplate.addTemplate Plank_10m_m1
ObjectTemplate.setPosition -0.5/0/0
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.addTemplate Plank_10m_m1
ObjectTemplate.setPosition 0.5/0/0
ObjectTemplate.setRotation 0/0/0
I coded a new static object to test the homing missile and try to improve it, but this **** static object won't react with anything except the vehicles and grenades..
Anyone know why this problem happened?
What is the meaning of Life?? (Don't think about it!)
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: New coded object have no collision..

Post by Swaffy »

Can you upload a video or pictures to help me understand the issue?

Is your rocket fired from a HandWeapon?
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Dennis|8749236
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth
Contact:

Re: New coded object have no collision..

Post by Dennis|8749236 »

Yes, you are correct, the rocket fired by hand weapon is not reacting with it..
and i have a same problem with a new radar bunker
What is the meaning of Life?? (Don't think about it!)
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: New coded object have no collision..

Post by Apache Thunder »

Does the Plank_10m_m1 object you addtemplated to that bundle also have collision physics turned on/has collision mesh?

You also only need to define one collision setting. Usually "ObjectTemplate.hasCollisionPhysics 1" is all you need to turn on collision for an object provided that object has a mesh with a collision mesh or a child object that has a collision mesh + also has collision physics turned on.
ImageImageImage
I have cameras in your head!
User avatar
Dennis|8749236
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth
Contact:

Re: New coded object have no collision..

Post by Dennis|8749236 »

so it should be like this?

Code: Select all

ObjectTemplate.create Bundle MissileTestObject_m1
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.hasCollisionPhysics 1
rem ObjectTemplate.setHasCollisionPhysics 1
rem ObjectTemplate.setHasResponsePhysics 1
rem -----------------------------------
ObjectTemplate.addTemplate Plank_10m_m1
ObjectTemplate.setPosition -0.5/0/0
ObjectTemplate.setRotation 0/0/0
ObjectTemplate.addTemplate Plank_10m_m1
ObjectTemplate.setPosition 0.5/0/0
ObjectTemplate.setRotation 0/0/0
What is the meaning of Life?? (Don't think about it!)
User avatar
Apache Thunder
Posts: 1213
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: New coded object have no collision..

Post by Apache Thunder »

Yes. Here is an example of a static object I have coded in my BFH mod:

Code: Select all

ObjectTemplate.create Bundle boatwreck
ObjectTemplate.geometry boatwreck_back_m1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.cullRadiusScale 5
rem -------------------------------
ObjectTemplate.addTemplate boatwreck_front
ObjectTemplate.addTemplate boatwreck_front_props
ObjectTemplate.addTemplate boatwreck_back_props
ObjectTemplate.addTemplate boatwreck_back_rails
ResponsePhysics coding is mostly reserved for stuff that has mobile physics or is expected to be destructible. For stationary statics, hasResponsePhysics code is not needed.
ImageImageImage
I have cameras in your head!
User avatar
Dennis|8749236
Posts: 239
Joined: Sun Nov 29, 2009 6:02 am
Location: Earth
Contact:

Re: New coded object have no collision..

Post by Dennis|8749236 »

ok, i'll try..
thank you very much..
What is the meaning of Life?? (Don't think about it!)
Post Reply