You must be logged in to post messages.
Please login or register

Modding and Scripting
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Master XS - Setup
« Previous Page  1 2  Next Page »
posted 25 July 2008 10:15 AM EDT (US)   
Master XS
Hello and Welcome to our the very first chapter of Master XS - Setup.

This is a project that will result in fully scaled e-book covering every possible topic we know about XS. It is going to be written by Mythic_Freak and me. It will have a steady income of 2 articles each week.

What will be covered in Setup Chapter?
    Prerequisites
    Configuring AoM
    Programs and Tools

So what is XS?
The letters stand for eXternal Subroutine. Which is a name that Perl uses to refer to code that is programmed in C/C++ language. In AoM, XS is a cut down version of C++, that is used throughout the game, present in Triggers, AI, RM, and even Victory Conditions - used to control a supremacy game, where you can win by Wonder/Settlements.
It is much more powerful than any Age Of Empires language previously had. But with great power, comes great ... well... tedious amount of work. I shall warn you now, great part of your time will be testing and debugging code! However, you can reach a level of freedom that only a few have. .


> Navigation Panel <   



- Setup -
Prerequisites
Configuring AoM
Programs and Tools
Next Chapters (subject to changes as we see fit) ->
  • XS Basics
  • XS Advanced
  • Triggers
  • RMS Basics
  • AI
  • So far the boring stuff... let's get started.
    -invent00r

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.

    [This message has been edited by invent00r (edited 08-22-2008 @ 12:56 PM).]

    Replies:
    posted 27 August 2008 08:48 PM EDT (US)     26 / 38  
    I hope you dont mind, but I pdfed this chapter

    Here

    ||||||||||||||||My Videos||||||||||||||||
    Roxas, his heart was human, yet because of his status as a being his fate was sealed since he was born. How many times must humanity judge others like that as well without giving them a fair chance?

    "It would be very irresponsible of me to give you my thoughts as you are clearly incapable of handling the ones you already have" ~some guy in OD
    posted 27 August 2008 11:12 PM EDT (US)     27 / 38  
    Roxas I think you can help to PDF all the existing chapters and later chapters into a whole after invent00r and Mythic_Freak finished posting all the tutorals,including also some attached files. maybe you can named the PDF book "AOM Professional Development Guide". Of course you should not neglect the copyrights.HAHA. only if the authors permit.
    posted 27 August 2008 11:26 PM EDT (US)     28 / 38  
    We'll see what they say

    ||||||||||||||||My Videos||||||||||||||||
    Roxas, his heart was human, yet because of his status as a being his fate was sealed since he was born. How many times must humanity judge others like that as well without giving them a fair chance?

    "It would be very irresponsible of me to give you my thoughts as you are clearly incapable of handling the ones you already have" ~some guy in OD
    posted 28 August 2008 06:18 AM EDT (US)     29 / 38  
    Oops, forgot to check this thread in a while.

    Anyway, thanks for the effort you put into this, but it probably still needs a few changes before we turn this into a "book". Smileys in a book are awkward, and it's probably weird to read how we refer to the next chapter being prepared etc.

    It also needs some updates in the content itself, since we created a better versions of the xTriggers.xs file etc. (You're pdf doesn't support links )

    We still have to discuss how we will handle this (pdf/html or both), but if you want to help us with the final pdf you're welcome. ^^

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak

    [This message has been edited by Mythic_Freak (edited 08-28-2008 @ 06:20 AM).]

    posted 28 August 2008 08:41 AM EDT (US)     30 / 38  
    If you pick HTML over PDF, then I got your back :O.
    posted 28 August 2008 08:50 AM EDT (US)     31 / 38  
    Mythic, sure I'd love to help ^_^..

    Besides all I did was copy and paste it, fix the formatting and spelling, and made it slightly easier to read on the eye

    ||||||||||||||||My Videos||||||||||||||||
    Roxas, his heart was human, yet because of his status as a being his fate was sealed since he was born. How many times must humanity judge others like that as well without giving them a fair chance?

    "It would be very irresponsible of me to give you my thoughts as you are clearly incapable of handling the ones you already have" ~some guy in OD
    posted 03 September 2008 01:24 AM EDT (US)     32 / 38  
    Recently when hosting online, sometimes the XS Debugger jumps up while the game is loading and I have to step through the debug for the map to finish loading.

    Is this because of one of these new things in my user.cfg?
    posted 03 September 2008 06:40 AM EDT (US)     33 / 38  
    Yes, the +debugRandomMaps causes the XS Debugger to activate when a random map script contains an error. Since I assume you can still play the map after it has loaded, it's probably just a warning instead of an error. Like an area that could not be placed because the constraints were to strict or something similar.

    You can just comment out that line (//) if you're not into RMS scripting, change the + in a - .

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak

    [This message has been edited by Mythic_Freak (edited 09-03-2008 @ 06:41 AM).]

    posted 03 September 2008 02:21 PM EDT (US)     34 / 38  
    Okay thanks. Yeah, it's just errors such as the gate being misplaced in total war, or the beautify water thing failing on savannah or watering hole.
    posted 15 September 2008 12:50 PM EDT (US)     35 / 38  
    Hey Mythic,
    I love your XS trigger reference!! (I'll have to give a proper review when i've used it more but I suppose there's nothing more than a 5 is there?).

    I have a question about a command though:

    trSoundPlayFN(string filename, float volume, long eventID, string subtitle, string portrait)

    If I call it with a float in the volume position, it 'breaks' the trigger code and nothing runs.

    My guess is that your reference is from an original set of functions and perhaps volume is no longer a param in the final version? I didn't play around with it too much as I didn't have much time, but seeing that volume is not in any of the ES original triggers, that makes the most sense...


    In all your science of the mind, seeking blind through flesh and bone
    Find the blood inside this stone
    Well, I know I've never shown what I feel, I've always known
    I plan my vengeance on my own - and I was always alone
    posted 15 September 2008 01:22 PM EDT (US)     36 / 38  
    It's a tricky 1, my previous version of the docs did not have the volume param in it, but it is effectively there.

    The reason it goes unnoticed most of the time is because it is used liek this in the trigger xmls:
    trSoundPlayFN("%Sound%", %EventID%, "%Subtitle%","%Portrait%");

    When I was quickly trying to convert those trigger command in proper format, I forgot that the %Sound% param holds a value similar to this: sound_path_you_entered", "1

    So the param type "sound" automatically adds a volume level of 1, and when you try to call it in your own trigger you might be adding the volume param manually, which then throws an error.

    I'll add it to the helptext in the reference, when I update next time.

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
    posted 15 September 2008 03:14 PM EDT (US)     37 / 38  
    so wait, you're saying that that parameter for sound can be a string with a comma delimited 2nd parameter in it?
    like:

    %sound%="sounds/testing.wav,1"

    trSoundPlayFN("%Sound%", %EventID%, "%Subtitle%","%Portrait%");

    or hardcoded:

    trSoundPlayFN("sounds/testing.wav,1", -1, "","");

    and would that 1 be an absolute volume setting (make it volume level 1) or is it relative (make it one louder, and -1, one quieter)



    I used:
    trSoundPlayFN("%Sound%", %volume%, %EventID%, "%Subtitle%","%Portrait%");
    after adding a Param of %volume% type=float


    In all your science of the mind, seeking blind through flesh and bone
    Find the blood inside this stone
    Well, I know I've never shown what I feel, I've always known
    I plan my vengeance on my own - and I was always alone
    posted 15 September 2008 03:31 PM EDT (US)     38 / 38  
    After parsing you get this:
    trSoundPlayFN("sounds/testing.wav","1", -1, "",""); (you forgot the inner quotes).

    Basically, you don't have to worry about the volume in a trigger script, because it is automatically added. But it still is a formal parameter of the function, so I can't (and shouldn't) leave it out in my docs.

    I'm not even sure that float is the volume, but I don't have a clue what else it could be.

    If you want to seperate both values, you'll have to do some function trick:
    string getSound(string sound="", string vol="") {
    return(sound);
    }
    string getVolume(string sound="", string vol="") {
    return(volume);
    }
    Call the function with only the "%Sound%" XML param, and it should all work out fine:
    getSound("%Sound%"); getVolume("%Sound%");

    After you seperated the sound from the volume with those functions, you can include your own volume with %volume%.

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
    « Previous Page  1 2  Next Page »
    Age of Mythology Heaven » Forums » Modding and Scripting » Master XS - Setup
    Top
    You must be logged in to post messages.
    Please login or register
    Hop to:    
    Age of Mythology Heaven | HeavenGames