Scripting List?

Tutorials for Call of Duty mapping

Moderator: Core Staff

The Hughe
CJ Wannabe
CJ Wannabe
Posts: 22
Joined: August 28th, 2005, 10:08 am

Scripting List?

Post by The Hughe » April 3rd, 2006, 11:25 am

Hey all,

I am wondering if there is some kind of manual or a tutorial or something that looks like these for scripting.
I want to have all the scripting "commands" on a list .. so i can experiment a bit

Though i can look for some gsc files and what they are doing ... but sometimes i dont really think i fully understand it .. i can copy past and make a simple clue on what it does but i dont want that anymore :shock: (it is too easy :P)

So what i am asking is a "command" list for scripting ..... If there is any (i havnt found any)

This is all i found i don't think it is enough for me :P

http://www.modsonline.com/Tutorials-read-282.html
http://www.modsonline.com/Tutorials-read-242.html
http://www.modsonline.com/Tutorials-read-121.html (i am looking for something like this .. alot of information on the parameters)

i am not planning to make a map but i like to know something more about it .. for the future :wink:

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 3rd, 2006, 11:40 am

Can I suggest something that will really help (I believe Leveller will also agree with this). Start with C.

C is the base of CoD Script. What I know I have learnt from many areas, Books (C for Dummies), Mods (Loads) and general trial and error (persistance).

There are many places you can learn 'C' just use google [click for tuts].

Other than that, this is a list of commands i found on IWNation...

Code: Select all

