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

Members Online

»
0 Active | 51 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD4 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
COD4 Objectives/ teammate infinite health
Versions: You must be logged in to view history.
This guide will tell you how to create objectives in COD4 easily as well as infinite health for your teammates.Check out the downloads section for this tut. http://www.modsonline.com/Downloads-full-5112.html

First off, thanks to the objective tutorials in the COD1 mapping section.

COD4 Objectives

First create your world in radiant. Then create a trigger brush anywhere you like. This is where you would have to go to complete the objective. Make sure the trigger brush is trigger_multiple. The fill in this:

Key: targetname

value: obj1

If you want more objectives, create more triggers. Replace the value with obj2, obj3 and so on. To make an actor an objective, create the actor and give him the key of targetname and value of obj#. After you're done, finish your map and save! Complie your map!

 

Now is the time for scripting. It's fairly simple. Copy and paste this in your gsc file. 

 

main()
{

maps\_load::main();

level.player takeallweapons();
level.player giveWeapon ("m16_basic"); //use whatever gun you want
level.player giveWeapon ("g36c"); //same
level.player switchToWeapon ("g36c"); //pick the gun you want to hold
level.player giveWeapon ("fraggrenade");
level.player giveWeapon ("flash_grenade");
thread obj1(); //call your objectives
}

obj1()
{

obj1 = getent("obj1", "targetname"); //the game finds the trigger

objective_add(1, "active", &"mapname_OBJ1",getent("obj1","targetname").origin); //add obj.

objective_current(1); //current objective

obj1 waittill("trigger"); //wait till the trigger is triggered

objective_state(1, "done");

obj1 delete(); //deletes it

wait(2); //fill in however long you like (in seconds)

thread obj2(); //thread next objectives.

}

obj2()
{

obj2 = getent("obj2", "targetname");

objective_add(2, "active", &"mapname_OBJ2",getent("obj2","targetname").origin);

objective_current(2);


obj2 waittill("trigger");

objective_state(2, "done");

obj2 delete();

wait(2);

thread obj3();

}

obj3()
{

obj3 = getent("obj3", "targetname");

objective_add(3, "active", &"mapname_OBJ3",getent("obj3","targetname").origin);

objective_current(3);

obj3 waittill("trigger");

objective_state(3, "done");

obj3 delete();

wait(2);

iprintlnbold (&"mapname_OBJ_COMPLETED"); //tells player obj finished

missionSuccess ("fun",false); //the mission ends
}

The script above is for trigger objectives. For actors replace

"obj# waittill("trigger");" with "obj# waittill("death");"

 

You can add more objectives if you like. Just repeat. 

You're done the gsc file but scripting is not done yet!

create a mapname.str in your main/localizedstrings folder.

 

Copy this:

 

VERSION             "1"

CONFIG              "F:\projects\mk\bin\StringEd\StringEd.cfg"

FILENOTES           ""



REFERENCE           OBJ1

LANG_ENGLISH        "Get to the centre of the road. Clear out the road block." //change to whatever you want for your objective.

REFERENCE           OBJ2

LANG_ENGLISH        "Get to your teammates!" //same



REFERENCE           OBJ3

LANG_ENGLISH        "Get on the truck." //same



REFERENCE           OBJ_COMPLETED

LANG_ENGLISH        "All Objective Completed!"  //same



REFERENCE           OBJECTIVES

LANG_ENGLISH        "Press the |Tab| key to check your Objectives" //reminder

ENDMARKER

 

You can add more references for more objectives. Just add OBJ4, OBJ5, etc.

 

That's it you're done!

 

 

Time for infinite health. This is very simple. 

In radiant, create some actors or just one. Give them a targetname of ally or whatever. You're done in radiant!

Script time!

I can't call the script from another gsc file because I don't know how to get it to work. Just copy and paste into your main gsc file. 

 

thread ally_nodamage(); //whatever value you like for thread

 

ally_nodamage() //whatever you called above

{
allyteam =getentarray ("ally", "targetname"); //what you named
for(i=0;i
allyteam[i] thread maps\_utility::magic_bullet_shield(); //infinite health
}

You're done! The infinite health works great for heroes or any regular actors, but not you, the player, unfortunately. Also thanx to http://www.modsonline.com/Forums-top-68372-30.html#59375

everyone who helped me on this topic. 

 

Combine both tutorials together you get this. My map as an example.

 

main()
{

level.weaponClipModels = [];
level.weaponClipModels[0] = "weapon_m16_clip";
level.weaponClipModels[1] = "weapon_ak47_clip";
level.weaponClipModels[2] = "weapon_g36_clip";
level.weaponClipModels[3] = "weapon_mp5_clip";

maps\_load::main();


level.player takeallweapons();
level.player giveWeapon ("m16_basic");
level.player giveWeapon ("g36c");
level.player switchToWeapon ("g36c");
level.player giveWeapon ("fraggrenade");
level.player giveWeapon ("flash_grenade");
thread ally_nodamage();   //  executes ally_nodamage() function
thread obj1();
}

ally_nodamage()
{
allyteam =getentarray ("ally", "targetname");
for(i=0;i
allyteam[i] thread maps\_utility::magic_bullet_shield();
}


obj1()
{

obj1 = getent("obj1", "targetname");

objective_add(1, "active", &"streetclearing2_OBJ1",getent("obj1","targetname").origin);

objective_current(1);

obj1 waittill("trigger");

objective_state(1, "done");

obj1 delete();

wait(2);

thread obj2();

}

obj2()
{

obj2 = getent("obj2", "targetname");

objective_add(2, "active", &"streetclearing2_OBJ2",getent("obj2","targetname").origin);

objective_current(2);


obj2 waittill("trigger");

objective_state(2, "done");

obj2 delete();

wait(2);

thread obj3();

}

obj3()
{

obj3 = getent("obj3", "targetname");

objective_add(3, "active", &"streetclearing2_OBJ3",getent("obj3","targetname").origin);

objective_current(3);

obj3 waittill("trigger");

objective_state(3, "done");

obj3 delete();

wait(2);

iprintlnbold (&"streetclearing2_OBJ_COMPLETED"); //Let player know he is done

missionSuccess ("dawnville",false);

 

Thanx for reading, hope you make great Single Player maps!

Check out the download section for this tutorial. http://www.modsonline.com/Downloads-full-5112.html I wrote the wrong name; there should be one more 0. It should be sam_fisher3000. Anyway, you know the file is by me.:D

P.S. This Tutorial can be used for all COD games. 

by sam_fisher3000

 

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

»