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

Members Online

»
0 Active | 22 Guests
Online:

LATEST FORUM THREADS

»
Unity Overgrown Remake
CoD4 MP Mapping
Good Servers on PC
CoDBO 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: Allied AI Invinsibility
SPi
General Member
Since: Jul 4, 2012
Posts: 530
Last: Oct 17, 2018
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Monday, Sep. 3, 2012 03:29 am
I have read the specific tut ( http://modsonline.com/Tutorials-read-616.html ) (Go to the part that says for infinite health) and i did everything it said and i still cant get my allies not dying

Does anyone know an easy and effective way of doing it?
Share |
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Monday, Sep. 3, 2012 04:34 am
Should be something like this:
Code:
ally_nodamage() //If you spawn them via script
{
allyteam =getentarray ("ally", "targetname");//Gets only static spawner entities 
friends = [];//Creates empty array
for(i=0; i<allyteam.size; i++)
{
    friends[i] = allyteam[i] doSpawn();//Spawns actor
    friends[i] thread maps\_utility::magic_bullet_shield();//Then actor is given magic shield

}
}


OR if you want to spawn them via a trigger, put this line somewhere in you main function, but after the maps\_load::main():
(Updated this part, it had an error)
Code:
array_thread( getentarray( "ally", "targetname" ), ::add_spawn_function, ::magic_bullet_shield);


http://modsonline.com/Forums-top-160826.html

edited on Sep. 4, 2012 06:22 am by 3st0nian

edited on Sep. 4, 2012 06:24 am by 3st0nian
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 530
Last: Oct 17, 2018
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Tuesday, Sep. 4, 2012 05:17 am
i used the 2nd way as they spawn via trigger ( 6 allies) and i want them to have different targetname and also have invincibility.

I did this in my gsc.(i dont show the rest so you wont be confused)

after the maps/load main

Code:


{

maps\_load::main();

	array_thread( getentarray( "Alex", "targetname" ), ::add_spawn_function, ::magic_bullet_shield());
	array_thread( getentarray( "Pan", "targetname" ), ::add_spawn_function, ::magic_bullet_shield());
	array_thread( getentarray( "Jami", "targetname" ), ::add_spawn_function, ::magic_bullet_shield());
	array_thread( getentarray( "Loz", "targetname" ), ::add_spawn_function, ::magic_bullet_shield());
	array_thread( getentarray( "SV", "targetname" ), ::add_spawn_function, ::magic_bullet_shield());
	array_thread( getentarray( "AV", "targetname" ), ::add_spawn_function, ::magic_bullet_shield());
	
	thread ally_nodamage();	
}
	
	ally_nodamage() 
{
    self thread maps\_utility::magic_bullet_shield();
}




resize the window if you have to.

I get an error in this. in the from the first (with Alex NOT the "{" )




edited on Sep. 4, 2012 05:17 am by SPi
Share |
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Tuesday, Sep. 4, 2012 05:30 am
What exactly does the error say?
With the second way, you actually dont need the function ally_nodamage(); (that was my mistake).

And try this:
Code:
getent( "Alex", "targetname" ) thread add_spawn_function( ::magic_bullet_shield );
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 530
Last: Oct 17, 2018
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 5, 2012 12:22 am
attachment: image(60.5Kb)
I get the same error with this code too [sad]

(getent is used for more than 1 entity)

the error is uploaded as a photo.

I used just alex to test it. becoyse i thought it would be faster to check just 1 character.
Anyway in the end ill need all 6 characters to be invinsible.

Share |
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 5, 2012 12:34 am
If you have only one spawner with given key/value, you must use
Code:
getent( "Alex", "targetname" ) thread add_spawn_function( ::magic_bullet_shield );

If you have more than one spawners with same key/value, you must use
Code:
array_thread( getentarray( "ally", "targetname" ), ::add_spawn_function, ::magic_bullet_shield);


The error is telling, that you have multiple spawners(or other entities) with ("Alex", "targetname") key/value, so you must use getentarray, or remove these key/value pairs from other entities

edited on Sep. 5, 2012 12:36 am by 3st0nian

edited on Sep. 5, 2012 12:38 am by 3st0nian
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 530
Last: Oct 17, 2018
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 5, 2012 12:49 am
Oh crab i didnot notice that i had a spawn trigger for alex among with two enemies andcos of that they had all the same targetname . ok now ill try again and i will info you for any success or error [jumping]
Share |
SPi
General Member
Since: Jul 4, 2012
Posts: 530
Last: Oct 17, 2018
[view latest posts]
Level 6
Category: CoD4 SP Mapping
Posted: Wednesday, Sep. 5, 2012 03:22 am
It works It really works !!! [jumping]
Unbelivable. looks so nice.[crazy]
Epic battlesa ahead. [eek] [2guns]
Thanks 3stonian. U r helping a lot .[thumbs_up]
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 15, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Friday, Sep. 7, 2012 12:40 pm
It doesn't really matter which way you do it in scripting. They all work. And my tut needs updating.

Since it's solved, good job!
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

»