Page 1 of 4

Commands - List them and what they do

Posted: Mon May 05, 2003 10:54 pm
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

Posted: Mon May 05, 2003 11:59 pm
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

Posted: Tue May 06, 2003 1:04 am
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

Posted: Tue May 06, 2003 11:09 am
by jv_map
Uhm. There's 1587 commands in mohaa :shock:

more

Posted: Tue May 06, 2003 11:26 am
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).

Posted: Tue May 06, 2003 7:58 pm
by Angex
The spearhead sdk, has a HTML document called "MOH_gameclasses" which I believe lists all of the valid commands.

Posted: Tue May 06, 2003 8:11 pm
by Yarik
So does MOHAA_tools but it doesnt say what each of tehm do does it?

Posted: Tue May 06, 2003 8:28 pm
by Angex
Yes it does: for example;

Code: Select all

IsAlive( Entity ent )
Returns true if the specified entity exists and has health > 0.

Posted: Tue May 06, 2003 9:33 pm
by wacko
this is soo great and soo exactly what I need! Thank you very much, Bjarne, for all the work you do! :D

Posted: Tue May 06, 2003 10:01 pm
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!

Posted: Tue May 06, 2003 11:02 pm
by Bjarne BZR
Appendix A now contains the following sections:

Appendix A wrote:Object manipulation
( Existence, Rotation )
Object status tests
Text printing
Mathematic

Posted: Wed May 07, 2003 2:25 pm
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).

Posted: Wed May 07, 2003 3:58 pm
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.

Posted: Wed May 07, 2003 4:30 pm
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: ).

Posted: Wed May 07, 2003 4:36 pm
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: )

...