Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 153 Guests
Online:

LATEST FORUM THREADS

»
Mohaa maps on Cod2?
CoD2 MP Mapping
is this place alive?
CoDBO3 Mapping
Call of DutyŽ: WWII
CoD WW2 General

Tutorials

»
CoD Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Scripting 101 - Pacify AI
Versions: You must be logged in to view history.
BR3NT explains how to pacify AI
In your SP levels you sometimes need to 'Pacify' or make friendly you ai Actor's.
This applies to both Allies and Axis soldiers. As one entity or an array.

entity.pacifist

var = true; or false;


Like everything else, there are a few ways to execute this function on Ai.
It Can Be Used On:

a) A single entity.
b) A group of entities.
c) Allied and axis specific.


A Single entity:

CODE:


pacify_ent()
{
ent = getaiarray("ent_name", "targetname");
ent.pacifist = true;
}

An Array Of Entities:

CODE:


pacify_ai_array()
{
ai_array = getentarray("array_name", "targetname");
for(i = 0; i < ai_array.size; i++)
{
ai_array[i].pacifist = true;
}
}

Allied And Axis Specific:

CODE:


pacify_all_ai()
{
all_ai = getaiarray("axis", "allies");  //Would Only Pacify Axis and Allied Soldiers
// If You Just Want One Group Pacified You Would Leave // Out The One You Dont Want Pacified. Like Below
// ai = getaiarray("axis",);  // Would Only Pacify Axis Soldiers
for(i = 0; i < ai.size; i++)
{
ai[i].pacifist = true;
}
}

And sometimnes we need to reverse this action. You do that like so:

CODE:


unpacify_all_ai()
{
all_ai = getaiarray("axis", "allies"); // This Would Return Everyone Back To Combat
for(i = 0; i < all_ai.size; i++)
{
ai[i].pacifist = false;
}
}

Im sure this will be useful to someone.
[exclamation]
Stay Tuned For More Scripting Fun.[thumbs_up]

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»