2007.10.15, 06:05 PM
Why doesn't it shoot?
?
Code:
var lastCrashTick;
var lastAngleY;
var smokeCount;
var damageLevel;
var lastDamageTick;
function Construct(obj)
{
obj.model.on=true;
obj.model.name='Gatsi';
obj.model.lit=DIM3_MODEL_LIT_VERTEX;
obj.model.shadow.on=true;
obj.model.shadow.alwaysInAir=true;
obj.setting.damage=true;
obj.setting.invincible=false;
obj.setting.turnOnlyWhenMoving=false;
obj.setting.restrictPlayerTurning=true;
obj.setting.quickReverse=false;
obj.setting.sideStep=false;
obj.setting.singleSpeed=true;
obj.setting.bumpUp=true;
obj.setting.ignorePickUpItems=true;
obj.setting.find=false;
obj.size.x=2800;
obj.size.z=5600;
obj.size.y=1900;
obj.size.weight=2000;
obj.rigidBody.on=true;
obj.vehicle.on=true;
obj.turnSpeed.facingWalk=1.5;
obj.turnSpeed.motionWalk=0.6;
obj.turnSpeed.facingAir=3;
obj.turnSpeed.motionAir=3;
obj.forwardSpeed.walk=250;
obj.forwardSpeed.acceleration=0.5;
obj.forwardSpeed.deceleration=1.75;
obj.forwardSpeed.accelerationAir=0.4;
obj.forwardSpeed.decelerationAir=0.6;
obj.objectSpeed.bounceFactor=0.5;
obj.objectSpeed.bumpHeight=500;
obj.look.upAngle=5;
obj.look.downAngle=45;
lastCrashTick=0;
lastAngleY=0;
smokeCount=0;
damageLevel=0;
lastDamageTick=0;
obj.look.effectWeapons=true;
obj.health.start=500;
obj.health.maximum=500;
obj.weapon.add('Gatsi Push Power');
}
function Animation(obj,subEvent)
{
switch (subEvent) {
case DIM3_EVENT_ANIMATION_OBJECT_STOP:
obj.model.animation.change('On');
return;
case DIM3_EVENT_ANIMATION_OBJECT_WALK:
obj.model.animation.change('On');
return;
case DIM3_EVENT_ANIMATION_OBJECT_WALK_BACK:
obj.model.animation.change('On');
return;
}
}
function Enter(obj)
{
obj.setting.find=true;
camera.state.save();
obj.model.animation.startThenChange('SwitchOn','On');
obj.setting.fly=true;
camera.setting.type=DIM3_CAMERA_TYPE_CHASE;
camera.chase.distance=10500;
camera.chase.trackSpeed=0.1;
camera.chaseAngle.x=0;
camera.chaseAngle.y=0;
camera.chaseAngle.z=0;
camera.chaseSlop.y=25;
}
function Exit(obj)
{
obj.setting.find=false;
camera.state.restore();
obj.model.animation.startThenChange('SwitchOff','Off');
}
function EnterOrExit(obj,subEvent)
{
switch (subEvent) {
case DIM3_EVENT_VEHICLE_ENTER:
Enter(obj);
break;
case DIM3_EVENT_VEHICLE_EXIT:
Exit(obj);
break;
}
}
function Collide(obj,tick)
{
if (!obj.status.moving) return;
if (tick>lastCrashTick) {
sound.play("Crash",obj.position.x,obj.position.z,obj.position.y,0.7);
lastCrashTick=tick+800;
}
}
function Damage(obj,tick)
{
var health;
health=obj.health.current;
if (health<=0) return;
}
function Die(obj)
{
obj.setting.find=false;
obj.setting.contact=false;
obj.model.on=false;
camera.state.restore();
obj.model.animation.start('Die');
}
function Fire(obj,subEvent)
{
if ((subEvent!=DIM3_EVENT_WEAPON_FIRE_DOWN) && (subEvent!=DIM3_EVENT_WEAPON_FIRE_REPEAT)) {
weap.fire.cancel();
return;
}
weap.model.animation.startThenChange('Fire','On');
obj.weapon.fire('Gatsi Push Power',0);
}
function event(obj,mainEvent,subEvent,id,tick)
{
switch (mainEvent) {
case DIM3_EVENT_CONSTRUCT:
Construct(obj);
return;
case DIM3_EVENT_SPAWN:
obj.model.animation.start("Off");
return;
case DIM3_EVENT_COLLIDE:
Collide(obj,tick);
Damage(obj,tick);
return;
case DIM3_EVENT_DAMAGE:
Damage(obj,tick);
return;
case DIM3_EVENT_DIE:
Die(obj);
return;
case DIM3_EVENT_TOUCH:
Collide(obj,tick);
return;
case DIM3_EVENT_ANIMATION_OBJECT:
Animation(obj,subEvent);
return;
case DIM3_EVENT_VEHICLE:
EnterOrExit(obj,subEvent);
return;
case DIM3_EVENT_WEAPON_FIRE:
Fire(obj,subEvent);
return;
}
}
?
, is there any ERRORS in the console when you start the map (and the object gets loaded) or when you FIRE?