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

Members Online

»
0 Active | 24 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

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 2
Category: CoD2 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page
subscribe
Author Topic: When making maps, can ur teammates never die?
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Tuesday, Nov. 27, 2007 10:47 pm
Thx you guys for trying to help me. TexasRebel, I need help for scripting more than one gsc file. Wut do I need to put for the first gsc file and the second one. For example, the infinite health team and the friendly chain script thingy. Wut do I need to put in both gsc file? Also I need to know for other scripting too like tank scripting, etc. In english, (if I am not making sense) For any type of scripting, I will need to help more than one gsc file. When I have more than one gsc file, wut things do I need to put in for each of the gsc file. That's my problem. I do not know wut to put in. BTW, u guys can keep posting but I wont be back on ModsOnline until tomorrow b/c I have to go somewhere for the night. Keep on posting to help me and I will hear from u tomorrow. Thx you.


P.S. My name is not really sam, lol, I just used it as a username for the site.
Share |
Scratchy
General Member
Since: Feb 10, 2006
Posts: 276
Last: Mar 16, 2009
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Wednesday, Nov. 28, 2007 02:00 am
Ok look. You have your Maps GSC, which is named after your map, and is runned when your map is runned. You make another GSC (name it watever you want to) and then call it from your Maps GSC. So here i what it should look like...

Code:
main()
{
maps\_load::main();
maps\mp\magic::main(); //<--This calls for the second GSC

level.player takeallweapons();
level.player giveWeapon("m1carbine");
level.player giveWeapon("thompson");
level.player giveWeapon("fraggrenade");
level.player switchToWeapon("thompson");

}


^^This one is named after your map^^

Now you have a second GSC file named magic and in it is this...

Code:
main()
{
thread ally_nodamage();
}

ally_nodamage()
{
allyteam =getentarray ("ally", "targetname");

for(i=0;i<allyteam.size;i++)
allyteam thread maps\_utility::magic_bullet_shield();
}


^^This is quoted from my previous post. Couldnt be more straight foward than that^^
Share |
TexasRebel
General Member
Since: May 1, 2006
Posts: 373
Last: Aug 20, 2013
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Wednesday, Nov. 28, 2007 03:09 am
Ok let me try to help ya understand some of the scripting structure.

Every GSC/program must have a Main Function which can be recognized as

Main()
{
.
.
.
}

There can be simple code inside those brackets, like giving and taking away weapons. Or you can go on and put all your script inside the main function although it is considered bad organization.

To make scripting easier, you are able to make your own functions which will look like:

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

you can either create a new gsc to hold the code for this simple snippit of code or write this function outside the main() function.

Example:

Code:

main()
{  <------- Start of Main Function
maps\_load::main();

level.player takeallweapons();
level.player giveWeapon("m1carbine");
level.player giveWeapon("thompson");
level.player giveWeapon("fraggrenade");
level.player switchToWeapon("thompson");
thread ally_nodamage();   //  executes user created function 
}  <----- End of Main Function


ally_nodamage()   // function created by user to keep AI alive
{  <------ Start of User created Function
//creates new variable and makes it an array to hold entities with     the name ally.
allyteam =getentarray ("ally", "targetname"); 
for(i=0;i<allyteam.size, i++)
{
allyteam thread maps\_utility::magic_bullet_shield();
}
}<---- End of User Created Function



edited on Nov. 27, 2007 10:13 pm by |TM|TexasRebel
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Wednesday, Nov. 28, 2007 09:20 pm
Thx guys, I understand a bit more about scripting. I do have one question for Scratchy.

You said:

main()
{
maps\_load::main();
maps\mp\magic::main(); //<--This calls for the second GSC


The second line after the bracket, which is maps\mp\magic::main();

There is a mp in there after maps. Doesnt mp refers to the mp folder which is multiplayer? If it does then do I need to put it in the mp folder or not even tough the map itself is SP.

So, let me see if I know scripting or not. The first GSC file is to put all the words that starts with main and anything that has to do with main. At the bottom, I include the weapons codes, but I dont have to include it. The second GSC file is everything else but it has to be related to one of the main codes from the first GSC file. If there are more than two GSC files, I do the same thing as the second GSC file I mentioned above. So as a refresher, the first GSC file contains all the words main or anything that has to do with the main codes. The first GSC file also includes weapons codes but not neccessary. The second GSC file have to be related to one of the main codes from the first GSC file. The third GSC file is the same as well.

So did I get it? Also does the number of spaces between codes matters in one GSC file?

Is it just me or is it the game or the map? The map doesnt work and says "Script Compile Error"? Did I make a mistake or is it the map or the game? I copy the exact codes and made 2 GSC files. I even give my teammates the name "ally". Wut is wrong?



edited on Nov. 28, 2007 04:34 pm by sam_fisher3000
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 MP Mapping
Posted: Wednesday, Nov. 28, 2007 10:00 pm
1) the mp is for MP map, yes.. since your map is for SP,

maps\magic::main();

should be good.. just place your magic.gsc file in the maps folder, along with your .bsp and your map. gsc file

2) I don't understand a word of what you said... read the getting started in scripting tutorial in the CoD1 tutorial section.. maybe that will explain it.

3) The number of spaces shouldn't matter.

4) Pull down your console by holding the shift and ~ keys. This will tell you more about the error. Post what it says exactly along with your .gsc file(s).
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Wednesday, Nov. 28, 2007 10:23 pm
lol, I thought I made it clear. I guess not...I did get a C+ or 69% in english so....(Dont think I am dumb).


Let me make it clear. The first GSC file is all the main stuff. (codes that has main). It also includes weapons code. The second GSC file is related to one of the main codes from the first GSC file. Like Scratchy said,

"maps\mp\magic::main(); //<--This calls for the second GSC"

The second GSC file has to be related to it. U can have as many file as u can and it has to be related to one of the main codes in the GSC file.

I can have as many GSC files as I want but the first GSC file has to call the rest of the GSC files.


Clear now? If not, then, I dont know wut to say.
Share |
Restricted Access Topic is Locked
Page
Previous Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP 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

»