Page 1 of 3

Tutorial: Scripting ( all of it )

Posted: Sun May 04, 2003 3:04 pm
by Bjarne BZR
I've hammered together a tutorial on the scripting language that Medal of Honor uses.
It explains all ( well most ) of how the language works and how to use it. Its a large and complex subject, but my hope is that the tutorial is fully understrandable for beginners and veterans alike.

Its a first draft, so please feel free to point out anuthing from missspullengs to facttual errors. Also, if there is a section that you find hard to understand, and have a suggestion on how it could be explained better: Tell me about it! ( Dont just sit there and mumble to your self :wink: ).

Here it is MOHAA scripting language tutorial ( Link updated 2007-07-17 )

Posted: Sun May 04, 2003 3:35 pm
by jv_map
Yippee I've been quoted :D

I've not read through all of it yet, but it sure looks good 8)

Posted: Sun May 04, 2003 3:47 pm
by Bjarne BZR
No wonder jv, you ARE very "quoatable" :wink:

Posted: Sun May 04, 2003 4:37 pm
by Angex
I had a quick scan through, and it seems to explain things well.

Posted: Mon May 05, 2003 12:47 pm
by jv_map
I've read all of it and I must say this is very well done 8)

Just a few minor things (always want to complain):
- You keep writing metod i.o. method :)
- I noticed index a few times instead of local.index
a float has 3 decimals
Hmm actually a floating point value isn't supposed to have a fixed number of decimals :?. But you're right, it prints 2.000.

Anyway you've earned a sticky ;)

Posted: Mon May 05, 2003 5:31 pm
by Bjarne BZR
Metod? I found loads of them in the spellchecker... maby I pressed "Ignore all", instead of "Replace all"... :oops:
index... damn the indexes! Damn them I say!!!!! 2 x :oops:

About these floating point values: What, would be the correct definition? What precision do they have?

If the scripting reference GOD ( That would be you JV ) says its well done; it cant be all crap ( 8) )...

What does the beginners say then? JV does not need a scripting manual, so that he understands it is not surpricing... the real question is if the ones that dont know scripting, but want to learn it, can understand it...

Well... can you?

Don't be afraid to jump in my face! Any comment is a good one!


Sticky? Cool...

Posted: Mon May 05, 2003 6:39 pm
by -Gandalf-
ok, had a go at it ... even though i'm studying what would be called computer science here and i find this actually much easier or downgraded c for me ... the tutorial is very nice and easy to understand ... at least for me ... and all the info is portrayed correctly ...

great work bjarne :wink: 8)

Posted: Mon May 05, 2003 7:05 pm
by nihilo
from a Computer Science major with a few (!) programming classes behind me, I'd say it looks good. Pretty much most of what you need to script is in there, and it all looks correct. So good job, then.

Taken from the MSDN library (so this is more than you'll ever want to know):

"Floating-point numbers use the IEEE (Institute of Electrical and Electronics Engineers) format. Single-precision values with float type have 4 bytes, consisting of a sign bit, an 8-bit excess-127 binary exponent, and a 23-bit mantissa. The mantissa represents a number between 1.0 and 2.0. Since the high-order bit of the mantissa is always 1, it is not stored in the number. This representation gives a range of approximately 3.4E?38 to 3.4E+38 for type float. "

So in other words floating point numbers can store decimal numbers with a huge amount of significant digits, more than you'll want or need. I'm guessing MOHAA defaults to 3 significant digits, or something.

Posted: Mon May 05, 2003 9:23 pm
by TheShiznaeSpe
this is possibly the greatest tutorial ever :D :D :D

-it's a great reference for me as i'm trying to program a new gametype for Trench Rats

thanks man-this is a giant step for the community :D

Posted: Mon May 05, 2003 9:35 pm
by wacko
This surely is one of the most important documents for mappers!

Nevertheless, when I read the titel, I was hoping to get even more :oops:
If you would like to read my thread, you'll probably know what I mean: I don't even know the commands like this rotateXup/rotateXupto, don't know which trigger activates what when and how. And there's still no help for such nOObs like me... Or did I just not find it?

I do not want to say that your documentation is of no use, on the contrary! But it won't help much ppl like me, who know nothing! :cry:

Posted: Mon May 05, 2003 9:53 pm
by Bjarne BZR
Hmmm... good point there Wakco... there is lots of commands that the tutorial/documentation does not cover...

Maby I should add an appendix, listing all commands and what they do?

Problem is: I dont know all the commands and what they do...

Perhaps a "Commands - List them and what they do" thread ( Just as the"Compiling Errors - List 'em and their solutions" thread )...

:?:

Posted: Mon May 05, 2003 10:22 pm
by Surgeon
Go for it : i'm sure we have all the knowledge here between us its just a matter of collating it

Posted: Mon May 05, 2003 10:48 pm
by nihilo
not sure who could make sense of this, but scorpio Midget did a post on the TMT forum with a LOT of information. I can't look at it right now (is the TMT server down?) but it is impressive for sheer amount of info about the engine.

http://www.modtheater.com/forum/showthr ... eadid=2082

Most of that isn't all that useful for scripting (gold for debugging though), but he links to this webpage in his thread:
http://www.duncanweir.co.uk/mohaa/g_allclasses.html
and that page has every variable and class(maybe not every, but alot) you might need. It has rotateXup and rotateXupto, but the way.

Posted: Mon May 05, 2003 11:04 pm
by Bjarne BZR
Lots of food for thought there, thanx!

The g_allclasses.html however is shipped with MOHRadiant in the docs folder ( Great source none the less ). But now that you mention it, I dont reference the file in my tutorial... I should... I will... thanx for pointing!

Posted: Tue Jun 10, 2003 12:22 pm
by FforrestGump
cant we have the tut in a downloadable version so we can view it off line?
i know i could print it off but then thats a lot of paper wastage.
just askin...

Fforrest 8)