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

Members Online

»
0 Active | 51 Guests
Online:

LATEST FORUM THREADS

»
run artillery on maps
CoD+UO Map + Mod Releases
Call of DutyŽ: WWII
CoD WW2 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: how do i make AI ignore me?
mr.newbie
General Member
Since: Jun 9, 2008
Posts: 166
Last: Apr 20, 2010
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Saturday, Oct. 31, 2009 02:54 pm
ok so i start a map 200 yards or so from a fortress with guard tower. it's dark out so i don't want them to be able to see you. but as soon as you start the map they start rainin down lead. how do i make it so they ignore me? until i start shooting if possible. is there a tool texture or trigger i can use?
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Sunday, Nov. 1, 2009 06:50 pm
in your script:

level.player.ignoreme = true;

you can set up a trigger_once in radiant and wait in script for the player to touch it and then set

level.player.ignoreme = false;


or instead of ignoreme you can also use

array_thread( getaiarray( "axis" ), ::set_pacifist, true );


here is an example without trigger, it checks the distance instead:

Code:
rpg_guys()
{
    rpg_guys = getentarray( "rpg_guy", "script_noteworthy" );

    for( i=0;i<rpg_guys.size;i++ )
        rpg_guys[ i ].pacifist = true;

    for( ;; )
    {
        rpg_guys = getentarray( "rpg_guy", "script_noteworthy" );

		for( i = 0; i < rpg_guys.size; i++ )
        {
            if( !isalive( rpg_guys[ i ] ) )
                    continue;

            closest = getClosest( rpg_guys[ i ].origin, level.helis );
            dist = distance( closest.origin , rpg_guys[ i ].origin );

            if( dist < 2500 && rpg_guys[ i ].pacifist )
            {
                rpg_guys[ i ] setEntityTarget( closest );
                rpg_guys[ i ].pacifist = false;
                rpg_guys[ i ] thread kill_in_ten();
            }

            wait( .05 );
        }
        
        wait( .05 );
    }
}
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Aug 31, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Friday, Nov. 6, 2009 10:21 pm
well theres many ways u can go about to making them ignore you. but the best way is that of which sevenz talked about. have

Code:
level.player.ignoreme = true;


and whenever u want them to stop avoiding u, you can have it set to false; and they will start attacking you. If you want them to stop ignoring you passing a certain point u can set up a trigger so that when the player triggers it, you can then tell them to ignore you via script. it would be something like :

Code:

 trigger = getent( "stop_ignoring_player", "targetname" ); // this would be the trigger that the player would be trigggering you can change the key/values to w/e u want it to be. 

trigger waittill( "trigger" );// we wait for the trigger to be actually triggered

level.player.ignoreme = false;


try it either way.

edited on Nov. 7, 2009 12:23 am by voidsource
Share |
benni-iop
General Member
Since: Oct 16, 2010
Posts: 13
Last: Dec 1, 2011
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Thursday, Dec. 1, 2011 10:32 am
Is there a way to ignore ONLY the player ?
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Thursday, Dec. 1, 2011 12:19 pm
level.player.ignoreme = true;
will exactly do that, enemies will ignore you (the player), but attack your allies.
Share |
Zaphax
General Member
Since: Jun 17, 2008
Posts: 251
Last: Dec 29, 2013
[view latest posts]
Level 5
Category: CoD4 SP Mapping
Posted: Tuesday, Jul. 10, 2012 10:28 am
How do you make that enemies ignore your allies and allies ignore the enemy?

should i do:

Code:
self.ignoreall = true;


that way everyone ignore everyone. That doesn't affect animations?
It just makes allies ignore axis and axis ignore allies including player right?
Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Aug 31, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Tuesday, Jul. 10, 2012 10:42 am
well u can do it via radiant or u can do it via script.
if you do it via script its easier to tell them when to ignore each other and when not to. First defined the ent then make them ignore all, which should work. should be something like

Code:

main()
{
....
my_ai = getent( 'value', 'targetname' );//this is ur ai
my_ai add_spawn_function( ::ignore_me );//u can use this function on w/e other ai's u have in mind; just defined those ai's beforehand and then replace 'my_ai' with w/e var u used for them.

}

ignore_me()
{
wait 0.01;
if( isalive(self ) )
   self.ignoreall = true;

}


so this will make them ignore ur ai as soon as they have spawned. u can use these on arrays so that u can call it on an entire group of ai's as well just make sure u use 'getentarray' and that in radiant that group of ai's have that same k/v's place in them.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

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

»