Character Occupations

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Post Reply
CarThief
Hitman
Hitman
Posts: 108
Joined: 19 May 2012, 18:12
GH nick: CarThief
Location: Holland, AKA The Netherlands

Character Occupations

Post by CarThief »

So in a mission i made i basically tried to toggle a stand-still ped that throws grenades/molotovs into one that acts normally and pursues player with a normal weapon. While trying to do so i encountered various little weird... details of sorts while changing objectives.
It would seem peds assigned as CRIMINAL who perform GUARD_SPOT while attacking the player on sight with throwables does not work very well, with Molotovs atleast. But once i changed them into STAND_STILL_BLOKEs, it worked just fine. Untill i wanted them to switch to attacking normally with a gun, then they had to be CRIMINAL again in order for it to work.

So yeah, i noticed that character occupations can go quite deep in how they affect various objectives given to them, and other internal behaviours. Might as well share what i noticed so far.
STAND_STILL_BLOKE: Only one observed able to throw molotovs properly. Can move despite name, though may refuse to move if told to stay still with stuff like GUARD_SPOT/AREA untill occupation is changed. Seen to be using a Pistol when approached too closely to throw at the target. Might crash game when used with KILL_CHAR_ANY_MEANS and similar objectives, best to change their occupation first before doing such. Does use patrol points correctly.
FBI: Prioritizes pulling victim out of car before firing. Rarely ever seen firing on their target when they are in a car, though it may happen rarely when doors are inaccesible and they stop moving around that much. Does not gain extra armor unlike the non-scripted FBI agents the game spawns at Wanted Level 5 which do get that armor.
SWAT: Nothing special found yet. Attacks targets in cars rather then pulling them out; this seems to be the norm for most occupations when dealing with vehicles. Does not gain extra armor like non-scripted SWAT's.
POLICE: Observed to use melee when close enough to his target automatically, though the cop might handle weapons other then the Pistol poorly because of it. During KILL_CHAR_ON_FOOT or _ANY_MEANS will always attempt to pull the target out of their car. If the target is on foot during this command they will only fire from range if other cops are actively attempting to attack the player (only tested with game-spawned cops so far), if there is no assistance they will try and punch you instead. Doesnt gain any armor/health on higher Wanted Levels either.
PSYCHO: Doesnt seem to do anything special. Normal behaviour towards cars.
CRIMINAL: Nothing special. Same as above.
CRIMINAL_TYPE1 and TYPE2: Type 1 and 2 attack eachother on sight, as if they where affiliated to different gangs, as far as i recall. Aside from that they act identical to CRIMINAL.
DUMMY: Nothing special noted. I recall they get used alot in the official missions, perhaps? Probaly also uses default car-attacking behaviour.
TANK_DRIVER: Nothing special either, i think. Perhaps the game uses this for the tanks that drive around during Wanted Level 6 which are not part of road blocks and will not fire at you.
ROAD_BLOCK_TANK_MAN: Automatically shoots nearest player when placed in a tank, without any extra input. Crashes the game if put into anything that isnt an Tank.
ELVIS and ELVIS_LEADER: Makes elvis noises. When 6 are killed of any setup (aka 3 ELVIS and 3 ELVIS_LEADER, for example), it will trigger the 'ELVIS HAS LEFT THE BUILDING!' bonus. Works with any setup as long as 6 are killed in a fast enough time. They flee a bit faster then the player can run. Untested if they can also run faster to engage in combat instead.
GUARD: Nothing special noted.
GUARD_AGAINST_PLAYER: Can hurt other peds of the same occupation unlike GUARD.
ARMY: Nothing special observed. Assumed to be more agressive, though. Attacks cars rather then pulling the target out, i think.
SPECIAL_GROUP_MEMBER: No clue if this does anything...
DRONE: Not tested. Probaly does nothing special though. Perhaps identical to DUMMY?
CARTHIEF: A ped assigned this occupation with MAKE_CHAR_DO_NOTHING will actually walk about and steal cars!
MUGGER: Never seems to actually attempt to mug anyone.
BANK_ROBBER: Probaly nothing special for this one.
REFUGEE: Same as above.
FIREMAN: Might be for bonus checks only. Unlikely that they will attempt to extinguish fires, as i believe they accuire a target to extinguish on spawn(aka when player blows up a vehicle), and if they somehow miss or never reach that target they will probaly just move on.
DRIVER: Probaly has no special use either, as most likely all dummy cars use DUMMY drivers?
Perhaps anyone else also want to test out various occupations in combination with various objectives, or lack thereof(aka making a mugger with the 'objective' of wandering around being a dummy/doing nothing)?
I'll gladly update the list if anyone else has findings or if i find something.

Edit: On a side note, i did notice grenades thrown by enemy peds seem to explode just fine but the explosion itself acts like it never existed, no pushing force, no damage(didnt test that yet, tend to keep invul on). Though when you're above the grenade thrower, like on a box, the explosion does suddenly seem to push you away. Doesnt seem to work that way downwards though, i think.
Last edited by CarThief on 05 Apr 2013, 20:06, edited 4 times in total.
Galactic Boy
Immortal
Posts: 334
Joined: 15 Apr 2012, 08:26

