Tutorial: Scripting ( all of it )

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:

Tutorial: Scripting ( all of it )

Post 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 )
Last edited by Bjarne BZR on Tue Jul 17, 2007 9:20 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 »

Yippee I've been quoted :D

I've not read through all of it yet, but it sure looks good 8)
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

No wonder jv, you ARE very "quoatable" :wink:
Admin .MAP Forums
Image
Head above heels.
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post by Angex »

I had a quick scan through, and it seems to explain things well.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 ;)
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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...
Admin .MAP Forums
Image
Head above heels.
User avatar
-Gandalf-
Sergeant
Posts: 57
Joined: Sat Feb 22, 2003 9:45 pm
Location: Argentina - BS AS
Contact:

Post 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)
Image
nihilo
Sergeant Major
Posts: 107
Joined: Thu Mar 13, 2003 6:07 am

Post 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.
TheShiznaeSpe
Major
Posts: 304
Joined: Wed Feb 05, 2003 11:45 pm
Location: US
Contact:

Post 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
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post 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:
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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 )...

:?:
Admin .MAP Forums
Image
Head above heels.
Surgeon
Site Admin
Posts: 1386
Joined: Tue Jun 04, 2002 1:15 am
Location: Stirling, Scotland
Contact:

Post by Surgeon »

Go for it : i'm sure we have all the knowledge here between us its just a matter of collating it
Admin
Image

.map Forums

Truth and Honor.
nihilo
Sergeant Major
Posts: 107
Joined: Thu Mar 13, 2003 6:07 am

Post 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/showthread.php?s=&threadid=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.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post 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!
Admin .MAP Forums
Image
Head above heels.
FforrestGump
Lance Corporal
Posts: 17
Joined: Fri May 23, 2003 1:15 pm

Post 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)
Post Reply