Advanced Level Editing and Scripting Guide

Hello everyone! It’s about time we get into advanced level editing, and explain the script commands we used in the campaign and stand-alone scenarios.


In the document we prepared for you today (see below) all Age of Wonders 3 script calls with explanation are listed, as well as a few examples of creating some events step-by-step with screenshots.

Like how this…

Map Edit 05

,..leads to this


The script documentation still very much needs to be considered ‘raw material’. As such, it may contain errors, it will definitely not explain everything you want to know and it will not warn you about everything that can go wrong if you use a script in a specific way. I wish you all good luck with making your own stories and adventures!

Download the 60+ pages Scripting Guide here!

Download the Mirror Pact Example Map here so you can see scripting in action.

If you have questions, feel free to post them on our Level Editing forums!

For a video showcasing basic editing like placing units/structures, painting terrain etc look here.



The following two tabs change content below.


We’ve moved over to the paradox forums. Please come visit us there to discuss:
You can still read the collective wisdom - and lolz - of the community here, but posting is no longer possible.

Home Forums Advanced Level Editing and Scripting Guide

This topic contains 15 replies, has 15 voices, and was last updated by  Fireprince 4 years, 6 months ago.

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
  • #92201

    Lennart Sas

    The scripting guide has been released! 60 + pages of examples and script commands. Please see this news post:




    I can continue with my map. Hope it has some advanced LUA scripting in it.

    Thanx for the update.



    I agree with Rohirrimelf, thanks so much for this! Now to start learning stuff 😛

    Kind regards,






    Thanks for this.

    And another thanks for this condering the circumstances you guys most likly have at your office(s) 😀



    Thats great that this was released but I’m not sure I understand the logic of getting something this complicated out ahead of something like the resource editor (of AOW 2 SM) or a random map generator within the editor itself.



    A Thousand thanks for this. I see where my weekend hours will be spent 🙂



    Scanning the document I see for items:
    “For now the only way to obtain a resource id is to ask for it on the game’s forums. The devs are the only ones who can look them up. ”

    Is there somewhere (in forums/wiki) we can get the current resource id’s?



    Lennart, thanks, this is great but the download for the .psd world map (with layers) is no longer working in your first map editor article “All about The Age of Wonders III Level Editor”. When you click on the link in the article there you just get an error message saying the file is no longer available for download.

    Can you please enable that download again for us?



    Are there already some known “bugs-that-become-features”? Like in SM, you had the extreme terrain warping when you’ld place cavern walls on water, or like how one of the stone tiles would make it possible to place 2 buildings on top of each other? (…though that last one could be due to the UPatch, been so long I haven’t has SM in vanilla)



    Could someone please tell me what program I can use to open the Scripting guide with AS WELL AS the Mirror Pact Example Map?

    As of right now I don’t even know how to use and open the files. Doesn’t bode well lol.;)

    Thanks in advance!



    Mirror Pact Example Map can be opened with the level editor.

    Script Guide is a Word document.



    I am not sure where the right place to ask questions is so I will start here. I saw the scripting trigger “OnStackEnters” used in the example in the guide, but noticed another trigger “OnStackArrives” in the list with it. I could not find anything in the guide to explain what the difference is and when to use one over the other. Could someone who knows the functional difference explain lest the two similar names cause confusion and/or problems?


    A script with OnStackEnters works if the unit walks through to hex, without stopping on it.

    A script with OnStackArrives only works if the unit stops on that hex. Very useful for setting up hidden areas etc.



    Oi Oi !

    I’ve been wondering, in the scripting guide, is this correct?

    Print the the id of the item in the unit’s head slot
    local item = HexWorld:GetScriptingS():UnitGetInventoryItem(“UNITALIAS”, 3)
    HexWorld:GetScriptingS():ItemHasTag(item, “OVERPOWERED”))

    According to the image beside it, 3 is not the head slot but the second trinket, and how does ItemHasTag print the id? :O



    In the docu stays :GetPosition

    Returns NULL on failure.

    But it returns a seemingly random table value and a SCRIPT ERROR. The same for :StackGetPosition.
    Is this intended or I understand some wrong?

    Btw: Why there exists StackGetPosition if an alias must be unique and we can use GetPosition too??

Viewing 16 posts - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.