Re: Character Occupations

Post by Galactic Boy »

Characters who have GUARD_AGAINST_PLAYER occupation can kill other characters who have GUARD_AGAINST_PLAYER occupation. But GUARDs can't. Only one difference between these is this.
User avatar
Pyro
Immortal
Posts: 414
Joined: 17 Mar 2010, 04:07
GH nick: Pyro
Location: Wales, UK

Re: Character Occupations

Post by Pyro »

The ROAD_BLOCK_TANK_MAN (RBTM) will, if put inside a tank, will automatically fire at the player when they get close to the tank without having to set other commands like if the character can see a player, use a tank weapon etc. Not being in a tank I believe RBTM will not do anything else.

Edit - RBTM, if placed in a tank normally that you created, will try and shoot the player from MILES away. Best way around this is to do a check to see if a parked tank is on-screen and then create a character inside the tank with the RBTM profession. You can see this in 3rd city official mission MIS file infiltrating the army base.

Vike managed to get this to work in multiplayer a while back now and I believe RBTM will shoot at the closest player to the character/tank.; again no need to update scripts with various checks.

You may have come across when testing FBI and SWAT occupations that they do not gain the extra health/armour like normally spawned ones do. I believe I posted about this in the GTA2 bugs thread, can't remember! In case you don't know, I have a tutorial on character AI on Ben's website which lists these, but some of the stuff you've found and tested could prove a useful update to it as well!
CarThief
Hitman
Hitman
Posts: 108
Joined: 19 May 2012, 18:12
GH nick: CarThief
Location: Holland, AKA The Netherlands

Re: Character Occupations

Post by CarThief »

Ah, thats quite handy to know! I wonder, does the Road block guy also attempt this when inside another non-tank vehicle that has a Water Cannon or rotating Machine Gun? Should probaly test that out.
Hm, would have been a nice option if spawning characters with these occupations would grant them extra bullet/shotgun armor. Perhaps Vike can enable that somehow?

In any case i've updated the list to reflect these findings.
Edit: Apparently script-made elvis people also run away faster then the player can run, though not by alot. Wonder if this holds up when they're chasing the player for any reason as well, instead of just running away from combat/gunfire. And it turns out putting the Road block guy in non-tank cars with a weapon crashes the game. Dont know if it does the same with a normal car, but i suppose it doesnt really matter as one could pick any other occupation for driving a car.
User avatar
Pyro
Immortal
Posts: 414
Joined: 17 Mar 2010, 04:07
GH nick: Pyro
Location: Wales, UK

Re: Character Occupations

Post by Pyro »

If I remember, script-made Elvis guys also make the Elvis impersonations as well! Like you've listed, if you make an Elvis guy and attach a group and you kill them all you get 'Elvis has left the building!'

Just for fun, if you check the Jailbreak map that Ben and I were working on before, look at the prison 'showers' with the nudies there (set as Elvis occupation) singing in the shower!
Devastator
Hitman
Hitman
Posts: 120
Joined: 06 Dec 2011, 16:54

Re: Character Occupations

Post by Devastator »

So I tested it out, created some Law Enforcement characters that had NO_OBJ(ectives).

Attacking in front of any of these guys gives you a wanted level, however none of them will arrest you, they'll always kill you, even an unarmed cop.
Anyone tagged police, even if given a gun, never seemed to fire at me. Not even when I was driving away. I was hoping you could create an unarmed melee combatant that would fire at you when you drove away with this, but to no avail. This could be useful for creating melee attackers that drop ammo however, because they will drop whatever gun you give them.

It looked like there may be a marginal difference with the distance an army man will start firing at you versus a SWAT officer. SWAT seem to prefer getting a little closer initially. However once they start firing they will hold their position until you are out of range.

Scripted FBI guys will always get within half a block's distance before firing at you. If you run away they will stop firing until they are within half a block's range again. (Give them Dual Pistols for maximum shredding power :twisted: )

I'll attach a pic I made contrasting the different firing distances. Green for army, yellow for swat, black for FBI.

It's funny, I don't know that I've gotten the Mugger occupation to work as normal, but I've created characters designated mugger that I then add a group to, & when I come across the characters on the map the group leader will- if the group is a mob- will be running in circles punching each group member indivually screaming "Gimme your wallet" while the other guy cries "Somebody Help!" while he takes it. A funny thing happened once when the entire city was rioting, a Group leader accidentally set a member on fire with his flame thrower in the commotion. They all had 1950 health. So it took forever for the guy to burn. The leader was running after him, I thought maybe to regroup. But once the guy ended up in a corner the group leader started mugging him, while he was on fire :lol:

If the group is set to chain, the group leader will mug each member down the line while they all stand very still. I like to imagine he's "disciplining" his cohorts.

EDIT: So anyone assigned Mugger may not mug random peds like randomly generated Muggers do, however, they will Mug people they see attacking in the area or who attacked them. With this, you could create a Mob of muggers who could decimate your wallet in seconds, because when they punch you it doesn't take health from you.
Attachments
LEOs.png
LEOs.png (254.89 KiB) Viewed 22846 times
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Character Occupations

