Weapon kit spawn on vehicle.

Ask questions, discuss ideas, get answers
Post Reply
Poow
Posts: 271
Joined: Sun Nov 01, 2009 8:00 pm
Location: Germany
Contact:

Weapon kit spawn on vehicle.

Post by Poow »

Is it possible to spawn a weapon kit on a PCO?
A tank eg.

Code: Select all

ObjectTemplate.addTemplate M551_Supportspawner
ObjectTemplate.setPosition x/y/z


ObjectTemplate.create ObjectSpawner M551_Supportspawner
ObjectTemplate.setObjectTemplate 1 German_Engineer
ObjectTemplate.setObjectTemplate 2 German_Engineer
ObjectTemplate.minSpawnDelay 20
ObjectTemplate.maxSpawnDelay 20
ObjectTemplate.TimeToLive 30
ObjectTemplate.Distance 20
ObjectTemplate.spawnOffset 0/0/0
ObjectTemplate.holdObject 1
ObjectTemplate.team 1
ObjectTemplate.MaxNrOfObjectSpawned 2
ObjectTemplate.damageWhenLost 10
Does not work without a ctd.
You’re entering a world of pain!
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Weapon kit spawn on vehicle.

Post by Apache Thunder »

Yes. But the kit must have a engine on it for the holdObject command to work. You can code a simple dummy engine with no network info and it will do the job. You might also need to turn on mobile physics for the kit:

Code: Select all

ObjectTemplate.setHasMobilePhysics 1
However the kit won't behave right in muliplayer. It won't be visible if it has mobile physics. But it will stick to the vehicle and remain visible when mobile physics for the kit is not present. But the kit will not pitch/rotate with the vehicle/spawner in multiplayer. :(

But it does work!
ImageImageImage
I have cameras in your head!
Post Reply