I was able to figure out how by throwing in a bunch of code that got them to behave, except they refuse to fight attacking peds while in a vehicle. Not sure on that one. I thought of supplying a task to fight during driveby but no task exists that i am aware of...
This is my class function that sets up followers
public void Assign(int index, RPGState state)
{
if(index == RPGPlayerIndex)
{
RPGPlayer = Game.Player.Character;
Character[index].Body = Game.Player.Character;
}
if(index < RPGPlayerCount)
{
if(state < RPGState.NONE) Function.Call(Hash.CLEAR_PED_TASKS_IMMEDIATELY, Character[index].Body);
if(index != RPGPlayerIndex && state == RPGState.FOLLOW && Character[index].Type == RPGType.AMBIENT)
{
Function.Call(Hash.SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, Character[index].Body, true);
Function.Call(Hash.TASK_COMBAT_HATED_TARGETS_AROUND_PED, Character[index].Body, 150.0f, 0);
}
else if(index != RPGPlayerIndex && state == RPGState.NOFOLLOW && Character[index].Type == RPGType.AMBIENT)
{
Function.Call(Hash.SET_BLOCKING_OF_NON_TEMPORARY_EVENTS, Character[index].Body, false);
}
if(state == RPGState.FOLLOW)
{
Function.Call(Hash.REMOVE_PED_FROM_GROUP, Character[index].Body);
Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, Character[index].Body, intGangPlayer);
}
else if(state == RPGState.NOFOLLOW)
{
Function.Call(Hash.REMOVE_PED_FROM_GROUP, Character[index].Body);
Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, Character[index].Body, intGangVagos);
}
Function.Call(Hash.SET_PED_RELATIONSHIP_GROUP_HASH, Character[index].Body, intGangVagos);
Function.Call(Hash.SET_PED_RELATIONSHIP_GROUP_HASH, Character[index].Body, intGangPlayer);
Function.Call(Hash.SET_RELATIONSHIP_BETWEEN_GROUPS, 0, intGangPlayer, intGangVagos);
Function.Call(Hash.SET_RELATIONSHIP_BETWEEN_GROUPS, 0, intGangVagos, intGangPlayer);
Function.Call(Hash.SET_PED_FLEE_ATTRIBUTES, Character[index].Body, 0, 0); // NEVER FLEE
Function.Call(Hash.SET_PED_COMBAT_ABILITY, Character[index].Body, 100);
Function.Call(Hash.SET_PED_COMBAT_RANGE, Character[index].Body, 2);
Function.Call(Hash.SET_PED_COMBAT_MOVEMENT, Character[index].Body, 2);
Function.Call(Hash.SET_PED_COMBAT_ATTRIBUTES, Character[index].Body, 46, true);
Function.Call(Hash.SET_PED_CAN_SWITCH_WEAPON, Character[index].Body, true);
Function.Call(Hash.SET_ENTITY_INVINCIBLE, Character[index].Body, true);
Character[index].Companion = state;
Character[index].Map.Position = Character[index].Body.Position;
Function.Call(Hash.SET_BLIP_ALPHA, Character[index].Map, 255);
}
}
I think peds are just too stupid to fight while in a vehicle haha. I spawn freemode type peds and they blast anything that moves with this code regardless where they are. I thought of maybe just deleting all the dumb peds in the world and make them all freemode for gangs. Probably too much work though & might crash the game with too many spawned peds.