Post by elypter »

Devastator wrote:So anyone assigned Mugger may not mug random peds like randomly generated Muggers do, however, they will Mug people they see attacking in the area or who attacked them. With this, you could create a Mob of muggers who could decimate your wallet in seconds, because when they punch you it doesn't take health from you.
that could be a funny multiplayer minigame. everyone gets cash and has to go through a labyrinth filled with muggers. the one with the most money at the finish line wins
yur sa'nok ngeyä
Devastator
Hitman
Hitman
Posts: 120
Joined: 06 Dec 2011, 16:54

Re: Character Occupations

Post by Devastator »

If you set a mugger to Kill the player, you can trigger an event with IS OBJECTIVE PASSED for the mugger, because the mugger doesn't actually kill the player, but the game thinks he does after he's punched you four or five times.
Devastator
Hitman
Hitman
Posts: 120
Joined: 06 Dec 2011, 16:54

Re: Character Occupations

Post by Devastator »

It seems like Characters will ignore Law Enforcement occupations (giving you a wanted level anyway) if they're added to a gang (at least a gang that hates you). Also if they have an objective like kill player they'll ignore giving you a wanted level from what it seems. So this could be used to set a preference for a character's attacking distance.
Devastator
Hitman
Hitman
Posts: 120
Joined: 06 Dec 2011, 16:54

Re: Character Occupations

Post by Devastator »

I noticed something neat with anyone with the police occupation: They'll alternate between punching & shooting you. It seems if you're running far enough away on foot they'll start shooting, & will continue to shoot when you get close. But I think when you come to a complete stop they'll try to punch you again.

EDIT: It's cool, if you give them a weapon other than a pistol they can alternate between that & the pistol. They'll use a pistol on non player characters & on you when you're in a car. When they stop firing seems to be sporadic. With a machinegun they fire in bursts. With a rocket launcher it's pretty entertaining, they'll sometimes alternate between the RL & the pistol. & this is different than the distance check of most scripted characters with a Rocket launcher. It's funny having a guy coming to punch you immediately after firing a rocket at you.
Devastator
Hitman
Hitman
Posts: 120
Joined: 06 Dec 2011, 16:54

Re: Character Occupations

Post by Devastator »

An odd thing happened, a dummy cop & a scripted cop both killed a mugger at the same time but accidentally punched each other, so they ended up fighting. The dummy cop kept knocking the scripted cop to the ground. I teleported elsewhere to despawn all dummy peds & when I came back the scripted cop was now speed walking towards a frightened ped exactly like muggers do. Homing in on the target. I went to punch the ped to confirm if this was indeed what was happening but I accidentally equipped grenades & got a wanted level, making the scripted cop come after me.

Now I know from my use of the CHECK_CHAR_BEEN_PUNCHED_BY expression that characters "Store" the punch in their targets. If you set your weapons to be removed(or make the player naked, or walk slow) by a certain character if they punch you, as soon as they punch someone else that "punch data" is transferred from you to them, restoring whatever status you had before being punched.

This makes me wonder if the dummy cop some how transferred the mugger data to the scripted character, changing his occupation from a cop to a mugger until I got a wanted level. I've been trying to duplicate it but it's really hard to duplicate.
User avatar
_L1pE_
Car Jacker
Car Jacker
Posts: 26
Joined: 08 Jan 2015, 15:02
GH nick: _L1pE_

Re: Character Occupations

Post by _L1pE_ »

Was testing some stuff and I made some observations on general AI behavior that is exclusive to natural spawns and can't be done via scripting:

Roadblock cops will always fire their pistol at you when you're in a car, regardless of how close they are to your door, they will pursue and try to punch when you're on foot but will immediately stop and open fire at you the moment you get in a car. If you move out of their range while in a car they will walk back to their spawn spot at the roadblock.

One specific member of a SWAT squad will try to pull you out of a car while the rest merely fire at you, he will refuse to shoot while doing that. If that member dies, another one will take up the role of pulling you out.

The shotgun FBI will use a secondary silenced MG on the run and at any moment you're outside his shotgun's range, and if his partner is dead he might decide to stand his ground at times to shoot and might slowly walk around while shooting too.

Roadblock FBI will immediately rush out of their blockade to try to pull you out of a car if you're in one, but will stand their ground and open fire from where they are when you're on foot. They will also not pursue at all when you're on foot, and once you're out of range they will walk to their spawn spots at the roadblock, kinda the opposite of roadblock cops.

Perhaps these exclusive behaviors could be replicated in scripting with the use of memory writing but I personally have no idea how to find that out.

Also, one scripting related detail: the behavior of most occupations that usually hold their ground to shoot will change when they're part of a group, they will prefer to shoot on the run and get closer to their target then.

EDIT: Another one I had forgotten to mention: if you have members of a group with different weapons, if the leader dies, the one that inherits leadership will change his weapon to the one the leader had.
Let's go for a joyride
Post Reply