Author Topic: Gravity Tank missing the cannon part.  (Read 662 times)

So, Im trying to make a gravity tank, but its missing the cannon. How do I fix this? I only know simple scripting, so if you could edit the script to make it appear and shoot, I will give you credit. Thanks.
Code: [Select]
$GravityTankTypemasks=$typemasks::fxbrickobjecttype | $typemasks::interiorobjecttype | $typemasks::terrainobjecttype | $typemasks::StaticObjectType;

datablock wheeledvehicledata(GravityTankVehicle : TankVehicle){
 cameraRoll=true;
 cameramaxdist=8;
 cameraoffset=0;
 uiname="Gravity Tank";
};

function GravityTankVehicle::onadd(%this,%obj){
 %obj.isshiftinggravity=1;
 %obj.grav="0 0 -0.5";
 shiftgravitycheck(%obj);
 parent::onadd(%this,%obj);
}

function shiftgravitycheck(%obj){
 if(!%obj.isshiftinggravity)
  return;
 %pos=%obj.getposition();
 %ray=containerraycast(%pos,vectoradd(%pos,vectorscale(%obj.getupvector(),"-4 -4 -4")),$GravityTankTypemasks,%obj);
 %normal=getwords(%ray,4,6);
 if(%normal!$="")
  %obj.grav=vectorscale(%normal,"-0.5 -0.5 -0.5");
 %obj.setvelocity(vectoradd(%obj.getvelocity(),vectoradd("0 0 0.5",%obj.grav)));
 schedule(25,0,shiftgravitycheck,%obj);
}

did you make a new turret but forget to change the name or something

see also: did you get the names mixed up

No, I dont think I made a new turret.

oh
you didn't use the normal tank's onAdd function as a parent
that's where the turret is created

Isn't there already a flying tank?


reread the title
Well what's the difference between a flying tank and gravity tank?

you're both very offtopic

john, look at the tank turret's onAdd function and copy it to your onAdd function

or just call it

Well what's the difference between a flying tank and gravity tank?
Gravity tank hasn't been made yet

Gravity tank hasn't been made yet
*facepalm*

But whats the difference? don't they both fly?

*facepalm*

But whats the difference? don't they both fly?
Try not to facepalm if you don't know about the subject matter at hand. Gravity vehicles change the direction of their gravitational pull based on orientation, allowing for driving up walls and such. Flying vehicles fly

If you're still confused about the difference, download the gravity jeep and actually try it

Try not to facepalm if you don't know about the subject matter at hand. Gravity vehicles change the direction of their gravitational pull based on orientation, allowing for driving up walls and such. Flying vehicles fly
You could have just said that when I first asked you.