Nextbot Model Animation Issues, and weapon firing placement issues.
0 replies, posted
Two problems
1 -
I have a Sentry nextbox who will stand still and shoot and enemies, works fine and dandy, but the models I use have some issues, the animations they use are very crappy for what I need. The models are all the hl2 swat models such as "models/player/riot.mdl" ect. I only need 3 different animations, an idle, for when he stands still before recruitment and during watches, an animation for following the recruiter until they have chose a spot for them to watch, this one I have down, and the last one, which poses the greatest issue, the firing animation, the model has a "firing animation" but it is just a standing aim idle animation, and there is no recoil. The animations in order of listed above are as follows:
ACT_HL2MP_IDLE
ACT_RUN
ACT_HL2MP_IDLE_SHOTGUN
If anyone knows what animations I can use, please, leave them below, I have tried nearly every animation in the activity list from valve.
2 -
Second problem, the shotgun weapon he uses is not firing bullets from the correct position.
I am using the FireBullet structure, with Src (position) as this:
bullet.Src = self:WorldSpaceCenter() + Vector(0,-2,1.3)
However, this does not change the position the bullets fire from, I can tell because the tracer starting location, it does not make any difference.
Here is the code to fire:
function ENT:FireWeapon()
if (!self.Shooting) and self.Target:Health() > 0 and self:Visible(self.Target) and IsValid(self.Target) then
local angle = self.Target:GetPos() - self:GetPos() + Vector(0,0,-10)
self.Shooting = true
self:MuzzleFlash()
local bullet = {}
bullet.Num = 10
bullet.Src = self:WorldSpaceCenter() + Vector(0,-2,1.3)
bullet.Dir = angle:GetNormalized()
bullet.Spread = Vector( .1 , .2 , .2)
bullet.Force = 10
bullet.Damage = 4
bullet.AmmoType = "Buckshot"
bullet.Tracer = 1
bullet.Callback = function( attacker, tr, dmginfo )
dmginfo:SetDamageType( DMG_BULLET )
end
self:EmitSound( Sound( "weapons/shotgun/shotgun_fire6.wav" ), 75, 100, .5, CHAN_AUTO )
timer.Simple(math.random(.5,1.5), function()
self.Shooting = false
end)
self:FireBullets( bullet )
elseif !IsValid(self.Target) then
self.loco:SetDesiredSpeed(self.RunSpeedHeavy)
self:StartActivity(SwatRunAnim)
self:FollowRecruiter()
end
end
Thanks for any help.
Sorry, you need to Log In to post a reply to this thread.