Jump to content

Calling a "Fearless" enemy Ped


motorsport71

Recommended Posts

motorsport71

I have tried EVERYTHING i can possibly think of to get a fearless ped. I don't want to get into the "Ambient" and "Shocking Events" files because i want my mod to be a stand alone .net script, as well as not affect all the public peds. The bummer of it all is the mod is just about complete... except i can't keep the enemies from running away at gunfire. I have tried EVERY relationshipgroup combination, turning the peds into "relationshipgroup = relationshipgroup.cop" and using pedflag "policeofficer" and giving myself stars, everything, but they still run under gunfire or at the sight of a gun.

 

The bottom line is I need to get my enemy peds not run at the sight of or during gunfire. The other enemy peds in the vecinity need to be immune as well once called since i'm using World.GetPeds. I CANNOT find anything in the forums of how anyone has configured them not to do that (doesn't mean i just didn't find it smile.gif )

 

Here is as it sits now, where i have decided to ask for help. I also don't want to use "BecomeMissionCharacter()" if at all possible.

 

 

 'ped.BecomeMissionCharacter()               ped.cancelambientspeech()               'ped.task.AlwaysKeepTask = True               ped.weapons.removeall()               pedflag = pedflag.onfoot               pedflag = pedflag.watchfight               pedflag = pedflag.murderattack               ped.enemy = True               ped.SetPathfinding(True, True, True)               'ped.WillUseCarsInCombat = True               ped.senserange = 10.0               ped.Accuracy = 100               ped.Health = 100               Ped.WantedByPolice = True               'pedflag = pedflag.criminal               'pedflag = pedflag.policeofficer               ped.relationshipgroup = relationshipgroup.Civillian_male               'ped.ChangeRelationship(relationshipgroup.Civillian_male, relationship.companion)               'ped.ChangeRelationship(relationshipgroup.player, relationship.hate)               'ped.ChangeRelationship(relationshipgroup.fireman, relationship.hate)               'ped.ChangeRelationship(relationshipgroup.medic, relationship.Hate)               'ped.ChangeRelationship(relationshipgroup.dealer, relationship.Hate)               'ped.ChangeRelationship(relationshipgroup.cop, relationship.hate)               'ped.ChangeRelationship(relationshipgroup.criminal, relationship.hate)               'ped.ChangeRelationship(relationshipgroup.Civillian_Female, relationship.Hate)               'ped.startkillingspree(alsoAttackPlayer:=False)               'ped.task.FightAgainstHatedTargets(30.0F)               ped.task.fightagainst(player)               Dim blip As blip = blip.addblip(ped)               blip.color = blipcolor.yellow               ped.Weapons.unarmed.Ammo = 99999

 

Link to comment
Share on other sites

iriedreadlock23

You have to give him reason to fight you. That's how engine works. Make him your enemy by setting his relationship with player to Hate. Don't expect peds to run on bullets with bare hands like Chuck Norris. Give him gun or bat to see him respond to gunfire. And set his combat tasks to repeat. To make him fight better, you'll have to use your imagination.

 

 

yourped.ChangeRelationship(RelationshipGroup.Player,Relationship.Hate)

 

 

 

Link to comment
Share on other sites

motorsport71

It's not a problem of wanting them to fight me. As you pointed out relationship.hate changes that for you, as well as to whether they have a weapon. I've used all my imagination within the boundries of my knowledgebase, which i wish was much more extensive smile.gif

I am specifically calling all CivMales that ARE NOT bums, dealers, fireman, cops, medics, or of player relationships. The CivMales are set as companions and, IN MASS, are attacking EVERYBODY! It is awesome, and it is like a scene from 28 days later or a fast moving Zombie movie. In a group of 5 - 10 they will chase a civillian, and in mid chase 2-3 of them may vere off to chase another. It's great. My "Infected" Peds gain health as they live longer so they I made a modifer making the melee weapons kill them faster, but also fire bullets can be equipped for the SMG and the SNIPER RIFLE. Peds in traffic are in a hurry to leave town, cars are driving out of control, pile ups everywhere, nobody paying attention to traffic signals. I have cars breaking down in traffic and people dying randomly behind the wheel. It's a SURVIVAL MOD and all i am trying to do is make my infected also attack me AND not be afraid of Guns or Gunfire.

 

The closest i came was aligning my relationship to them as a companion. They wouldn't run from my gunfire, but also wouldn't attack. If I aligned them to player and set them to attack, they slaughtered each other ignoring everbody else.

 

I know using the task.wanderaround() takes away fear, but also stops any progression of a TaskSequence. I've tried using just about every combination of tasks in a task sequence as well.

 

As i stated before, i've tried all relationship options. I need the "Infected" peds I call to only attack via melee and have no fear. None of the Behavior / Combat Templates i used had any effect. I've even tried these.

 

Public Shared Widening Operator CType(ByVal SMG_MP5 As sickness) As gta.weapon   'Return weapon.SMG_MP5 = weapon.unarmed   'End Operator   'Public Shared Operator =(ByVal SMG_MP5 As Sickness, ByVal unarmed As Sickness) As Boolean   'Return (weapon.SMG_MP5 = weapon.unarmed) AndAlso (weapon.SMG_MP5 = weapon.unarmed)   'End Operator   'Public Shared Operator <>(ByVal SMG_MP5 As Sickness, ByVal unarmed As Sickness) As Boolean   'Return (weapon.SMG_MP5 <> weapon.SMG_MP5) OrElse (weapon.unarmed <> weapon.unarmed)   'End Operator

 

