Jump to content
Official BF Editor Forums
Sign in to follow this  
Barton

Spawn Vehicle By Weapon

Recommended Posts

I have problem with spawn vehicle by weapon.

My weapon spawning eu_tank, but when I try enter tank game crashes.

I know this is possible cuz parachute is known as vehicle and you spawning it by weapon.

EDIT: I tried all vehicles, and all crashes game except parachute :(

Also I noticed that spawned vehicles by weapon dont have icon in mini map except parachute.

Pls help

Edited by Barton

Share this post


Link to post
Share on other sites

You 're kidding right....you' re seriously trying to spawn a vehicle like the parachute?

Well that won 't work. The parachute isn' t a vehicle at all; it' s a "parachute", a different type of template.

To spawn a vehicle, do the following:

1.) Add an objectspawner to the projectile of your weapon.

2.) Set up your objectspawner: here an example which will work: (thank you Battlefield Tweaker)

ObjectTemplate.create ObjectSpawner Your_weapon_projectile_objectspawner
ObjectTemplate.modifiedByUser Unknown
ObjectTemplate.isNotSaveable 1
ObjectTemplate.createdInEditor 1
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.setObjectTemplate 0 ustnk_m1a2
ObjectTemplate.minSpawnDelay 10
ObjectTemplate.maxSpawnDelay 10
ObjectTemplate.nrOfObjectToSpawn 1

3.) Test in-game. Beware that the vehicle can not be spawned if something is in the way. Try to position the objectspawner above the projectile.

Another way to do this:

Addtemplate an objectspawner to an explosion effect.

On impact it will then spawn the vehicle.

Final note:

Make sure the objectspawner is loaded after the vehicle you are trying to spawn. If you place it in as example effects, it will be loaded before the vehicle in "vehicles", which will invalidate the spawn.

To be sure it works; place it in a new folder called "z_spawners" directly in objects_server.zip

Any stuff undeclared?

Share this post


Link to post
Share on other sites

Well, bf 2142 can fire vehicles. Drones and sentrygun are launched using Generic fire arm.

Proof:

ObjectTemplate.projectileTemplate eu_sentrygun

ObjectTemplate.create PlayerControlObject eu_sentrygun

ObjectTemplate.activeSafe PlayerControlObject eu_sentrygun
ObjectTemplate.setAutoControllerTemplateName SentryGun

Share this post


Link to post
Share on other sites

Mmh yeah, but there still is one problem; the sentrygun can' t be entered.

Most likely it crashes when you enter it...

Just use an objectspawner; it has more options and you can position and rotate it way easier. :P

Share this post


Link to post
Share on other sites

I hope soon this problem will be solved, and thanks again for helping me bergerkiller :)

Also read my message that I sent to you pls.

Share this post


Link to post
Share on other sites

Not really relevant to the topic....but sentryguns can be entered if "autoControllerTemplate.allowTakeOver" is set to 1. No crash, no errors, just annoying when the camera spins with the barrel.

Share this post


Link to post
Share on other sites
Not really relevant to the topic....but sentryguns can be entered if "autoControllerTemplate.allowTakeOver" is set to 1. No crash, no errors, just annoying when the camera spins with the barrel.

I've fixed the camera.  :rolleyes: And now I am working to make it pitch correctly with it's turret, not barrels. Pitching barrels look weird and have bad descend angles.

btw: Check the mesh Objects\Weapons\handheld\sentrygun_deployer\meshes\sentrygun_deployer.bundledmesh.  :P Use Mesh Viewer. It is solider-controlled stationary gun, just like the one PAC jeep and Hachimoto have. Definetely mst be finished. I'll check it's rig later, and the turret itself must be remodeled.

Edited by sashaNar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×