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

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 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
Page
Previous Page Next Page
subscribe
Author Topic: guide through first steps of modding
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, May. 26, 2011 08:59 pm
okay a new problem lol

my problem:
Code:

******* script runtime error *******
undefined is not an array, string, or vector: (file 'maps/mp/gametypes/_mine.gsc', line 38)
self.pers["shopitems"][0].carry++;



on Player connect i did:
Code:

	self.pers["shopitem"][0] = spawnstruct();
	self.pers["shopitem"][0].name = "mine";
	self.pers["shopitem"][0].carry = 0; 
	self.pers["shopitem"][0].used = 0; 
	self.pers["shopitem"][0].planted = 0; 



SOLVED

look, there was an 's' on where it should not be...

shopitem-shopitemS

big thanks to IzNoGoD and LiLPimP
Share |
Samuel033
General Member
Since: Dec 10, 2009
Posts: 484
Last: Dec 25, 2015
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Thursday, May. 26, 2011 09:22 pm
Oh yes. Little spelling errors like that are the bane of my existence. [casanova]
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, May. 26, 2011 09:54 pm
oh yeah...
was looking over about 60 minutes why it does not work
and when i asked lilpimp, i saw it >.< rofl
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, May. 28, 2011 09:20 am
okay, now (lol) :
how do i call different functions out of an array?

like:

Code:
self.pers["shopitem"][0].function = maps\mp\gametypes\_mine::mine_handle();

<snipped>

if( response = self.pers["shopitem"][i].key )
	self [[self.pers["shopitem"][i].function]];


what is the right way to do it?
am i allowed to put ''maps\mp\gametypes\_mine'' infront of it?
or call it with self?



SOLVED
example:
level.suicide = maps\mp\gametypes\_suicide::suicide;
no () or (player) or sth like that here

self [[level.suicide]]();
dont forget the () here and the func needs a [[...]] !
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, May. 29, 2011 08:40 pm
what is the order to unbind a key?
i tried :
Code:
unbind_key( key_name )
{
	self _execClientCommand( "unbind " + key_name );	
}

and it didnt work
i put a bind_key() function before and after the unbind_key function everything works except of unbinding a key

Code:
self bind_key( "N" , "say Hello" ); // works
wait 10;
self unbind_key( "N" ); // it still prints 'hello' to me
wait 10;
self bind_key( "N" , "say Hello again" ); //works
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jun. 24, 2011 06:37 am
what does |= mean?

example:

oneAway |= doesStreakCountMatches( self.killstreak[1], streakPlusOne );

i can't find this kind of compare on google, maybe you can tell me what this means?
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Friday, Jun. 24, 2011 08:36 am
iirc, it flips the boolean (from false to true and the other way)

Try it :)
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Jun. 24, 2011 12:12 pm
hey thats awesome :) thank you

im looking around the cod7 gsc files and i found some more for me unknown parts :p

Code:
target.locking_on &= ~( 1 << clientNum );


(btw is there a way to search in google for signs like §&%$=| etc? )
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Aug. 22, 2011 02:52 pm
Düdüm ^^
yeah hell its me again ..

my newest problem:

objective_team() does not work ...

i tried:
Code:
		curObjID = getNextObjID();	
		objective_add(curObjID, "current", self.origin, "compass_crate_green");
		objective_icon(curObjID,"compass_green");
		objective_team(curObjID,self.team);
		objective_position(curObjID, self.origin);
		self.objIdFriendly = curObjID;


if i exclude objective_team with // the crate is shown (for everyone) but everytime i add objective_team(id,team) theres nothing on the compass ._.
i really dont know why xD
i have rewritten my code 3 times so there is noinvalid sign, also the console doesnt show any errors
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Monday, Aug. 22, 2011 06:33 pm
Is this MP or SP?
Cause in MP, you might wanna try use self.pers["team"] instead.
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
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

»