PlaceSpawnPoint()
DisableGrenadeBounce(
EnableGrenadeBounce(
DisableGrenadeTouchDamage(
EnableGrenadeTouchDamage(
GetEntityNumber(
SetBottomArc(
SetTopArc(
SetLeftArc(
SetRightArc(
LocalToWorldCoords(
ViewKick(
StopShellShock(
ShellShock(
SetHintString(
SetCursorHint(
SetContents(
Hide(
Show(
SetNormalHealth(
GetNormalHealth(
SetModel(
Delete(
StopLoopSound(
PlayLoopSound(
PlaySound(
IsDoorLocked(
UnlockDoor(
LockDoor(
IsTouching(
UseBy(
GetEye(
GetOrigin(
EnableLinkTo(
Unlink(
LinkTo(
GetAttachIgnoreCollision(
GetAttachTagName(
GetAttachModelName(
GetAttachSize(
DetachAll(
Detach(
Attach(
Prof_End(
Prof_Begin(
SetArchive(
MakeCvarServerInfo(
AddTestClient(
ExitLevel(
PrecacheHeadIcon(
PrecacheStatusIcon(
PrecacheMenu(
GetStartTime(
PositionWouldTelefrag(
Obituary(
WorldEntNumber(
LogPrint(
Objective_Team(
GetTeamPlayersAlive(
UpdateClientNames(
SetClientNameMode(
SetTeamScore(
GetTeamScore(
ClientAnnouncement(
Announcement(
SetWinningTeam(
SetWinningPlayer(
IsPlayerNumber(
IsPlayer(
ResetTimeout(
NewTeamHudElem(
NewHudElem(
Earthquake(FLOAT pwr, INT time, VECT origin, INT radius);
GetPartName(
GetNumParts(
SetPlayerIgnoreRadiusDamage(
RadiusDamage(
GrenadeExplosionEffect(
SetExpFog(density, red, green, blue, transition_time)
SetCullFog(near,far,r,g,b,time)
PlayLoopedFX(
PlayFXonTag(
PlayFX(
LoadFX(
PrecacheString(
PrecacheShader(
PrecacheItem(
PrecacheShellShock(
PrecacheModel(
AmbientStop(FadeTime)
AmbientPlay(
SoundFade(
MusicStop(
MusicPlay(
AnglesToForward(
AnglesToRight(
AnglesToUp(
VectorToAngles(
VectorNormalize(
VectorDot(
Closer(
LengthSquared(
Length(
DistanceSquared(
Distance(
aTan(
aCos(
aSin(
Tan(
Cos(
Sin(
RandomFloatRange(
RandomFloat(
RandomIntRange(
RandomInt(
GetAngleDelta(
GetMoveDelta(
BulletTrace(
Objective_Current(
Objective_OnEntity(
Objective_Position(
Objective_Icon(
Objective_State(
Objective_Delete(
Objective_Add(
GetBrushModelCenter(
AnimHasNoteTrack(
GetAnimLength(
GetWeaponClassName(
GetWeaponModel(
GetEntByNum(
GetTime(
SetCvar(
GetCvarFloat(
GetCvarInt(
GetCvar(
IsAlive(
IsDefined(
Assert(
SpawnStruct(
PrecacheTurret(
SpawnTurret(
GetEntArray(
GetEnt(
Line(
Print3D(
PrintLN(
Print(
Map_Restart(

--

Spawn(
iPrintLnBold(
iPrintLn(

--

Destroy(
Reset(
MoveOverTime(
ScaleOverTime(time s, new_width, new_height)
FadeOverTime(
SetValue(
SetClockUp(
SetClock(
SetTenthsTimerUp(
SetTenthsTimer(
SetTimerUp(
SetTimer(
SetShader(
SetText(
There are more I believe, but without IW giving us some support, this is what was able to come up with.

Most of these you will probably never use, especially on a map. Anyways, have fun learning, and any help, I'm sure one of the few scripters here can help you.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 3rd, 2006, 11:42 am

This is sorta the same, but has some "references"...

Code: Select all

Conventions:
array -> array
entity -> ent
vector -> v
int -> i
float -> f
string -> s
bool -> bool
item -> item
argList -> argList (argument list [example is C printf function])

returnvalue function( arguments )

Unknown arguments are specified as a question mark, prefixed with the data type. For example, s? is for an unknown string.

CODE

-=CoDScript Functions=-
array getEntArray( array, s? )
ent  getEnt( sName, s? )
?  sayAll( sText )
?  sayTeam( sText )
int  randomInt( iMaxNum )
?  logPrint( sText )
?  println( sText, argList )
string getCvar( cvar )
int  getCvarInt( cvar )
float getCvarFloat( cvar )
?  setCvar( cvar, sText )
?  setClientCvar( cvar, sText )
?  makeCvarServerInfo( cvar, sText )
?  precacheModel( sModel )
?  precacheString( stringalias )
?  precacheMenu( menu );
?  precacheShader( sShader )
?  precacheItem( item )
?  precacheHeadIcon( sIcon )
?  precacheStatusIcon( sIcon )
bool positionWouldTelefrag( vePosition )
vector distance( vStart, vEnd )
?  placeSpawnPoint()
?  setArchive( bool )
?  setClientNameMode( mode ) // mode = "auto_change", "manual_change"
bool isPlayer( ent )
?  obituary( entWho, entAttacker, sWeapon, sMeansOfDeath )
?  clientAnnouncement( entWho, sText, argList )
?  announcement( sText, argList )
int  getTeamScore( sTeam )
?  setTeamScore( sTeam, iScore )
?  resetTimeout()
bool isDefined( ent )
?  wait( fTime )
?  exitLevel( bool )
?  map_Restart( bool )
float getTime()
bool isAlive( ent )
?  loadFX( sFX )
?  playFX( FX, vOrigin )
?  radiusDamage( vOrigin, fRange, iMaxDamage, iMinDamage )
?  objective_Add( iNum, s?, vOrigin, sImage )
?  objective_Delete( iNum )
?  objective_Position( iNum, vOrigin )
?  objective_Team( iNum, sTeam ) // "none" for no team
?  objective_Icon( iNum, sName )
?  objective_OnEntity( iNum, entWho )
?  bulletTrace( v?, v?, b?, ? )


-=Entity Functions=-
?  playSound( soundalias )
?  playLocalSound( soundalias )
?  playLoopSound( soundalias )
?  pingPlayer()
?  giveWeapon( weaponname )
?  giveMaxAmmo( weaponname )
?  setSpawnWeapon( weaponname )
?  setWeaponSlotWeapon( sSlot, weaponname )
?  setWeaponSlotAmmo( sSlot, iAmmo )
?  setWeaponSlotClipAmmo( sSlot, iAmmo )
?  switchToWeapon( weaponname )
?  delete()
int  getEntityNumber()
?  finishPlayerDamage( entInflictor, entAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc)
?  dropItem( item )
item getCurrentWeapon()
item getWeaponSlotWeapon( sSlot ) // "primary", "primaryb"
?  clonePlayer()
?  spawn( vOrigin, vAngle )
bool useButtonPressed()
?  openMenu( menu )
?  closeMenu()
?  linkTo( ent )
?  unlink()
?  setModel( sModel )
?  stopLoopSound()
?  isLookingAt( ent )
vector getOrigin()
?  suicide()
?  iPrintln( sText, argList )
?  iPrintlnbold( sText, argList )
?  moveTo( vWhere, fSpeed, f?, f? )
?  show()
?  hide()
?  waittill( sFlag, argList )
?  notify( sFlag, argList )
?  endon( sFlag, argList )


-=Hud Functions=-
hud  newClientHudElem( entPlayer )
hud  newHudElem()
?  setText( localizedString )
shader setShader( shader, iWidth, iHeight )
?  setTenthsTimer( fTime )
?  setTimer( fTime )
?  scaleOverTime( fTime, iWidth, iHeight )
?  fadeOverTime( fTime )


-=Hud Variables=-
archived // bool
x   // float
y   // float
alignX  // "left", "center", "right"
alignY  // "top", "middle", "bottom"
font  // string
fontScale // float
sort  // int
alpha  // float


-=player Variables=-
firstTime  // qTrue, qFalse
deaths
score
spamdelay
headicon
oldheadicon
headiconteam
sessionteam
sessionstate
statusicon
spectatorclient
archivetime
reflectdamage
maxHealth
health
spawned
pers[
"team"
 "allies"
 "axis"
 "spectator"
"savedmodel" :: Function pointer
"weapon"
"weapon1"
"weapon2"
"spawnweapon"
   ]


-=Game array=-
["axis"]
"german"
["allies"]
"american"
"british"
"russian"
["allies_model"] :: Function pointer
["axis_model"] :: Function pointer
["american_soldiertype"]
"airborne"
["american_soldiervariation"]
 "normal"
 "winter"
["british_soldiertype"]
"airborne"
"commando"
["british_soldiervariation"]
 "normal"
 "winter"
["russian_soldiertype"]
"conscript"
"veteran"
["russian_soldiervariation"]
 "normal"
 "winter"
["german_soldiertype"]
"wehrmacht"
"waffen"
"fallschirmjagercamo"
"fallschirmjagergrey"
"kriegsmarine"
["german_soldiervariation"]
 "normal"
 "winter"
["state"]
"playing"
"intermission"
["layoutimage"]
["menu_viewmap"]
["menu_callvote"]
["menu_quickcommands"]
["menu_quickstatements"]
["menu_quickresponses"]
["matchstarted"]
["roundsplayed"]
["gamestarted"]
["alliedscore"]
["axisscore"]
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Post by leveller » April 3rd, 2006, 4:30 pm

Drofder2004 wrote:Can I suggest something that will really help (I believe Leveller will also agree with this). Start with C
lol, i never learned C, everything i know comes from eg :"pascal" "Delphi" "java script" "php" "assembly" ......
and most important of all. Good common sence, and a understanding what programming and or scripting is, and means.

i always start by just trying, trying, trying...., hm it didnt work, what could be wrong, can't be me i know it all. (yea right).

next i try to extract everything there is to extract from the files i have for the game,
and start scanning for every bit of text i can find , s@dm@n is a great program for it.

ill start looking at the scripts that are there, and with a bit of logic, most of the time i understand what it means or does.

and i'll try to find every forum that is on the net, join and read.. read... and read more.
and not only about scripting it self, but about the entire game and its engine, and every game wich can be linked to the game,
like cod--->quake--->wolfenstein--->.....

and for the rest, its all trial and error, over and over again, untill i get wat i want, and (more important) how i want it.

though i could be handy to have a complete list of codes, it almost never works for me,
i like to see it in a total package, so i can see what the code is doing in relation to the rest of the codes.

dont know if its help you any, but atleast you know how i go about things.


.

leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Post by leveller » April 3rd, 2006, 4:58 pm

a litle bit of advice.

the first thing i try to do is the famouse: "Hello world", its aways a good starting point.

and when you try something, try to keep your script simple and small.

and add alot of "iprintlinbold" to your script, or anything that is visual and you know for a fact that it works.

i sometimes forget to do that, and im looking at a piece of script, while the real problem lies somewhere earlier in the script.


.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 3rd, 2006, 5:06 pm

leveller wrote:lol, i never learned C, everything i know comes from eg :"pascal" "Delphi" "java script" "php" "assembly" ......
and most important of all. Good common sence, and a understanding what programming and or scripting is, and means.
D'Oh :P

Well, trust me then... C is a good place to start (I actually started with VB6, but C is best :P)
leveller wrote:a litle bit of advice.

the first thing i try to do is the famouse: "Hello world", its aways a good starting point.

and when you try something, try to keep your script simple and small.

and add alot of "iprintlinbold" to your script, or anything that is visual and you know for a fact that it works.

i sometimes forget to do that, and im looking at a piece of script, while the real problem lies somewhere earlier in the script..
Thats definitly the best advice...

Everyone should start with the hello world...
And as for the "iprintlnbold", that is the best thing scripting has to offer! I put one of them at nearly every section of my script so I now when each script runs and what should be running.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 3rd, 2006, 7:10 pm

KillerSam wrote:hello world? am i missing something?
lol.

Near enough every computer languages tutorial starts with a "Hello, World!" program. Basically, it is a program that prints Hello,World on your screen.

(I have seen some tutorials use "Goodbye, Cruel World" also :P)

Check this :P
http://en.wikipedia.org/wiki/List_of_he ... d_programs
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » April 3rd, 2006, 8:57 pm

lol, thats alot!
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

The Hughe
CJ Wannabe
CJ Wannabe
Posts: 22
Joined: August 28th, 2005, 10:08 am

Post by The Hughe » April 3rd, 2006, 10:38 pm

Hey all,

Thanks for all the information you all give me.
I am considering to start with C ..
i used VB6 (Visual Basic 6) aswell .. but i got very bored i didnt have any idea's for making something usefull.. i also have two books of Java 2 .. but reading is not my best point :P so when i was on page 600 i quit again with it for the same reason as VB6
I also did something with HTML 4 .. i believe that is old but still works :P .. now they are using PHP for websites i think. (all of this i did 6 years ago .. when i was a boy of 12 years old .. hmm i used to know alot of pc playing with DOS and Windows Tulp and my first "pc" MSX i think it was a gaming console with keybord :? playing with 2d platforms lemmings pacman etc .. now i hardly don't know anything .. Good old times :D )

With VB6 i have used a book and the programm itself (very easy draw button add command to it :P even a kid can do it :P).. with Java 2 i hardly made any of the programms just reading ..

I remember me making the Hello World program :P funny :wink: i remember more programs .. lucky7 etc :P anyway i will give a shot with C .. it is almost the same as C++ right?

I am going to bed for now .. i am going to dream about it :P and tomorrow i will look to the tutorials :D

lol before i wanted to post i saw a book of Basic .. an old book from my grandpa .. i think that started my interest in VB6 :P My grandpa was very handy in pc's .. till Windows 95 came .. he is getting old .. it is going too fast for him :P .. Today he is 50 years married .. nice day .. in an old steam locomotive and after that pancakes :D
anyway ..
good night

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » April 3rd, 2006, 10:52 pm

Good stuff, i've always been interested in this stuff but never really tried to learn it. I started reading a free tutorial i got from here http://www.geocities.com/naif_2pac/cpp.htm (Teach yourself C in 21 days) which seems pretty good so far...

In the tut it says basically C++ and java are based on C, and C++ is a superset of C...so i guess C is the best place to start :P

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » April 3rd, 2006, 11:47 pm

This looks to be an excellent topic, i think its safe to say

/stickied

Guest

Post by Guest » April 4th, 2006, 6:54 am

Thanks

Tonight i will start with my first lesson :P

The Hughe
CJ Wannabe
CJ Wannabe
Posts: 22
Joined: August 28th, 2005, 10:08 am

Post by The Hughe » April 4th, 2006, 5:20 pm

Hmm .. which compiler do you use for C?

atm i am using Dev-C++ i heard of someone i my class said it is fine compiler
downloadable on
http://www.bloodshed.net/dev/devcpp.html

but i think it is too extended .. maybe there is something for simple in use
(sorry for the bad grammar i think that i use .. i wish i am better at English in class :P)

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » April 5th, 2006, 1:42 am

The Hughe wrote:Hmm .. which compiler do you use for C?

atm i am using Dev-C++ i heard of someone i my class said it is fine compiler
downloadable on
http://www.bloodshed.net/dev/devcpp.html

but i think it is too extended .. maybe there is something for simple in use
(sorry for the bad grammar i think that i use .. i wish i am better at English in class :P)
I personally use Microsoft Visual Studio 6, but I believe Dev-C++ is the best "free" software.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

The Hughe
CJ Wannabe
CJ Wannabe
Posts: 22
Joined: August 28th, 2005, 10:08 am

Post by The Hughe » April 5th, 2006, 7:18 am

K .. do you think that is better than Dev-C++ because i have Microsoft Visual Studio 6 aswell .. i Found it in my box together with Visual Basic 6 :wink:
The name was familiar to me so i did take a look :P

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests