Commands - List them and what they do

Post your scripting questions / solutions here

Moderator: Moderators

Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Commands - List them and what they do

Post by Bjarne BZR »

Basically this thread it a place to gather together all the known scripting commands and to describe what they do.

This will then become an appendix to the complete reference on "MOH scripting" found here. Ok, maby not complete, but a big step up.
Here is Appendix A ( Commands ) as it looks now.

What were looking for here are all the nifty commands that is really not very explained anywhere ( If yove got a link to a place that DOES explaine commands, please post them also ), like:

What does rotateXdown do?
What does hide do?
What does spawn do?
What does all the strange commands that I find in Gen. Cobra's scripts do? :wink:

If you use this format, it will be a lot easier for me to add it to the list, because this is the format I currently use:

Command: Name of the command.
Syntax: Any special parameters or variants of the command is described here.
Example: A code snippet exemplifying how to use the command.
Description: A textual description of the command. When best to use it. When not to use it. Dark secrets and government conspiracy linked to the command.

/B-man
Last edited by Bjarne BZR on Mon May 01, 2006 8:15 pm, edited 3 times in total.
Admin .MAP Forums
Image
Head above heels.
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post by TheShiznaeSpe »

Hide: this command hides an object so that it is invisible to the player, but still solide
Show: this just shows a hidden object
Remove: removes an object from the map-this means it is gone and is no longer there

isAlive: checks to see if something is alive
isTouching: checks to see if something is touching the object

ummm....this is just off the top of my head, i'll post more later
Last edited by TheShiznaeSpe on Tue May 06, 2003 2:04 am, edited 1 time in total.
Yarik
General
Posts: 1031
Joined: Thu Jan 09, 2003 7:12 pm
Contact:

Post by Yarik »

Bjarne... Thats a great tutorial. I SUCK at scripting. And this kind of tut will get me somewhere other then asking questions at this forum
Skype: Yarik_usa
www.skype.com <---free pc2pc phone
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Uhm. There's 1587 commands in mohaa :shock:
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

more

Post by tltrude »

iprintln "text" : prints a message on the leftside of the screen in yellow (no clicking).
iprintlnbold_noloc "text" : prints a message on the leftside of the screen in bold white (with a click sound).
Tom Trude,

Image
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post by Angex »

The spearhead sdk, has a HTML document called "MOH_gameclasses" which I believe lists all of the valid commands.
Yarik
General
Posts: 1031
Joined: Thu Jan 09, 2003 7:12 pm
Contact:

Post by Yarik »

So does MOHAA_tools but it doesnt say what each of tehm do does it?
Skype: Yarik_usa
www.skype.com <---free pc2pc phone
Image
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post by Angex »

Yes it does: for example;

Code: Select all

IsAlive( Entity ent )
Returns true if the specified entity exists and has health > 0.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

this is soo great and soo exactly what I need! Thank you very much, Bjarne, for all the work you do! :D
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

The 2 files ( g_allclasses.html & MOH_GameClasses.html ) does look as they contain a lot ( all? ) of the commands... the problem is that the descriptions are not very complete or easy to understand....

...so keep posting your favoite commands!
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Appendix A now contains the following sections:

Appendix A wrote:Object manipulation
( Existence, Rotation )
Object status tests
Text printing
Mathematic
Last edited by Bjarne BZR on Mon May 01, 2006 8:19 pm, edited 1 time in total.
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Now the documentation in g_allclasses.html is sometimes not very helpful, but in an attempt to rewrite this documentation it's important to use correct information this time ;).

I found this in the very first command description, hide
This command hides an object so that it is invisible to the player. The object still exists in the world and is still solid... its just invisible. if it is already invisible, nothing happens.
The 'hide' command really involves more. It means the entity is not even sent to client machines (which means they have to be not solid).

A problem turns up at the 'moveto' command, since multiple classes use the same command for different purposes. Apart from the scriptslave moveto you mentioned in the tutorial, there's also a command for AI actors:
g_allclasses.html#actor wrote:moveto( String anim, String dest )
Specify the location to move to, with animation anim.


Moreover the examples of some 'operator commands' are wrong.

Code: Select all

if ( ! $vip_player isAlive )
{
   teamwin axis
}

should be

Code: Select all

if !(isAlive $vip_player)
{
   teamwin axis
}

Code: Select all

if ( ! $player[local.index] isTouching $it)
{
   teamwin axis
}

should be

Code: Select all

if !($player[local.index] isTouching $it)
{
   teamwin axis
}

Since the ! was placed before the targetname operator $, which is not allowed.

A result of the confusing syntaxis notation of both g_allclasses.html and your tutorial:

Code: Select all

sighttrace ( 20, 30, 3045 ), ( 0, 0, 0 ), 1

should be

Code: Select all

sighttrace ( 20 30 3045 ) ( 0 0 0 ) 1

The pass_entities sets if entities should be included in the trace calculation or be counted as 'invisible'.

Well not exactly, it sets the number of entity bounding boxes that are assumed to be invisible (weird). Mins and maxs set the bounding box within the sighttrace is performed to save CPU usage. (see also setsize command)
At iprintln you wrote:Prints a message on the left side of the screen in yellow ( no clicking sound ) followed by a line break. Bold version uses a bold font.

The bold version uses the same font, but in white and clicking.
Returns the absolute value of the parameter. abs 15.3 returns 15. abs 2 returns 2. abs 5.99999999 returns 5.

No! You're confusing abs with int :?. abs 15.3 is just 15.3, abs -15.3 is also 15.3. It turns all negative values into positives.

Well all this rant is not meant to run down on you or discourage you in continueing this great effort, but to speak out a major word of doubt when it comes to the possibility of completing this project (so many commands to discuss) as well as of the scripting value of the document (wrong explanations are useless) and the layout (no classes).
Image
Parts
Sergeant
Posts: 72
Joined: Thu Apr 10, 2003 12:35 pm
Location: UK
Contact:

Post by Parts »

The SDK documentation leaves off some useful stuff in my opinion.

e.g. you won't find $player waittill death

And where a variable can contain a set list of values they are not available. Is there another way ot get them?

e.g. WeaponClass, MeansOfDeath etc

Also any guides on how to set threads waiting for events and then pick up the parametes. e.g. every entity has a damage event. How do you pick up this damage event and look at the parameters set by it? I could have a good guess but it's not in the documentation.
[VS-UK]Capt.Parts[BnHQ]
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

JV, you are not discourageing me in any way, quite the opposite. Your the one that makes it possible at all.
Why am I writing this at all? You should do this! :wink:

The classes have not been reflected so far: this will change as the document so far is a rough draft. And I'm not going to add all comands, just the most common ones ( the ones that people actually have a practical use use for in the beginning... ).

Million thanx for your proofing JV. Hope to have you brething down my neck in the next stages to...( no not that way, pervert :wink: ).
Admin .MAP Forums
Image
Head above heels.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

No Parts, the g_allclasses.html does not mention $player waittill death directly, but it mentions that Player is a child of the Listner class, and as such inherits the waittill ( String event ) command... and one event is "death" ( No idea where this is mentioned ).

So the info is there, its just very hard to find if you dont know what to look for ( Few people have any idea what to lookfor, I know I don't most of the time :cry: )

...
Admin .MAP Forums
Image
Head above heels.
Post Reply