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

Members Online

»
0 Active | 95 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Read this before posting scripting questions please
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Friday, Nov. 10, 2006 03:24 pm
Can an Admin please make this post sticky?
I think it's an important reminder.



Posters, please specify in your scripting related questions the type of map you are referring to.

Single or Multi player

In scripting the difference in the two game types is massive
and many commands are not usable for both game types.

This will stop a lot of confusion and frustration for people good enough to reply to your questions.

Thank You
Happy Mapping
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Nov. 18, 2006 01:39 am
Made sticky. Also please add any other common question you see often in the forums here.
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Saturday, Nov. 25, 2006 11:28 pm
How to put code in these forums the right way.

You have to be very careful when posting code into forums, most forums have control codes for things like italic text, bold text, etc etc
One of the control codes that causes many problems with script code is the italics code [ i ]
Note the spaces either side of the "i" in the braces make it undetectable to the forum.

A lot of script code is written without spaces to save space,
For example you will often see this type of line in many scripts.

players[ i ] thread do_something();

If I do it again without spaces I will change some of the code to italic letters and the [ i ] will vanish like so.

players thread do_something();


Another character used in script code a lot is the less than character <
Unfortunately in a lot of forums this character will cause problems if it has no spaces either side of it.

Now lets use a piece of actual script code as an example inside a "code quote" box. This is how the script code should look!

Code:

number_of_specs = 0;
for (i=0 ; i<players.size ; i++) {
	player = players[i]
		if (player.pers["team"] == "spectator")
			number_of_specs ++;
		else
			number_of_specs --;
}


Notice we have used BOTH "[ i ]" & " < " the common characters that cause most of the problems.
If I just paste the above text in here not using the "code quote" box see what happens.

number_of_specs = 0;
for (i=0 ; i player = players
if (player.pers["team"] == "spectator")
number_of_specs ++;
else
number_of_specs --;
}


The script code above is useless and will create an infinite number of posts by frustrated people asking what's wrong with their script.

So.... Please ALWAYS use the code quote option to post script code in forums.
You can't miss it, it's the button right under the ITALIC button!
Just select all your code in the edit window and click on the CODE button.

Hope this explains clearly what's happening.
Regards Grassy



edited on Nov. 26, 2006 01:32 am by WHC_Grassy
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

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

»