I failed to see any effects so i must have failed. I was trying, at least as i understood it, a weapon conversion to make an SMG appear as UNARMED. (to the ped?) Didn't work.

 

I've been trying to make this work for about a month and didn't want to bother you professional dev's on the forum, but i have nowhere to go. College isn't an option on my wages lol.

Link to comment
Share on other sites

Why don't you want to use BecomeMissionCharacter()? Everything else would be very inaccurate and would rely on luck, if a ped can respond to random events you simply can't make sure it will always fight for you. Also you can't use any SET_CHAR_ native on a char you didn't create when it's not a mission char.

Link to comment
Share on other sites

motorsport71

the problem i am having with BecomeMissionCharacter() is the game isn't auto cleaning up the peds after game default distance. At game default there are at any given time up to 25 "infected" peds running around attacking everybody, and if they aren't cleaned up it will crash the game. I can't figure out how to make a poll distance for mission peds to be called back. I've had long term runs under current conditions with no repricutions. I know that there is a function that calls group members back into the game after they fall behind a certain distance, but i don't think it applys to "enemy" peds not in my relationshipgroup. I've also tried the BecomeMissionCharacter() in a separate attempt and they ran anyway. That Contagium Mod by Molotov, an ASI file, works fine for fearless peds. From the evidence of the mod they are all allies yet attack, and it is obvious they are all spawned, not "World.getpeds" They seem to use the "Task.GoTo(player)" and attack upon arrival, yet follow you anyway. I think he has all relationshipgroups set to player so they continue to follow everyone.

 

Is there a way to set a poll distance for non grouped MissionCharacters?

 

 

Link to comment
Share on other sites

Why not simply store all peds you set to mission peds and check if they are out of sight and then mark them as no longer needed?

Link to comment
Share on other sites

motorsport71

i had it set that if they were on screen = false andalso ped.type = pedtype.civillian_male = true andalso etc. then NoLongerNeeded() but that made the wanted feel of the mod go away. If i didn't scare away my "infected" peds with gunfire, IE melee, they would gather in mass and chase me down the street, sometimes a dozen at a time. If the camera shifts away from them and then back they are done loosing the effect. It was set on a tick of 29990 giving a good amount of time (30 seconds), but it still lost the feel loosing intensity factor. It also ran into the problem of a distance issue with cleanup. I had to then set up a second tick to clean up the dead. If i were to get out of an area way to fast it could leave straglers.

 

I know if i World.GetPeds without making them a MissionCharacter, if i set myself as a companion of their relationship group they don't run from my gunfire, if they are given the Task.GoTo command they don't run on the way to me, If a ped is given Task.Wander() they don't fear gunfire either.

 

I have given them the Task.GoTo(player) then Task.GuardPosition() as a TaskSequence but they wouldn't attack, but that may be because of the BecomeMissionCharacter().

 

I am thankful for the input so far BTW. Thank you.

Link to comment
Share on other sites

I'd setup it like this: A list of all peds you have set to missions char. In a tick check whether they are dead and if so make them no longer needed and remove them from the list. Same for a certain distance, say 200metres.

Link to comment
Share on other sites

motorsport71

a acually did that on the prior build and it worked great, i set missioncharacter() collecton for the dead on a quick tick and all was great. I haven't implemented using only the NoLongerNeeded(), I was actually adding Ped.Delete() to get rid of Blips assigned to keep track progress of mod.

 

I played with setting animations to see if it affected behavior but it did nothing more than change ped position, all behavior remained intact sad.gif , whether or not they were called as a mission ped.

 

I also tried to constantly reuse a task.fightagainst(player) on a tick late last night but i got the run away, turn around, run away, turn around affect.

 

I see in the Wiki pages for all the Animations there are movement info that look like they could be implemented as combat look, I.E, a ped moving in away that would look like it would perform damage. I wonder if i set up a tasksequence after a ped is called from 40 meter radius, and put it on a timer so they don't turn around as well as a low ped.senserange of 5.0f or less:

 

atask.addtask.goto(player)

atask.addtask.playanimation(**,**,**,**)

 

after that

 

Then set up a vector 3 on a tick

Dim Ped as Ped = world.getpeds(player.character.postion(newvector3(0.0f, 0.0f, 0.0f, (1.0f)

If exists(ped) andalso (necessary ped critera) then

player.character.health -= 2 ///since ped animation of damage infliction is happening

 

This would give the illusion of being damage by the ped

Link to comment
Share on other sites

motorsport71

I was trying to use some functions from DecisonMaker class but am having a problem: I am getting an object reference error. No matter how i set it, it gives me a "constructor" error in the script and says "cannot reference object".

 

There are several options i would like to use there that would, I'm sure, solve my problem. I'm at work currently and cannot remember exact functions but if can work with me.

 

One function is (close to this) Decisionmaker.addeventresponce(eventid,responceid,param1, param2, param3, param4)

 

There are similar functions that affect responces, one just calls for an EventId to ignore it.

 

If someone could help me with a decisionmaker example that would be great. I set up this currently:

 

Private Class

Inherits script

Private Ped as Ped

private Decisonmaker as Decisionmaker

 

Public sub new()

 

Decisonmaker.applyto(ped) ////NO MATTER WHAT I DO THIS CAUSES CONSTRUCTOR ERROR BUT LITERATURE SAYS IT HAS TO BE PLACED IN PUBLIC SUB NEW

 

Private Sub InfectedPedBehaviourAttempt.........

 

Anyway, I cannot seem to make it work. The other write only functions i want to use don't work either without the error.

 

Can anybody help?

Link to comment
Share on other sites

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
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.