Author Topic: [Need Help] Flying Vehicle with Weapon Mount  (Read 3163 times)

I've been trying to script a weapon onto a vehicle and so far I've gotten most of the fixed up but now I've got this last error.
Code: [Select]
==>exec("add-ons/vehicle_X-wing.cs");
Executing Add-Ons/Vehicle_X-Wing.cs.
Object 'XwingBurnEmitter' is not a member of the 'ParticleEmitterData' data block class
Object 'XwingBurnEmitter' is not a member of the 'ParticleEmitterData' data block class
Add-Ons/Vehicle_X-Wing.cs (199): preload failed for LaserGunImage: Unable to load shape: .shapes/swm/Gun.dts.
I have no clue on what I should do, I'm not very great at scripting.
Yes there is a gun.dts in that Directory.

Please help!
It originally was Lord Richards Space Fighter.
« Last Edit: May 14, 2007, 06:31:10 PM by Packer »

I don't even see a XwingBurnEmitter datablock in there, you need to create one.
Also, check if you have Blockland\shapes\swm\Gun.dts

Yes there is a gun.dts in that Directory.
Emitter or no Emitter it should work D=

Replace:
Code: [Select]
.shapes/swm/Gun.dtsWith:
Code: [Select]
./shapes/swm/Gun.dts

Well spotted, that fixed that error but the Vehicle will not shoot. Any Ideas?

Maybe the timeout times are too quick.

Hmm may have some thing to do with Badspot enabling Weapons to be shoot from drivers seat with there own weapons.

Code: [Select]
function Xwing::onTrigger(%data, %obj, %trigger, %state)
{
   // data = datablock
   // obj = object number
   // trigger = 0 for "fire", 1 for "jump", 3 for "thrust"
   // state = 1 for firing, 0 for not firing
   
   if(%trigger == 0)
   {
      switch (%state) {
         case 0:
            %obj.fireWeapon = false;
            %obj.setImageTrigger(1, false);
            %obj.setImageTrigger(2, false);
         case 1:
            %obj.fireWeapon = true;
            if(%obj.nextWeaponFire == 0) {
               %obj.setImageTrigger(1, true);
               %obj.setImageTrigger(2, false);
            }
            else {
               %obj.setImageTrigger(1, false);
               %obj.setImageTrigger(2, true);
            }
      }
   }
}
Unsure, bad allergies, can't think, before allergies got this bad, I thought for a sec this might be it. My head hurts, I'm going to sleep when I'm done with the forum.

Try changing the mountpoints on both the model and ones used by the weapons. It's possible that triggering 'weapons' 1 and 2 is trying to fire a seat you or someone else is sitting in.

As far as I know, the image system is in a slight state of dissarray since technically the client is controlling both the player and the vehicle, although officially controlling the vehicle. Therefore when the client triggers, only one of the control objects may do something - so the player takes priority so players can shoot out of the vehicles while driving.

What might be preferable is if the player only took priority over vehicle shooting, when there was no vehicle image available.

I know what your talking about but I am clueless on how to do it D= I need more scripting skills  :panda:

Cool, I could look at it. Don't know if I could do shoot.