IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Pede.Task.FightAgainst(Player.Character);

 
Whitemike20052  
Posted: Saturday, Mar 17 2012, 18:38
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Dec 19, 2010

XXXXX



This is a line of code in a mod that makes certain peds attack you. How would i change this so they attack the police or better yet pedestrians and everyone else.

This is also there.

Pede.Task.GoTo(Player.Character.Position, true);

Basically i want the zombies to go after everyone, consider everyone an enemy and not just me.
PM
  Top
 

 
lamar_mustapha  
Posted: Saturday, Mar 17 2012, 19:42
Quote Post


Player Hater
Group Icon
Group: BUSTED!
Joined: Mar 17, 2012

XXXXX



http://dl.dropbox.com/u/55310026/Zombie%20...8tweaked%29.rar

try that

This post has been edited by lamar_mustapha on Saturday, Mar 17 2012, 19:59
PM
  Top
 

 
lamar_mustapha  
Posted: Saturday, Mar 17 2012, 19:55
Quote Post


Player Hater
Group Icon
Group: BUSTED!
Joined: Mar 17, 2012

XXXXX



i dont really like it since now it is not as dangerous but now they attack u and each other

This post has been edited by lamar_mustapha on Saturday, Mar 17 2012, 19:59
PM
  Top
 

 
hardsty1e  
Posted: Saturday, Mar 17 2012, 20:06
Quote Post


Rat
Group Icon
Group: Members
Joined: May 2, 2009

XXXXX



