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

Members Online

»
1 Active | 13 Guests
Online:

LATEST FORUM THREADS

»
water
CoD4 MP Mapping
ugw2gold
Starcraft 2
Rainbow HELP....
CoD4 MP Mapping

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, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Allied AI Invinsibility
SPi
General Member
Since: Jul 4, 2012
Posts: 203
Last: May 14, 2013
[view latest posts]
Level 4
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: 181
Last: May 8, 2013
[view latest posts]
Level 4
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: 203
Last: May 14, 2013
[view latest posts]
Level 4
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: 181
Last: May 8, 2013
[view latest posts]
Level 4
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: 203
Last: May 14, 2013
[view latest posts]
Level 4
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: 181
Last: May 8, 2013
[view latest posts]
Level 4
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: 203
Last: May 14, 2013
[view latest posts]
Level 4
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: 203
Last: May 14, 2013
[view latest posts]
Level 4
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: 807
Last: Dec 24, 2012
[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 Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

Latest Syndicated News

»
Why console gaming is dying
Quote:Consider this: Dedicated gaming sales — including living-room consoles...
Devs: Games are being dumb...
Click 'read more' to view the contents of this post.
Loadout
Gun Crafting to the Max. edited on Sep. 25, 2012 06:57 pm by Morp...
Introducing the Source Fil...
Surprised this wasn't made a long time ago. Sounds like a nice little feature.
Introducing the Source Fil...
The Source Filmmaker (SFM) is the movie-making tool built and used by us he...

Partners & Friends

»