PDA

View Full Version : [CODUO] Vehicle turrets not playing camera bobbing



keso
2nd January 2017, 02:21
Hi

I came across an issue the other day where vehicle turrets in united offensive only plays fire animation (not sure if anim, could also just be camera tweaks) after the turret is overheated. (See video below)

https://youtu.be/d56SxnkHtXM

Some sort of function needs to be called upon mounting the turret and I'm completely clueless.

Here's the full script which handles jeep driving and the turret.

http://pastebin.com/raw/1QKxf0Yf

This is the only interesting code I can find in there and half of the functions I cant find any reference to..



Code below is called from "delayed_process_activate( vehpos, activator )" like so:

else if (vehpos == 2) //Vehicle position 2 is gunner
{
self.gunner = activator;
self thread player_shoot_gunner();
}


hud_overheat_run(activator, overheat)
{
self endon("death");
activator endon("death");
activator endon("stop_tank_hud");

minheight = 0;
max_width = 126;

while(1)
{
wait (0.1);
if ( !isAlive(self) || !isDefined(overheat) )
continue;

if ( activator.vehpos == 1)
{
heat = self getaltheat();
overheating = self getaltoverheating();
}
else
{
heat = self getgunnerheat();
overheating = self getgunneroverheating();

}

if ( overheating )
{
overheat.color = ( 1.0, 0.0, 0.0);
}
else
{
overheat.color = ( 1.0, 1.0-heat,1.0-heat);
}

hud_width = (1.0 - heat) * max_width;

if ( hud_width < 1 )
hud_width = 1;

overheat setShader(level.tank_hud_bar, hud_width, 5);
}
}

player_shoot_gunner()
{
self notify("kill_existing_player_shoot_gunner");
self endon("kill_existing_player_shoot_gunner");
while(self.health > 0)
{
self waittill( "turret_gunner_fire" );
self fire_gunner();
}
}

fire_gunner()
{
if(self.health <= 0)
return;

if(level.ceasefire == 2)
return;

// fire the turret
self FireGunner();
}


Also tried adding fire/idle anim to weapon file "50cal_tank_mp" (Which is the turret used for "willyjeep_mp") with no luck.

Same issue with all vehicle turrets.

Any ideas?

Thanks //Keso

serthy
2nd January 2017, 17:01
This looks like the anim at first plays only the same 2 viewkicks over and over again, and after overheating it plays random viewkicks (as its supposed to be).
I did a quick scan over your script, but couldn't find anything that might cause this (also im not familar with cod:uo).

Where did you get this script from (original cod:uo script or did you put it together yourself)?
Does it work when you disable/comment-out the overheat functionality at all?
Maybe it is an issue with conflicting notify/waittills? (just a wild guess)

keso
2nd January 2017, 19:19
This looks like the anim at first plays only the same 2 viewkicks over and over again, and after overheating it plays random viewkicks (as its supposed to be).
I did a quick scan over your script, but couldn't find anything that might cause this (also im not familar with cod:uo).

Where did you get this script from (original cod:uo script or did you put it together yourself)?
Does it work when you disable/comment-out the overheat functionality at all?
Maybe it is an issue with conflicting notify/waittills? (just a wild guess)

this is an official UO script. Yes everything works when removing anything regarding heat.