can actors walk
#1

can actors walk? the reason of the question will it ever be possible atleast any time soon or is it already that you can

have pedestrians like in single player

im assuming actors are like less advanced bots and are going to replace like shop cashiers
Reply
#2

Technically, yes. But it will take some advanced coding, math, and pre-defined paths to get there sync right.
Reply
#3

may i get an idea of how to do it i find nothing for actors

im also having another problem thats pissing me off

im gettin tag mismatch onplayergivedamageactor i just copied the code from samp wiki

Код:
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart)
{
    new string[128], attacker[MAX_PLAYER_NAME];
    new weaponname[24];
    GetPlayerName(playerid, attacker, sizeof (attacker));
    GetWeaponName(weaponid, weaponname, sizeof (weaponname));
 
    format(string, sizeof(string), "%s has made %.0f damage to actor id %d, weapon: %s", attacker, amount, damaged_actorid, weaponname);
    SendClientMessageToAll(0xFFFFFFFF, string);
 
    if(!IsActorInvulnerable(damaged_actorid)) //Check if actor is vulnerable
    {
        new Float:health;
        GetActorHealth(damaged_actorid, health); //Get current health
        SetActorHealth(damaged_actorid, health-amount); //Apply damage, set new health
    }
    return 1;
}
source of code: https://sampwiki.blast.hk/wiki/OnPlayerGiveDamageActor

error and warnings

error 035: argument type mismatch (argument 2)
warning 213: tag mismatch
warning 213: tag mismatch

on these lines

GetActorHealth(damaged_actorid, health); //Get current health
SetActorHealth(damaged_actorid, health-amount); //Apply damage, set new health


what am i doing wrong i already got an actor in there
Reply
#4

I don't get any mismatch warning, that's odd.
Reply
#5

in real life they can
Reply
#6

yes, use a walking anim on them, set their z rotation when needed etc
Reply
#7

ok i read a bunch of junk about set there position and make them walk

how to make them walk using animations and set player position what would i need lots of timers

i planned on putting around like 200 actors walking around if it dont act up on my gamemode

can someone give me like a template of an actor walking in a straight line or something

then i can get the idea and get started
Reply
#8

You clearly don't understand what I said before, "it will take some advanced coding, math, and pre-defined paths."

You can't just play an animation and set their position accordingly. In fact, when an animation is controlling their position you can't even get their correct position, that's where the math and pre-defined paths come in. Plus, if you don't use predefined paths or something like the pathfinder plugin you're going to have to deal with them dealing with their own collisions. They are not like NPC's when it comes to going through objects. They go AROUND the object so it'll really hard to know where they are going to be.
Reply
#9

Quote:
Originally Posted by Crayder
Посмотреть сообщение
You clearly don't understand what I said before, "it will take some advanced coding, math, and pre-defined paths."
i understood you loud and clear it sounds like a challenge but im not retarded so i think i can do it

where would i start all i see on all the post is the same old bullshit " IT WILL TAKE ADVANCED CODING"

that answer does not help even a little bit my 5 year old sister could have told me that answer
Reply
#10

Quote:
Originally Posted by PSYCHOBABYKILLA
Посмотреть сообщение
can someone give me like a template of an actor walking in a straight line or something

then i can get the idea and get started
Alright, something like this is what you're looking for?

P.S Check older betas!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)