Jump to content

Change default animation from slothbot when they're chasing


Recommended Posts

Posted

Hello guys,

Can I change default animation of slothbot when they (bots) are chasing? I mean: by default, the bots walks normally. Since I'm using it on a zombie server, I would like to change it to WALK_drunk animation.

Tried to learn the slothboth's code, but didn't find anything.

Thanks a lot,

Stanley Sathler.

Posted

Well it needs a slight rewrite, as it doesn't use animations currently, only control states. Someone may have already changed it and might share that code.

Posted

Yo guys,

Didn't know about setPedWalkingStyle() (never heard about before). I'm trying to insert it into the code, but doesn't work properly yet. When the ped (zombie) starts to follow us, on the first second, the animation works, but then changes to normal again. Seems the code is "refreshing" the animation.

Maybe I could use a setTimer(), but I'm trying to use the function just one time first. Any idea?

By the way, if I get something, I'll back to tell you guys.

Posted

I made some zombies with it and it worked just fine.

use a timer to set the walking style.

Example : when the ped is created setTimer(setPedWalkingStyle, 2000, 1, thePed, the ID)

Posted

That's the problem: where? Already tried to add it into the spawn function, including with a tmer, but nothing happens. I'm still having the problem with "refresh" walk animation.

Manawydan, did you try? Where you put the function?

I already tried to insert it in a lot of functions, and nothing. I really don't know what is happening.

  • MTA Team
Posted

I have the same problem, it starts walking as it should, then it changes back to normal. Not sure, but maybe a MTA bug.

Posted

try change the event:

addEvent( "bot_Forwards", true ) 
function Bforward () 
    if (isElement(source)) then 
        setPedControlState( source, "forwards", true ) 
    end 
end 
addEventHandler( "bot_Forwards", getRootElement(), Bforward ) 

instead setPedControlState try put setPedAnimation(source,arguments..)

and in :

addEvent( "bot_Stop", true ) 
function Bstop ( ) 
    if (isElement(source)) then 
        setPedControlState( source, "forwards", false ) 
    end 
end 
addEventHandler( "bot_Stop", getRootElement(), Bstop ) 

try this:

addEvent( "bot_Stop", true ) 
function Bstop ( ) 
    if (isElement(source)) then 
        setPedControlState( source, "forwards", false ) 
setPedAnimation(source) 
    end 
end 
addEventHandler( "bot_Stop", getRootElement(), Bstop ) 

Posted

We're almost there, manawydan. What occurs at the moment: when they spawn, they're with animation. If you punch them, the animation is stopped and they starts to walk normally again. Also, they don't attack us too when they're with animation.

I'll see what I can do about this. Don't want to bother you again, cannot make you read all the code for help me with one thing that I can do by myself (read code). You gave me the first step. Thank you alot. Not only you, but also Blaze, Masry and Buffalo.

Posted

Ok guyz, I figured this. It's realy easy!

Go to zombie_server.lua

Replace line 6 - 18 with this:

  
if ZombieSpeed == 0 then --super slow zombies (goofy looking) 
    chaseanim = "WALK_drunk" 
    checkspeed = 2000 
elseif ZombieSpeed == 1 then -- normal speed 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
elseif ZombieSpeed == 2 then -- rocket zombies (possibly stressful on server) 
    chaseanim = "WALK_drunk" 
    checkspeed = 680 
else -- defaults back to normal 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
end 
  

  • MTA Team
Posted
Ok guyz, I figured this. It's realy easy!

Go to zombie_server.lua

Replace line 6 - 18 with this:

  
if ZombieSpeed == 0 then --super slow zombies (goofy looking) 
    chaseanim = "WALK_drunk" 
    checkspeed = 2000 
elseif ZombieSpeed == 1 then -- normal speed 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
elseif ZombieSpeed == 2 then -- rocket zombies (possibly stressful on server) 
    chaseanim = "WALK_drunk" 
    checkspeed = 680 
else -- defaults back to normal 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
end 
  

Did you even read the first post? SLOTHBOT, not ZOMBIES resource.

Posted

Anubhav, you're almost right: yes, I'm trying to modify a DayZ resource. However, use your code won't work properly.

Chaseanim was declared, but where it will be used? There is not any occurrence of chaseanim in my zombies.lua.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...