Grabs all cops 30f way from nikos position. You can pick any ped relationship group you want.
CODE
Ped[] pedArray = World.GetPeds(Game.LocalPlayer.Character.Position, 30.0F);

       foreach (Ped cop in pedArray)
       {
           if (cop.RelationshipGroup == RelationshipGroup.Cop)
...
cop.ChangeRelationship(RelationshipGroup.Player, Relationship.Hate);


http://www.gtamodding.com/index.php?title=...ative_functions

or look at motorsport71 http://www.gta4-mods.com/script/left-4-lib...ction-v41-f8616 zombie source script

This post has been edited by hardsty1e on Saturday, Mar 17 2012, 23:08
PM
  Top
 

 
Whitemike20052  
Posted: Monday, Mar 19 2012, 14:17
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Dec 19, 2010

XXXXX



QUOTE (lamar_mustapha @ Saturday, Mar 17 2012, 19:42)
http://dl.dropbox.com/u/55310026/Zombie%20...8tweaked%29.rar

try that

I tried your script, and it seems that they dont even come after me anymore... confused.gif

Hmm, ive already modified the Script so that Regular Peds and stuff spawn with cops and ambulances and all.

With the numbers ive put i get anywhere between 10-22 zombies spawning with the script.

Ive managed to get the cops and peds from Ambient Wars to shoot at them by changing the relationship group to dealer.

Ive also removed the random exploding vehicles. Now i want the zombies that do spawn to attack the ones that rent made zombies by the script.

If you put my edited one in, you can see all the regular vehicles and emergency personnel are still in. If anyone can help me get them to attack the cops only even, i would greatly appreciate it.

Also is there anyway to change the zombies that do spawn into runners ala Liberty Infection? They use the same animations i think i just cant figure out the command to get them to run.




using System;
using System.Windows.Forms;
using GTA;

namespace Zomb
{

// ### makes ZombieZ!

public class Zomb : Script
{

public Zomb()
{
this.Tick += new EventHandler(this.ScriptCommunicationExample2_Tick);
Interval = Settings.GetValueInteger("INTERVAL", "SETTINGS", 200);
Wait(0);
}

private int Ra(int min, int max)
{
Random random = new Random();
return random.Next(min, max);
}
bool Ison = false;

int r;


private void ScriptCommunicationExample2_Tick(object sender, EventArgs e)
{
// Wait(0);



if (Ison == true)
{
if (!Player.Character.isAlive)
{

Ison = false; int rand = Ra(0, 6); GTA.Native.Function.Call("FORCE_WEATHER_NOW", rand); Game.DisplayText("INFECTION STOPPED...");
GTA.Native.Function.Call("SET_MAX_WANTED_LEVEL", 6);


}
else
{
int r = Ra(0, 95);
if (r == 2)
{
Wait(0);
Vehicle x = null;
int a = Ra(0, 26);
int bb = Ra(-40, 40);
Vector3 ppp = Player.Character.GetOffsetPosition(new Vector3(bb, 30.0f, -40.0f));
if (a == 0) { x = GTA.World.CreateVehicle(0x45D56ADA, ppp); }





Wait(0);
if (x != null && x.Exists())
{
x.Health = -1000; x.PetrolTankHealth = -0.1F;


GTA.Native.Function.Call("SET_CAR_COORDINATES", x, x.Position.X, x.Position.Y, x.Position.Z + Ra(10, 350));
x.Heading = Ra(0, 359);
Wait(0);
x.ApplyForce(new Vector3(100.0F, 200.0F, -200000.58F));
Wait(0);
x.ApplyForce(new Vector3(500.0F, 200.0F, -20000.58F));
Wait(0);
x.NoLongerNeeded();
}
}


GTA.Native.Function.Call("SET_MAX_WANTED_LEVEL", 4);
GTA.Native.Function.Call("ALTER_WANTED_LEVEL", Player, 2);
GTA.Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player);

GTA.World.PedDensity = 3.0F;
GTA.World.CarDensity = 4.0F;
GTA.Native.Function.Call("Request_Anims", "amb@drunk");

AnimationFlags animflags = AnimationFlags.Unknown11 | AnimationFlags.Unknown09;
AnimationSet anims = new AnimationSet("amb@drunk");



GTA.Ped[] pedArray = GTA.World.GetPeds(Player.Character.Position.Around(9.0f), 9999.0F, 22);

foreach (GTA.Ped Pede in pedArray)
{
if (!Pede.Exists() || Pede == null || Pede.isRequiredForMission || !Player.Character.isAlive || GTA.Native.Function.Call<bool>("IS_PED_CLIMBING", Pede) ||

Pede.isGettingIntoAVehicle || Pede.isRagdoll ||

!Pede.isAlive || Pede == Player.Character)
{
continue;
}

if (Pede.Exists() && Pede != null)
{


GTA.Native.Function.Call("SAY_AMBIENT_SPEECH", Pede, "MOAN", 1, 1, 2);
if (Pede.isSittingInVehicle())
{


}
if (Pede.Exists() && Pede != null && GTA.Native.Function.Call<bool>("IS_CHAR_SITTING_IDLE", Pede))
{
Pede.Euphoria.BodyBalance.Start(100); Wait(0);
}
if (Pede.Exists() && Pede != null)
{
GTA.Native.Function.Call("SET_PED_DONT_DO_EVASIVE_DIVES", Pede, 1);
GTA.Native.Function.Call("SET_CHAR_SUFFERS_CRITICAL_HITS", Pede, 1);
Pede.AlwaysDiesOnLowHealth = false;
GTA.Native.Function.Call("SET_CHAR_MONEY", Pede, 0);
Pede.Health = 900;
// Pede.MakeProofTo(false, false, false, true, false);

r = Ra(0, 4);

if ((r == 1) && Pede.Exists() && Pede != null && !GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Pede, "amb@drunk", "bum_fight") && !GTA.Native.Function.Call<bool>

("IS_CHAR_GETTING_UP", Pede) && !Pede.isSittingInVehicle())
{
Pede.Task.PlayAnimation(anims, "bum_fight", 10.0F, animflags);
}
//Pede.Task.ClearAll();
Pede.DuckWhenAimedAtByGroupMember = false;
Pede.ChangeRelationship(RelationshipGroup.Dealer, Relationship.Hate);
Pede.Weapons.RemoveAll();
//Pede.CancelAmbientSpeech();
Pede.Voice = "M_ZOMBIE";
Pede.SetPathfinding(true, true, true);
Pede.RelationshipGroup = RelationshipGroup.Dealer;
Pede.Task.FightAgainst(Player.Character);
Pede.Task.GoTo(Player.Character.Position, true);
//Wait(0);
GTA.Native.Function.Call("REQUEST_ANIMS", "move_injured_lower");
}
if (Pede.Exists() && Pede != null)
{
GTA.Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Pede, "move_injured_lower"); GTA.Native.Function.Call("Set_Char_Move_Anim_Speed_Multiplier", Pede, 2.0f);


r = Ra(3, 10);
if ((r == 4) && !GTA.Native.Function.Call<bool>("IS_CHAR_IN_AIR", Pede))
{

Pede.ApplyForce(new Vector3(0.0F, -2.5F, 0.0F));
}
r = Ra(3, 10);
if ((r == 4) && !GTA.Native.Function.Call<bool>("IS_CHAR_IN_AIR", Pede))
{

Pede.ApplyForce(new Vector3(0.0F, 2.5F, 0.0F));
}
}

if (Pede.Exists() && Pede != null)
{
float vx = Pede.Velocity.X, vy = Pede.Velocity.Y;
vx = vx * vx; vy = vy * vy;







//
//
r = Ra(0, 2);
if ((r == 1) &&Pede.Exists() && Pede != null && !GTA.Native.Function.Call<bool>("IS_CHAR_GETTING_UP", Pede) && !

GTA.Native.Function.Call<bool>("IS_PED_CLIMBING", Pede) && !Pede.isSittingInVehicle() && (vx < 0.1F) && (vy < 0.1F))// && (vx > //0.00001F) && (vy > 0.00001F)
{
GTA.Native.Function.Call("TASK_CLIMB", Pede, 3);
if (Player.Character.Position.Z - Pede.Position.Z >= 1.0F)
{
Pede.ApplyForce(new Vector3(0.0F, 0.0F, 4.41F), new Vector3(0.0F, 0.0F, -4.41F));
}
// Pede.Task.ClearAll();

Wait(0);


}

}
}

if (Pede.Exists() && Pede != null && (!Pede.isRagdoll) && !GTA.Native.Function.Call<bool>("IS_CHAR_GETTING_UP", Player.Character)&& !GTA.Native.Function.Call<bool>("IS_CHAR_GETTING_UP", Pede) && Pede.isAliveAndWell && Pede.Position.DistanceTo

(Player.Character.Position) <=

1.15f)
{
if (!Player.Character.isSittingInVehicle())
{
Pede.PreventRagdoll = true;
if (Pede.Exists() && Pede != null && (!Pede.isRagdoll) && (!Player.Character.isRagdoll) && Player.Character.isAlive && !GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Pede,

"amb@drunk", "bum_fight") && !

GTA.Native.Function.Call<bool>("IS_CHAR_GETTING_UP", Pede))
Pede.Task.PlayAnimation(anims, "bum_fight", 10.0F, animflags);

Wait(400);
Player.Character.Euphoria.BodyBalance.Start(200);
if (Pede.Position.X < Player.Character.Position.X) { Player.Character.ApplyForce(new Vector3(3.45F, 0.0F, 0.0f)); }
else { Player.Character.ApplyForce(new Vector3(-3.45F, 0.0F, 0.0f)); }
if (Pede.Position.Y < Player.Character.Position.Y) { Player.Character.ApplyForce(new Vector3(0.0F, 3.45F, 0.0f)); }
else { Player.Character.ApplyForce(new Vector3(0.0F, -3.45F, 0.0f)); }
Player.Character.ApplyForce(new Vector3(0.0F, 0.0F, 0.8f), new Vector3(0.0F, 0.0F, -0.8f));

Wait(100);

Player.Character.Health -= 6;
Pede.PreventRagdoll = false;

}
}
}
}
}
// if (!GTA.Native.Function.Call<bool>("Is_Char_In_Area_2D", Player.Character, 358.4987, 437.2099, 600.0576, -115.1860))


else
{
GTA.Native.Function.Call("DRAW_LIGHT_WITH_RANGE", 468.7595, 391.0586, 8.2811, 250, 20, 20, 9.0F, 95.0F);


if (GTA.Native.Function.Call<bool>("Is_Char_In_Area_2D", Player.Character, 467.7190, 390.7162, 470.0016, 391.3876) || (isKeyPressed(Settings.GetValueKey("Key", Keys.F9))))
{
Ison = true;
GTA.Native.Function.Call("Do_Screen_Fade_Out", 650);
Wait(2000);
int r = Ra(6, 8);
GTA.Native.Function.Call("FORCE_WEATHER_NOW", r); GTA.Native.Function.Call("SET_TIME_OF_DAY", 0);
GTA.Native.Function.Call("Do_Screen_Fade_In", 1650);
Game.DisplayText("INFECTION STARTED!", 5000);


}
}

}
}

}
PM
  Top
 

 
Whitemike20052  
Posted: Monday, Mar 19 2012, 14:27
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Dec 19, 2010

XXXXX



QUOTE (hardsty1e @ Saturday, Mar 17 2012, 20:06)
Grabs all cops 30f way from nikos position. You can pick any ped relationship group you want.
CODE
Ped[] pedArray = World.GetPeds(Game.LocalPlayer.Character.Position, 30.0F);

       foreach (Ped cop in pedArray)
       {
           if (cop.RelationshipGroup == RelationshipGroup.Cop)
...
cop.ChangeRelationship(RelationshipGroup.Player, Relationship.Hate);


http://www.gtamodding.com/index.php?title=...ative_functions

or look at motorsport71 http://www.gta4-mods.com/script/left-4-lib...ction-v41-f8616 zombie source script

Not sure what you mean by this...if i change there relationship group to cops, will they attack everyone?
PM
  Top
 

 
lamar_mustapha  
Posted: Monday, Mar 19 2012, 17:50
Quote Post


Player Hater
Group Icon
Group: BUSTED!
Joined: Mar 17, 2012

XXXXX



uh.. i warned u it wasnt that good, so no need to say

anyways, go here:

CODE
if (Pede.isIdle)
{
   if (Ra(1, 100) < 70)
   {
       Pede.Task.FightAgainstHatedTargets(10);
   }
   else
   {
       Pede.Task.FightAgainst(Player.Character);
       Pede.Task.GoTo(Player.Character.Position, true);
    }
}


70% probability zombies attack each other, 30% they attack you, so adjust that, also like i said, his script makes all peds zombies? do u want to limit that, amybe leave civ males as human and civ female as human and everyone else zombie??

u need to edit more to do what u want, u should just write a new script instead of butchering a perfectly working one

also dont know if these peds are ever idle, i didnt test this so dont know if that is messing this up, maybe get rid of idle check, my intention was to let them finish their task before issuing a new one but i wouldnt know if it worked cuz i didnt test. I dont care to make other people's scripts better so much, just my own

not to mention, reading his scripts are a headache, he doesnt use proper casing, his brackets are in random places {}, his spacing is random and variables dont say what they are


This post has been edited by lamar_mustapha on Tuesday, Mar 20 2012, 07:21
PM
  Top
 

 
hardsty1e  
Posted: Monday, Mar 19 2012, 23:29
Quote Post


Rat
Group Icon
Group: Members
Joined: May 2, 2009

XXXXX



Maybe you could try to change the emergency personnel(or any special relationship group) into civ males then have cops hate civ males that are special ped models and have special peds hate cops then tell them to attack cops. Decision Maker is tricky and I don't anyone has really learn to control its capabilities.

CODE
DecisionMaker.LoadCombat(DecisionMaker.CombatTemplate.CopNormal);
PM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG