AoE4 Mod Tutorial: Making a Crafted Map in the Content Editor


 Title

AoE4 Mod Tutorial: Making a Crafted Map in the Content Editor


Description

Welcome to our AoE4 Mod Tutorial series! In this episode, we'll dive into the fascinating world of map creation using the Content Editor in Age of Empires IV. Whether you're a seasoned modder or just starting out, this step-by-step guide will walk you through the process of crafting your very own custom map.


🌍 Explore the intricacies of terrain design.

🏞️ Add resources and strategically place them across the map.

🏰 Create immersive environments for epic battles.

🛡️ Set up triggers and events to enhance gameplay.

✨ Bring your vision to life with unique map features.


Whether you want to design historically accurate battlefields or embark on a creative journey, this tutorial will equip you with the knowledge and tools to make your map a reality. Join us in the world of AoE4 modding and unleash your creativity!


Don't forget to like, subscribe, and hit the notification bell to stay updated on our latest tutorials and modding tips. Share your crafted maps with us in the comments below, and let's build incredible worlds together in Age of Empires IV!


#AoE4 #Modding #MapCreation #ContentEditor #AgeOfEmpiresIV #GameTutorial #Gaming

Transcript

do you want to make your own games but don't know how to code modding is an easy way to get started and I'm going to walk you through it step by step today we're using the Age of Empires 4 content editor let's get into it when you open up the game you'll notice this mods tab on the menu then you can click all mods and you'll notice in this drop down there are multiple types of mods available made by other members of the community crafted maps are the standard Age of Empires rules with a Terrain custom designed whereas generated Maps every time you play are different because the mountain ranges and rivers are randomized a tuning pack modifies the attributes of the units for example their health their damage their movement speed Etc generally this is to make the game more balanced for competitive play unfortunately the content editor is still rudimentary as far as completely custom units you can't import your own 3D models or sounds finally game mode changes the win conditions of a map so instead of destroying the enemy's base to in the game you could instead make it a survival mode where you just build towers and have endless monsters coming at you and whoever survives the longest wins the concept of mods is pretty cool because it gives us endless content to play and if you want to learn coding it's actually quite easy to get started you'll notice these are all the community mods that people have made and there's hundreds of pages with each page having around 18 Maps so there's probably 2 000 Maps here which is pretty cool but unfortunately you'll notice a lot of them have one star so that tells us it's very easy to make a map which is nice it also means the quality control is pretty bad so if you're looking for Community maps to play you're definitely going to want to sort by rating or popularity so you don't deal with just garbage what's exciting to me about this is a different game I play called Warcraft 3 has this same concept and the custom modding scene kept the game alive for decades even after blizzard stops supporting the game but hm Empires 4 is pretty new so we'll see how it goes today we'll be using the Age of Empires 4 content Editor to make a map and I'm going to design it after a popular map in Warcraft 3 called Run Panda Run so let me start up the warcraft map to explain the rules of the mode on the bottom left here you'll see a mini map and it's obviously like a maze structure I've got to walk around in a spiral formation until I get to the very center to win and I control this Little Panda so I just move him around but I have to dodge all of these little minions and they randomly move back and forth so you want to be as far away as possible so it's almost like dodgeball or something and I think this is a great starting point for our first map and Age of Empires because both games are real-time strategy games so it should be fairly easy to convert one map in Warcraft to Age of Empires but I picked a fairly simple map because I'm just learning the editor I don't know how powerful it is and I don't want to bite off more than I can chew so if you're a brand new coder this will be perfect for you so I'm just going to run along here and see how long I can survive till I die uh if I was playing multiplayer when I die it would leave a little body on the ground and one of my teammates could come pick me up I think I will make the Age of Empires version multiplayer as well this is like a boss I can't kill him I just need to keep running um so I guess you got to be careful with the pathing because if I accidentally click to the side here like off the edge of the wall it's gonna try to path me all the way there so I'm gonna lose control of my character so you want to click close yourself so there's a little body that gets left if someone walks on top of that it resurrects so I think instead I'll have you just automatically resurrect at the beginning here and while I had my character selected you would have noticed at the bottom here some icons for items and on the bottom right corner here icons for abilities Age of Empires has that concept as well it's a little more rudimentary but I might toy around with maybe an ability that gives you a speed boost or makes you invulnerable or something like that so let's quit out of Warcraft and get into the content editor when you first open the editor it asks you to create a new mod and I explained each of these before my first inclination would be to do a game mode because I'm not really winning by destroying the enemy however I'm going to do crafted map because it has a tool that I like I don't really want tuning pack because I'm not really modifying the units and the strange thing about tuning packs is when you load any map in the game for example if I just do a skirmish when I pick the map separate from the map under game mode I have tuning pack so to me tuning packs are a bit awkward because they're not tied directly to the map so I could take any map created by one person and any tuning pack created by a different person and combine them together and although the purpose of the tuning pack is to balance the units if that map is customized for a specific scenario that tuning pack is not really going to balance it correctly and then I don't want to do generated because the idea there is you get to specify I wear the gold mines and stone deposits and berries are going to be located in general terms like in proximity to each other and then it randomizes it from there which is fun that makes the gameplay different each time but for our situation where we're making a maze there's not really a benefit to randomizing anything I don't think so we'll do the crafted map now the tool that I like is right here this terrain layout tool so I would recommend starting there if it's the first map you're making and I'll call this run 4C run instead of Run Panda Run so this is that tool I was mentioning you can essentially just draw the basics of what your map should look like and it will randomize it just one time based on your drawing and then make it a hard-coded map after that so since we wanted a spiral structure in our game I'm going to draw something like this but I want the terrain to change with each Loop through the maze just so it's a little less boring so each of these colors here if you Mouse over them it'll pop up a tool tip which which explains what it's for so this bright green color says it's planes whereas this Brown says it's Rolling Hills I don't think it matters a whole lot what I choose so maybe I'll do a little section that's a lake and a little section that's a mountain and maybe a section that's a forest and then the part I want them to walk on is this brown area and to make it not too confusing I think I'll have the pathways all stay brown but you'll notice this first one is Rolling Hills the next one is medium Hills next one's Plateau so I think I can mix up between the different Browns and it'll still feel okay to walk on but it would be confusing if you're walking through a lake or through mountains so those are really the borders so maybe this top one will be the gentle Hills then the low Rolling Hills then the medium Hills the colors are almost identical you can't even tell I painted there but I did then maybe a plateau medium plateau maybe some planes classic planes settlement planes and back to the original gentle Hills I think I'm basically good at this point um so I just clicked next for it to generate but a few other things you can do under players right now I'm on player one I'll click right here on the top left corner to say that's where he starts now because this is a multiplayer mode and everyone's Allied the goal is to have everyone get to the very end right here in the middle so ideally I'd want player 2 to start right next to him but it won't allow that so this really just gives you a basic setup and it's designed for the real game where you would not want two enemies right next to each other on the same tile so I'll have to modify the settings for each player in the more advanced settings of the editor itself this is just a tool to get you started and it doesn't have every option in addition where it says size here I actually do want it to be micro so that it's a small map because I don't want you to have to be scrolling around constantly to see the maze but even though that says Max of two players I think I should be able to allow eight players instead because I think it's recommending having a gigantic map for eight players I don't think it's gonna force it and then I could change the biome if I wanted the biome is kind of like the climate like tropical or desert that may have some small effects on which animals are roaming the countryside which they call Gaia in this game as well as the look of the trees and things I'm not going to worry about that I'll just leave it on the default rivers and River Crossings are cool but it has a very rudimentary system for water in this generator whereas the main editor that we'll get to once we click next has more options so for example if I click add River you'll notice I drew a river in the middle it's red because that's considered an invalid River I have to start actually from one edge of the screen and go to the other edge of the screen in order for it to be considered a valid river which is strange to me why can't I just have a lake or a river in the middle of the map so I don't really like this tool for making the rivers unless you know for sure you actually want it to cross your entire map but you can make your River or go diagonal and if you click on ADD point you could take an existing River and make it curve around so it could be useful and then of course River Crossings you could have as well if you wanted a little Bridge somewhere okay I'm going to click next and now we have our map this is pretty cool when you think about it you can see that this structure roughly matches what I told it to draw for me I've got this little L-shaped ocean in the middle and so if we had our players start on this corner for example they would walk up over over down and then they keep spiraling in until they get to the ending point and so I think I'll make the ending point just right here this little island and one thing I'm a little concerned about is it generated a whole bunch of trees here those are going to be difficult obstacles to get through I'm gonna definitely want to thin that out I think but we've got a decent starting point okay so on the left side we have asset Explorer and I have it hidden so you have to actually click on it to make it appear if you hit this little pin it'll make it always available I prefer to have it hidden and then same thing here on the right side of properties and Playback playback I would recommend you come in here and hit stop basically all this is doing is taking things like the rivers and rendering the actual waves so if I hit play you can see the waves are moving well when I'm designing the map I don't need that unless I'm specifically focusing on the visual appeal if I'm just focusing on the general structure of the map and the gameplay I don't need that and turning that off is going to speed up your editor a little bit okay so if I bring up the properties window and then I expand this generated you can see for example starting positions when I click off of it onto for example trees it highlights all the trees in red that were generated if I go back to the starting position you'll see this icon that I can zoom in on this is where player one is going to start right here and whenever I'm clicked on on the right side you'll see properties about it so under transformation I can move it I could do that just by dragging it around but you'll notice the numbers here are changing so I could also change it directly in here the trend transformation isn't critical unless you need an exact coordinate it's probably easier just to drag it where you want but then under the top section of properties you can change all the attributes of what you have clicked on so for example it says right now this is player one so I could change it to player two's starting position instead so I mentioned earlier I want to have all 16 players start at the same spot I think I want to clone the starting position so I can right click and do copy and then right click and do paste now I have two starting positions and so I really want 16. okay now I have 16 just by copying and pasting now I'll start with the top one make it player one go to the second one make it player two and I'll just keep following through until I get to number 16. okay now I've got my last starting position next inside the scenario I'm going to expand the players and change some of these settings as well and remember to save frequently just in case the editor crashes you don't want to lose your progress so under players if I click player one you'll notice the option are completely different than what I had underneath starting positions so these options are context sensitive it knows what type of unit I have clicked on and the same would be true if I clicked on a tree for example some of these objects are going to be typical units you would see in the game like a scout and others might be more code related where they don't necessarily have a visual but they still impact the game and they still have options that can be changed here so for example clicking on player there's not anything visual but they're still settings specific to the player so under team I want everyone to be on the same team so that they do not fight each other so I'll put team one instead of random and I'll need to do that on all of these other players as well so player 2 says status closed I'll change it to open and then team one and I'll do that through all the 16 players you'll notice as I'm marking it to open then on the left side they're no longer grayed out with a red flash through them so even though I'm on a tiny map which should not support 16GB players it is allowing me to do it and if I decide later that this map is too small there is a tool I don't remember exactly where maybe under scenario I think it's this resize where it will actually take my entire map and stretch it or Shrink it based on my preferred size so if I decide it actually is too small once I'm actually playing it then I don't have to start all the way over I could do that okay last player file save just get in the habit of hitting Ctrl s frequently now you can also select multiple objects at the same time either by dragging to highlight or by clicking one of them holding the control key on your keyboard and clicking the ones you want to highlight or clicking the first or last one and holding shift and clicking the other and it will highlight everything in between the benefit there is if they're all of the same type you can change their values all at once so rather than going through one player at a time and marking it open team one I could have done all at once you'll know notice here when I'm clicked on player one under player I can't change it it's disabled because that's like a hard-coded value that's not configurable but it does say player one if I select the both it doesn't say anything there so whenever you have multiple objects selected the only values that will show are the ones that are identical between them but you can still change the value even if it's missing and finally if I accidentally select something that's unrelated so say I have all these players selected and I also grab this random tree all of a sudden the properties window is empty because since they're different types tree does not have the same properties that player has and this teaches you kind of the basic concepts of object oriented programming even though it's all visual you could think of this blueprint as a class and each of these names on the left as the properties of the class and so player one is a specific instance of the blueprint and all the values on the right are the values of those properties within that player one instance so it's kind of visual coding behind the scenes it is actually setting those variables so I'm going to highlight all 16 and say lock team to force them to always be allies okay next I think I will create all their Scout units on the top left corner and I may have to go into the script and tell it not to generate their typical starting units because I don't want them to have a villager and a town hall and all that so let's just click on edit script and see what code it shows me the file name for script is scar that stands for scripting at Relic Relic is the name of the company that designed Age of Empires 4. and this language is essentially Lua Lua so if you're gonna google coding tutorials you're probably not going to find a whole bunch based on scar until the Age of Empires editor becomes really popular but if you search for Lua you'll find a whole bunch because a lot of modding tools use Lua so this import statement it's just going to find this file in their game install and import a bunch of generic functions that are helpful for most Maps you don't have to import this this is just a default script to get you started so I'll just leave it alone since it shouldn't hurt anything but any actual code that's executing if it doesn't match what I want I'll change it so this is showing how to grab a player by executing this function passing the index of the player and putting it into a variable this is showing how I could change what age they're in so in Civilization you go from dark to feudal to Castle and then Imperial with each age that you unlock you gain new units and new buildings that are stronger so I could delete this code since it's not going to be helpful in our map but it's already commented out so it's fine to leave as I'm scrolling through here pretty much all the code looks to be commented out so I was hoping there would be something that said generate this many villagers and a town hall because I don't want any of the 16 players to have a real civilization here I just want them to have a scout so that actually may be what this starting position does and maybe I just delete all of these and don't give anyone a starting position I'll have to experiment to see I do know I want to create 16 Scouts though in order to get a unit to drag in you go to the object browser here at the bottom so I'll click this Thumbtack so that it locks in place but I'll drag it down so I can still see a lot of my map and then along with the object browser is output and error list output is for debugging while you're actually playing the game if you go to script attach the editor will be connected to the game while it's running and so you could add a break point on a line of code which lets you debug the code and step one line at a time as it's executing but in addition you can send messages to this output window for debugging purposes the error list is if there is a syntax error in your code it will tell you because that will prevent the map from compiling and you won't be able to play it in the game so under object browser I could scroll through this folder structure or I could just search if I know the name of the unit most of the objects in the game that you're familiar with are going to be under ebps and sbps the E stands for entity and the S stands for Squad BPS is blueprints you can think of a blueprint just like in construction with a house it's the design before the house gets created in coding this would typically be a class whereas an instance of a class called an object would be the actual house when it's built it's a bit strange that Age of Empires has entities separated from squads because you'll find similar units in both for example if I go into entity races English under units I have battering ram but if I go into squads races English I also have battering ram so each unit in the game is actually defined by a combination of both the entity and the squad The Entity is the most basic attributes of the object and entities are even used for buildings or trees things that don't move don't necessarily fight so the entity is more the base whereas the squad has more specific things that are related to units and combat in addition a squad is also an array encoding which means a list or a group of items so even one single unit is called a squad but a group of units is also called a squad and one thing while it's due in Age of Empires is they have a specific formation during combat so the units will try to move around to put the ranged units in the back and the melee units in the front for example so we want to put 16 scouts at the starting position I need to be careful where I grab the Scout from so if I just search for scout I can't easily tell whether I'm looking at the entities or the quads but if I choose the entity version it will not be a full-blown unit because because it will be missing its code related to formations and attacking so I want to be careful to use the squad version if I go to English I can find a scout and I can drag him onto the screen but under players I did not lock them into the English race it would be preferred to let them pick whichever race they wanted but just for ease of use I'm just going to drag the English one in so all the player Scouts will look the same and this is because I'm doing it with drag and drop if I were to do it in code I could ask the game what race the player picked and make sure I generate the Scout for that race and it does get a little tricky with some units because not every civilization has the same units most of the units do exist across every civilization they have a different graphic and slightly different attributes but they're very similar but there are a few units that are exclusive to one civilization so maybe I'll change player one here under race to always be English and then I'll copy that value to all all the other players so now they just can't choose a race next I'm going to copy and paste the Scout 15 times so that way we have a separate Scout for each player and then on the properties on the right side I'll change the owner for each one so the first one is player one second one player two and so forth and now we have our last Scout it's at two player 16. just so they're not all in the exact same spot maybe I'll just kind of drag them around so that they're all kind of next to each other rather than grabbing the individual arrows to only move them One Direction if you put your cursor right on the center of the square it changes from pink to Yellow that will allow you to drag it in both directions which is much easier but first you need to highlight the unit that you want to move otherwise if I try to select it by clicking on it I might accidentally grab a tree or something else so now I have my 16 Scouts they're not exactly aligned but I think it's close enough now it's probably a good idea to test our map occasionally as we make progress so that if we do something stupid we find out about it as early as possible if we wait to code the entire map and something goes wrong it might be hard to narrow down and troubleshoot What specifically happened in order to do that you open up the game and you go to mods then my mods and this will show you all the mods that you have installed whether from the content editor or downloaded from the community in my case it's blank and that's because first in the content editor when you're ready to test you need to click build build mod then it will show you a bunch of messages as it's compiling and then you hit OK there are a few annoying bugs with this process first of all there are two ways to install Age of Empires if you own Xbox games pass or PC games pass you can install Age of Empires for free from the Xbox app or the Windows store app however you can also purchase the game directly from Steam the two versions of the game are almost identical however Microsoft has a small amount of extra DRM which stands for digital Rights Management essentially they're checking your license to ensure you own the game to prevent piracy and seem has this as well but the windows version is a little bit glitchy for example right now I have both Age of Empires the game and the content editor open simultaneously the Microsoft version does not allow this so you have to close the editor whenever you want to test it in the game and then when you want to go back to editing you have to close the game go back to the editor it's pretty annoying there is a hack you can do to prevent this so for any of you that have the PC games pass version that care about that let me know in the comments and I'll explain how to do it but in addition the game itself actually reads all the mods at startup and locks all of the mod files so even though we compiled with build it's not going to show up in the game until we restart the game so I'm going to quit out of the game and then relaunch it the final annoying thing is it actually locks the files to the mod once you open the game so because of that if you want to make further edits to the mod you can't really do that unless you restart the game in between tests so you do want to code as much as possible in between each round of testing just to avoid constantly having to restart the game if possible there are Advanced debugging techniques to work around having to constantly restart the game for example I mentioned before under script attach you could connect the editor to the game with something like this you could test out some of your Lua code on the Fly and change it without restarting the game but that's kind of an advanced topic so now I'll go into my mods and you'll see my mod has been added here and it's turned on so if I go to Skirmish under play then I can pick as my map this custom map that I've created and so far it's working how we expect we have 16 players I don't really need an AI so I'll figure out how to disable that in the future and it is allowing me to pick the civilization I want so I should change that to be locked the team number is locked I think it's fine that I can change the color so let's start and see what happens so first of all these wind conditions we'll want to delete because our win condition is getting to the center of the map okay so the scouts seem to have been created correctly but I definitely don't want to start with a base or villagers and then I think I do want to remove this fog of War so that I can see the entire map as I'm playing so I'm just keeping a note in my head of changes that should be made let's check out how the pathing works so there's definitely enough trees here that there's no way I can get through I actually Wonder since I have a cliff here that runs along the whole side if I should delete all these trees and have you start on the bottom corner of the map just to make the maze a little bit longer but let's run through the rest of the Maze and just see if it feels right without any monsters so I think it's fine that there's a few random trees here and there to maybe mess up your pathing I may want to get rid of the Gaia that are not wolves because could be a little confusing to have sheep the way these trees are set up it's pretty dense I don't feel like I could run through previously I was wondering if I needed to draw a fence or intentionally edit the impasse map it looks like I don't need to do that I maybe should delete these sacred sites it's interesting even though I made this a micro map for only two players it still feels quite large going through this maze if I were to actually play this all the way through I think it would take me a long time I'm thinking if it's not possible to shrink the map smaller I'll probably want to just make the horse significantly faster so this amount of Gaia I think is about right this was auto-generated I didn't pick it and it really should be something like wolves where I know it's going to attack me and instead of them running away from me they should be chasing me and I should be dodging but that feels about right I'll have to check if these were generated by code or if they're permanently placed on the map I've made approximately one trip around the map and I've tried to look for shortcuts as much as possible I haven't really found any I think it'll be interesting to have for example a tiny little path here that you have to take because that could be a choke point you got to be careful of for debugging purposes I think I definitely want to make the horse faster and with these wolves I think I want to change them so that they kill you in one hit and then you resurrect at the starting point and then also I want to make it so you can't attack so let's see if this is really a dead end it feels like it probably will be yep so I think I need to open this up so that I can walk into this little island okay that was a decent play test so I have some ideas of what I want to attempt to change next so I'll quit out because if I were to make some changes and click build while the game is running the files would be locked so first of all let's delete all the starting positions and save and it looks like that created an error so because I deleted those starting positions there's an issue so if I go into the templates and search for starting it looks like the one I have is starting position shared territory which is this Cube so I think I could swap it for one of these other cubes you don't want to use the ones that have eyeballs for icons because it's the 3D model with nothing else connected because for just for scenery sake you might want to drag in a building that you can't interact with just for cosmetic to give flavor to your map but I'll switch to the one that says no Town Center and see if that works better delete these drag the note Town Center in copy it 16 times I just realized I made a mistake I'm going to undo copying this no Town Center what I instead should have done you'll notice if I click on just a single node Town Center it has this blueprint I can just copy this blueprint and then hit edit undo until I have my 16 original territories back I can highlight all of them and just paste in the blueprint that I want and now all of them have changed to the new blueprint the only risk with that is if you change something to a completely different type of object some of the attributes that were set before May no longer be valid so you would lose those values but that would also be true if you drag in a brand new object from the browser you're going to have to reset all the variables okay I think that will fix my town centers and then I wanted to lock the race so there's a check box for that here so I'll select all 16 players and now they have to be English next I think I want to remove all these trees on the side and move all the starting positions down to the bottom so the trees all are created under this generated section so if I click on generated you'll see tons of stuff highlighted in red but that's going to be to cover some to deal with in this hierarchy so instead I'm just going to zoom in and select it with my mouse to delete but I have to be a little careful because there's also this yellow border that tells you when you've left the bounds of the game if I highlight that it will let me delete it which I do not want and I don't think I need to be perfect it's okay if there's a few random trees that are obstacles as long as you can get through okay I think that looks pretty good but now it looks a little bit bare so maybe I'll just grab a few random trees and just move them to make it less boring and then I was curious here for example all of these deer I really just want to make all the Gaia wolves so the blueprint for that is Gaia huntable wolf so I'll just look for anything that says deer and change it I'll highlight all of them so I can change them simultaneously and then I don't really want this deer minimap icon because you're actually supposed to avoid the Wolves I might later change that to be coated to Auto generate the Wolves but for now I think it's fine I think I'll get rid of these trade posts and I also wanted to get rid of the Sacred sites let's go through the rest of these hierarchies to see if there are any other Gaia that need to be changed probably the easiest way to do that is to click edit it find and under property name say blueprint and under value say Gaia and then make sure it's on substring and hit OK so these are all wolves but if I scroll down I've got sheep and boars so I'll select all these sheep and paste in the wolf as its blueprint and I'll do the same thing on these bores delete the bore minimap icon and then let's search one last time to see if there are any non-wolf Gaia yes it looks like I missed two sheep okay that should be good I suspect I probably don't have nearly enough wolves so I will probably drag in a bunch of wolves or maybe even move some of the Wolves around and in the warcraft version The Wolves just randomly run back and forth but I'll experiment because if the AI for the wolf feels good enough to where they chase you a little bit but not too much maybe I'll just leave it with its current code and there is this attribute open attributes which I'll show later but that allows you to modify the units themselves so I I could change the wolf in how large of a radius it detects for example or how far it will chase a couple of other things I wanted to change I didn't like how these trees completely blocked me from getting through because I really want to get to this island to win so I'll just delete a few random trees to make it payable okay that seems okay next I want to move all the Scout to the bottom of the map and you'll notice if I highlight all of them then I can drag them together and they stay in that formation okay I've got my Scouts moved let's move my starting positions as well since there's no Town Center I'm not sure how much it really matters but I'm assuming this will determine where their camera shows on the screen at the start of the game I'm seeing some wind conditions I'll just put a Sandbox and then I will trigger a win when you get to the island at the center of the map and then under win condition options I'll click edit so these drop downs are disabled until I hit the check box but if I hit the check box and change it to revealed I think that will remove the fog of War next I want to change the movement speed of the Scout as well as change his hit points to one so if I go to attribute open attributes it takes a second to load it acts like it's opening the content editor which is already opened which is confusing but it's actually just opening another dialogue and this dialogue is kind of like a giant XML editor for all of the data about all of the units and you'll notice at the top it says ebps so I'm looking at entity blueprints right now if I go to attributes now previously the menu was very short all it had was basically just open now it shows all of these different categories so if I want to change the squad blueprints instead of clicking ebps I could scroll down and find the squad VPS so from svps I go to races English find the Scout and I'll right click and say copy and then I want to right click and say paste but it won't let me and that's because I'm inside of a crafted map and the attribute editor is only for tuning packs so what I have to do is on the file menu at the top I need to say run asset Wizard and then click attribute mod which says that it will create a tuning pack or attribute data that can be referenced within your mod so I'll hit next and I'll just give it the same name as my map itself and now you'll notice this new folder that got created so if I clone the Scout it should be possible now so right click copy right click paste is still disabled but if I scroll down to my mod I can paste it there or I can simply click on the Scout and say clone you generally want to leave all of the defaults here if you don't have your clone override the parent it messes up the inheritance of the unit because it creates a brand new unit instead of just changing a few values of the existing unit so you'd only want to do that in a completely custom game mode where you want to have completely brand new units and the lock strings are translation data if someone's playing in a different language than English okay so now that I've cloned it you you can see the object at the very bottom here and this is kind of an odd interface the render Tab and my code editing tab are next to each other but this attribute editor snapped to the left side and it's actually missing a bunch of the controls I need to expand this to be able to see it but that messes up my render window so I actually want to drag this tab and put it next to the render and then drag this back so that way I can still see my full screen render but I can also switch to editing my units I chose to use the attribute editor here there are pros and cons to that one issue is I'm specifically editing the English Scout so if I allowed players to pick a different race I would have to edit all of the scouts so it might make more sense to do it in code but in our case we'll just change the attribute directly in the editor so I've got my Gout English selected and on the right side there is a tree of all of the attributes that I can change and extension is kind of like a class but it's more of the concept in coding called a mix in in some languages which is kind of like a coding template that other classes can use in a purely object-oriented language you would inherit from a base class and that's where you would get your generic functionality but that doesn't work well if you want Plug and Play features because you can only have a single line of inheritance you can't inherit from two different classes and so these extensions which I mentioned are kind of like mixed in templates you could have something like an ability which is a button you click on the unit to perform an action that can be a generic concept coded one time in the extension and then each of the individual units can have that extension attached to them so if I expand here I can see which abilities the Scout has enabled now because there are so many extensions here I don't necessarily know right off the bat where the movement speed or where the health is going to be located get it so I can use the search bar and type health and see what comes up so it says there's only one result and it's this help text which explains what the Scout does so it's a tool tip for the user in game so although this text has the word Health inside of it it's really not what we're looking for so what I need to do here is instead switch to the entity blueprint attribute editor instead of the squad so I'll leave this one open in case I need it later but I'll click on attribute ebps and again I'll need to look for my English Scout right click clone okay and then select my version of the Scout and open up the extensions so here I'll search for health and it looks like there's an extension for health so instead of the hit points being 110 I want it to just be one so that it dies if it's ever attacked even One Time by a wolf next I want to search for Speed and it says there's 12 results so I want to make sure I'm working on the correct property so this speed scale threshold just by the variable name it sounds like it could be useful but then when you look at the hierarchy it's underneath animation so that doesn't actually sound correct next search result okay this is a moving extension that sounds more promising it looks like there are four different speed levels I'll probably just change all four of them to one hard-coded value and see what happens there's also a min max and default speed which I can change as well I'm not sure what would be a good value but I think maybe 16 and then we can adjust this as we test so I think we're almost finished I probably want to add in a bunch more wolves I've got a few areas here that have tons of wolves but then I have a lot of areas that just have hardly any and then finally I want to create some kind of event that happens when the player reaches the spot on the map to cause the game to end I think if I click on just one wolf and go into the properties window under the transformation I can click rescale but I'm not really sure how to interact with it when I switch between rotate and rescale you'll see this little black Square underneath it that switches to a black circle the rotation works out I'd expect I just grab the sphere and it rotates but when I switch to scale there doesn't seem to be anything I can click on to interact with it so instead let's go to attributes ebps and let's search for the wolf in here okay huntable wolf let's see if it has anything about size in here the only one that maybe sounds right is entity scale let's check the squad as well search for Wolf search for scale so this is just minimap scale size nothing okay I'm gonna assume it's under ebps so let's clone this wolf and then change its scale to 500 so it should be five times bigger when I go into the render screen that feels the same let's go back to 100 okay it's not noticeable to me so I'm going to assume either I've changed the wrong property or the property doesn't take effect until runtime let's just add our win condition and then do some testing to figure out the last set of changes we need to make in order to create our wind condition I need to go to objects browser and search for gar there's something called a scar marker remember that scar is essentially relics scripting language that's built off of Lua a scar marker is a coordinate in the game so if I drag it onto this island and give it a name of winner then it will create a variable which I can code against the type actually does not matter it does not affect the gameplay or code at all it's simply a categorization to help you as the coder remember what its purpose is so I can really pick anything I want but player destination kind of sounds like what I want so I'll put player destination here as winner I'll make another one here called respawn and give it type of player spawn next I'm going to right click on my scar marker of winner and click add these are sub components that are specific to scar markers I'm going to make a proximity Circle component and hit OK and give it a radius I think about 10 is good so you can see if you're close to the center of the island it would count as winning for my respawn I don't really need a radius because I'm fine to use that exact coordinate whereas for winning it would be very frustrating if they danced all around the spot and just couldn't quite find it next I want to register an event against this marker so I'll go into my code you can click the scar file if you already have open or this icon for edit script and because this is an event it doesn't matter too much which function you put it inside of because the code isn't going to execute immediately it's just registering a condition and it will execute your custom code once that condition is met so I'll type event underscore enter proximity and the first parameter is a function callback which will happen when the unit enters that proximity so I'll make a function called player winner and that's what I want to use as my callback the table data parameter is simply data that will get passed to my callback function and a table is just an object in curly braces with variable names inside similar to like a Json object in JavaScript so I could say for example player index equals one as my data and then in my winner function I can say that data is a parameter this is the value that will get sent the documentation is not perfect so it's a little confusing What It Wants by Target when it says const Target handle is the data type and I think it's a generic term because it could be an entity or a squad and a squad can be a single unit or an array of units so for that reason they use a strange generic term I bet I could pass it any of the three data types and it would work so I want to just send it a squad which is an array of all of the gouts but because they are different players and because I'm choosing to pass which player arrived then maybe I'll do a for Loop and only pass the one Scout the require all it looks to be a misspelling essentially if I passed an array of Scouts it's saying do all of them need to enter the marked location for the event to be triggered or can it be triggered as soon as one of them arrives next is the location that they need to get close to for the proximity event to trigger next is the range and I think because I already defined the radius then the range probably doesn't matter and then the repeat is just if the event has already triggered once should it continue to trigger I'm not really sure why it has a trigger on enter Boolean variable because the function itself is called enter proximity and there's a separate function for exit proximity so it seems like you would always have it too true but we have a general idea of how the function probably works so let's try it out first I need the Scout itself to do that I'll first call player get all entities from type and I'll pass Player 1 as the first parameter for the second parameter it says the unit type should come from the type extension on the entity so let me go to the entity blueprint look at Scout look at its type extension and it has a long list of potential unit types the idea here is for example if I passed in military it would give me all units that happen to have the word military in their unit type list so I wouldn't have to say give me Spearman and give me trebuchets and give me archers because they're all classified as military whereas if I just say Scout probably nothing else is classified as a scout so I can just pass in the word scout here and it should work now technically since the player only has one unit which is a scout I could just remove this from type but I'll do it this way for now and I'll do this inside of a for Loop so I'll say four player index equals one comma 16 do end and I'll tab this in so this says the player index variable will start as one it will increment up to 16 and it will increment by one every time so now instead of hard coding this to player one I can use that variable and this code will execute 16 times once for each value in this list so I'll call my variable player instead of player one and pass the player variable into get all entities from type then I'll put that into the Scout variable so now this enter proximity where it's asking for a Target that will be my Scout very variable require all in this case it doesn't matter because I only have one Scout anyways but if I made a squad that contained all 16 Scouts and I passed them all into the same function I'd probably put false because I don't need every player to get to the end to win I just need that one player to get to the end because it's a team game if anybody makes it everybody wins for the marker location I'm going to use this winner variable and it's a global variable so if I just type winner you'll see it right here in the autocomplete and it has that marker icon for their range I don't really know what this value is for so I'll just put 10 which was the radius I chose in the proximity Circle if that messes it up and it's somehow way larger than I expect I'll change it for repeat I'm going to say false because once they've entered once the game should end and for on enter I'll say true but I really don't understand why it's even asking that since the event I'm registering is the enter proximity now inside of winner I want to end the game I'm not exactly sure what function would do that but a lot of these Mission underscore variables and function names seem related so I'm going to try that there's a complete and a fail so I'm going to assume it's probably the complete so that says ends a single player scenario with the victory I'm not sure that that makes sense because we're not really in single player mode but maybe it'll work I'm kind of curious if I right click on this missionomatic.scar and say Open document if I read the code that Relic put into this base code maybe they'll be examples that could be useful the only function I'm finding that might make more sense is this mission-o-matic end mission which has a true or false for a win so instead of complete I think I'll do that and say a win true and I probably don't even need to pass a table of data since I'm just ending the game for everyone if anyone makes it so maybe I'll just change this to null and not accept a parameter for the data so we've changed quite a few things since we last tested let's try this out and see what happens I'll do build now I'll open my game again I'm a little nervous that the changes I made to the quad and entity are going to be registered as a tuning pack so if I don't pick that tuning pack along with my crafted map it won't work so we'll have to experiment with that play Skirmish map okay I have my map here selected okay I don't see a tuning pack so if my units actually are fast like they're supposed to be then I'll know the tuning pack worked without having to select it so let's start okay I like that it's a Sandbox instead of how it previously said you win by destroying the enemy play okay it says fatal scar error execution paused so I'm gonna hit escape and say restart yes that will put me back into the loading screen now I want to go script attach that should connect the editor to the game so I can debug it unfortunately it doesn't seem to be working and the reason for that is when I run the game from the start menu by default it doesn't have any extra command line options but what I actually want is a version with extra settings in particular the dash Dev command line so all I've done is created a shortcut to the game and inside of the shortcut in the comment it has the command line option it's kind of a strange thing the Windows store and Xbox installers are very weird compared to steam normally Target would be an executable instead of this weird code and the command line options would go inside the target so if you can't figure out how to set up your environment just ask in the comments and I'll help you out so if I run the game from this shortcut it should put me in Dev mode so now if I go script attach it should work and you can see the icon for the game is flashing now and under script attach is now disabled but detach is available so it seems to have worked also there's this new tab here called call stack it it's empty right now because I haven't actually started the game yet so before I start it I want to add a break point in my scar file on the very first for Loop because this is the code that I've added since the error I got before was specifically talking about scar execution errors now if I start the game as soon as the game loads it should hit my break point click play okay the game seems to have frozen but it hasn't said that it's crashed so if I Tab out I can see I'm at my break point now my call stack has data but since my code's not very complicated I don't really have any nested functions so I'll just ignore the call stack and although I have these three higher level functions you'll notice there's no location for them that's like internal game code I can't step into that code or see how it works but I should also be able to click on locals and globals to see the values of all of my variables and also if I go to script step over you can see that's F10 that will go one line at a time so I'll hit F10 and I'm inside the for Loop and now my locals which was empty before has a single variable of player index 1. so I know my for Loop is working let's step one more I expected to have a player variable show up in my locals which I didn't I wonder if it's on our globals let me search player okay it is right here that bothers me a little bit that it's a global variable I don't know if it'll hurt anything but it really should be local let me step one more and see if the Scout variable gets created okay here's where it crashes e-group add so the E stands for entity attempted to add a squad entity unit Scout 1 English to group this is a little confusing to me I think it's essentially saying that I tried to add a squad to an entity array and squads and entities are not interchangeable but I don't feel like I said anything Squad specific but I guess I Scout because it's an actual unit with formations and attack and movement it's really a squad not an entity an entity would be like a building or a stone quarry so instead of player get all entities I should have said something like player get all squads so I'll hit okay I'm kind of hoping the game hasn't fully crashed yet looks like it hasn't so I need to fix the code obviously but I don't exactly know what the correct fix is if I kill the game change the code and rebuild what if it still is broken the next time well it takes a couple of minutes to start up the game every time that will get really annoying really quick so because I am still attached to the debugger I want to try inside of watch to see if I can execute any alternate versions of the code to figure out what works before I quit out of the game so I'm going to start changing the code just to get the autocomplete to show but I can't save because it'll mess up what's currently executing there's this util get squads by blueprint there's also World get all squads and World get all squads of type I think any of those might work maybe I'll just do the world version for the S group ID I think I need to create a squad group but for the type I can still pass Scout I believe so if I type S group there is a create function and I think I want to do create if not found just so it doesn't crash and I'll call it Scouts and I think I may not actually need this for Loop because if I move this code up and just to make sure this is unique maybe I'll call it horses since that's the name of my game so I'll put that into a horse's variable and then when the world get all squads is called it will find all the Scouts in the game of any player and put them into this horses group so that's beneficial because this inter proximity I think instead of passing a single Scout unit I can pass all of the horses all 16 players but if I'm going to do that instead of using require all as true I need to say false because say one player disconnects or they die and they just give up I don't want the rest of the players to not be able to win because one person didn't make it to the middle so I don't think I even need this for Loop code at all and I don't know if I really need this player variable I'll just delete that and this for Loop but the real question is do these two lines of code I wrote actually work so let's try copying this s group right if not found horses into the watch okay the value is a random memory address and the type says table s group so it seems to have created correctly now because I'm in the watch window I can't actually create it as a local variable but that's okay because this is called create if not found so if it already exists it will just return the existing one so here when I call World get all squads of type instead of passing it horses when I'm using the watch window I'll just pass it this create if not found first let's expand this table so it says zero spawn zero despawned so I know it's an empty group so now in the watch window let's paste World get all squats of type creative not found horses Scout enter Okay now what's strange is it says value 16 but this expanded group here still says zero spawns zero despawn total I think if I right click on it and say refresh okay perfect now it says 16 spawned when the codes actually executing normally that's not an issue it's just the nature of the watch window so I'm pretty confident these two lines of code are going to work great I'm still not 100 sure on the enter proximity because we weren't able to step that far into the code and so I'm also not sure about this end mission or if the tuning pack worked correctly either but that's okay I think let's just script detach now we'll go back to the game and we'll see that we're kind of in a frozen State and I want to just like restart or quit the match and then retest but unfortunately as the game's running right now if I hit build even though it'll say that it compiled just fine there's no errors anywhere as soon as I hit OK it says error copying so this SGA file is the final compiled map and it's saying that the game has it locked so unfortunately you do have to actually kill the game you can keep the editor open but the game has to be killed before you can hit build again and that's why just to save time you really want to learn how to debug well so that you're confident the next time it's going to work so let's start up the game again I'll still use the dev command line option so that in case it doesn't work I can attach to the debugger okay Skirmish pick my map and hit start I'm not going to bother to attach the debugger until I see if it crashes or not I don't really need to step through the code if it works fine okay still crashed invalid number of arguments expected 7 received eight in Mission set up players line 20. so I'll hit OK and I'll hit escape and do restart yes so that'll reload the game so that must have been this inter proximity function because that's line 20 and we already tested these first two lines and expect that they work so it's saying I gave too many parameters which is a bit strange one two three four five six seven eight so it's saying I sent eight and it only wanted seven let's read the description callback data Target require all location range repeat trigger that's eight I think the documentation's incorrect here I feel like I passed everything it asked for so let's try to attach again and we've got a break point now when I click play it should pop pause when I Tab out I can see I definitely got to this line of code that I was expecting but I don't quite understand why it thinks I sent the wrong number of parameters I think I'll just do some trial and error so if I copy this line and paste the whole thing into the watch I should get that exception but it won't crash the game so I can try again with different parameters so for example I thought it was strange that it was saying trigger on enter was a Boolean at the end because I'm already in the enter proximity function so I wonder what if the documentation is just Incorrect and that variable is not even needed that's just a guess and I already know it wants seven parameters and not eight so I have to remove something so let's just try that I'll remove the very last Boolean let's paste in both so we can see them side by side the one says invalid number of arguments seven expected receive date the second time when I removed that last Boolean it says parameter two is invalid it expects a tagged Union shared and it received a nil okay so essentially I think it's saying that this data variable that I passed for null it needs to have that so that it can pass it to the Yvette tantler and it's saying it needs to be of data type tagged Union shared well what is a tagged Union shared I don't even know obviously liked the first parameter I sent it'd be nice if I could look through some of this example code like a mission nomadic to find event enter proximity if there's an example somewhere and maybe I can like under leader dot scar if I right click and say open if I open all of these different files maybe I can find an example but first let's just go to the globals and see if I can find any variables that say tagged Union shared as their type so if I just search for the word tagged under globals it's obviously not searching the type but there are three function names that are interesting because all three talk about a tagged unit now I don't know that a tagged Union shared is the same as a tagged unit but let's try that okay that seems to have worked pretty well now it says invalid parameter seven it wanted a table but it got a Boolean so that tells me that it's okay with the group being the second parameter and it's actually okay with the next four variables it's just the very last one the true that it didn't like and if it wants it to be a table I'll just assume that's where it wants the empty data object that's going to go into the player winner event handler so let's try that okay I think it worked because this time it just returned a value seven that's kind of a strange value to return but I'm just going to assume that means it registered the event handler so this is something annoying about Lua is it's an interpreted language not a compiled language and so you don't get error messages while you're typing the code if your code is wrong you have to debug it at runtime if it's wrong and essentially the documentation given to us by Relic is wrong and that's probably because they probably modify the code every time they do a patch to the game and now the documentation is outdated but that's okay we were able to work through it so let's detach our debugger quit out of the game start up the game again oops I forgot to click build first okay it's compiled now I can start up the game and hopefully this time we don't get any errors click play and hopefully the scar does not crash looking good so far um my camera started at this random spot in the middle instead of at the bottom where my Gout is and I think I maybe should get better instructions to the player it may not be obvious what they're supposed to do I don't feel like my horse is any faster than before so I feel like the tuning pack maybe did not work the fog of War does look correct though the Wolves also do not look big um my Scout also has 110 health so a bunch of things that are off there so I could run all the way to the center here to see if at least my trigger event worked but I'd rather test once I have a really fast horse okay I think I figured out what I'm doing wrong I made a mistake when I went into file run asset Wizard and I chose to create a tuning pack the option's not here right now because I already did it so I'm going to create a new mod temporarily to show you the option I chose wrong but then I'll come back in here and fix it I don't want to start my map all the way over so I'll fix it by editing the files in the asset Explorer directly but essentially it asks me if the tuning pack was part of my crafted map or if it should override the base game files I chose to make it part of the crafted map however that setting should not even exist in the editor because it does not work let me show you what I mean when I go back into the game and click mods my mod type says crafted map that actually needs to say bundle because it needs to have both a crafted map and a tuning pack in the same mod the reason for that is if I click play single player Skirmish create game when I choose my map under game mode there should be a drop down here for tuning pack where I can select the tuning pack that's part of my crafted map but because I chose the broken option which is an internal tuning pack there's no way to select it and the game never actually loads the data so it never takes effect by making it an external tuning pack I can pick it in this drop down and it'll work perfectly I feel like this is a awkward experience that Relic should probably fix because my tuning pack is very specific to my map so I don't want them to ever select none and in addition I don't want anyone to play a different map and choose my tuning pack because it's not going to be helpful for their map but it's not too bad and it works so what I need to do is quit out of the game and in the editor under asset Explorer if I expand the folders you'll see under a trib for attributes that's the tuning pack there is an XML file for generic settings about the whole tuning pack and then there's individual XML files for each unit I've overridden if I right click on the main tunie pack XML and do open containing folder then if I open this with notepad you'll see there is a setting override instances false if it's false it's essentially creating brand new units instead of modifying the the existing civilizations units and that actually would be a good thing except that it also makes it so that tuning pack can never be loaded so it's not possible to use those brand new units so I need to change this to true to fix the issue but I can't save it right now because the editor is still open and if I save the file the editor will crash I need to close the editor first but there's a couple of other changes I also need to make if I double click any of these unit XML files it will take me to the attribute editor under Squad blueprints or entity blueprints you'll notice there is a PBG ID for each unit that stands for property bag group ID a property bag is basically a list of key value Pairs and so this ID is a unique identifier for all of the settings inside here each unit needs to have a unique ID the issue here is this is my custom version of the Scout and if I go into races English Scout you'll notice the ID is different one six six four one two instead of one six six four one eight if the unit is overriding the original unit the IDS should be the same because the idea is different it's actually a brand new unit but if I go into the object browser All of These Blueprints are only built-in blueprints I can't use my new custom unit to drag it into the render screen and also I can't click on an item in the scenario tree go to properties and switch its blueprint because custom units do not show here the only way to use custom units is in the scar file itself you can use the ID with functions like BP for blueprint underscore git by PBG ID something like that would allow you to access your custom unit however like I mentioned before an internal tuning pack is never loaded so you'll just get an exception if it's an external tuning pack you can use your custom units in my case I do actually want to override the base Scout because a completely custom unit requires extra effort and it's not necessary in my case so I want to change this 418 in my custom unit to match the 412 of the original unit and when I right clicked to clone the original unit it should have kept the original ID it would have done that if my tuning pack was configured as an external tuning pack instead of part of the crafted map so I have two options I could either edit all three of these XML files and put in the correct ID or since I didn't really change too many values I'll probably just delete them and re-clone them so let's fix this delete Squad Scout delete entity Scout and delete the wolf save close now I can open my XML file in notepad and make the final change of override instances true let's open up the editor again and I'll quickly show you the dialogue I screwed up earlier before I load my mod so if I click create new mod if I I just do a tuning pack and hit next there's no extra setting here but if instead I hit back and go to crafted map next then after my crafted map get started I can do file run asset Wizard and choose attribute mod which is a tuning pack then next you'll notice here it asks me should my attribute data be for this mod only or should it replace the base game data again I don't know why this top option exists that's what I chose the first time it does not work don't choose it always choose the second one and that will classify your mod as a bundle instead of a crafted map because it will contain both a crafted map and a tuning pack and then when they play your map they can choose your tuning pack to go along with it so let's go back to our mod that should be fixed since we overrode that selection directly in the XML file to fix my mistake okay now I can clone my units that I deleted before guad English Scout right click clone okay you'll notice the ID here is 412 and the original ID is also 412 so they're identical so any values I set in my clone to scout will override the original let's do the same for the wolf clone okay then let's switch to entities wolf clone okay and Scout one English clone okay now I can set my properties again so I want to change the speed of the Scout and I can do that under the moving extension and I think I'll do 16. okay I also want to change the hit points I can do that under the health extension hit points I'll just set it to one so if it gets attacked At All by a wolf it's dead next under the wolf I want to make it really big I'll search for scale and I found this entity scale I think that's the correct value to change so I'll set it to a thousand now unfortunately the tuning pack does not load in the editor itself so when I click to render the wolves are still going to be normal size there may be a way to change that but I'm not sure so we'll just test it out in the actual game one other way I could have changed the size is if I go into transformation you'll notice there's this scale button it doesn't work and the reason why is because the wolf is using a squad blueprint and that's necessary because the squad has the extensions for the wolf's Behavior the fact that it will automatically attack the Scout when it walks past and chase them Etc The Entity blueprint is what controls the actual Visual and so the scale button does not work from here if instead I went to the object browser and searched for Wolf if I grab the visual version of the wolf which is the entity instead of the squad version then I could scale it so let's just do that as an example drag that in then click Gale you'll notice this extra line that shows up I can drag it to be as big or small as I want unfortunately that's not going to be helpful because then I'll have to code the behavior of the wolf from scratch which I don't want to do so it's much easier to change it in the attribute editor instead of this transformation tool okay one last thing I need to change is if I go to scenario and scroll down to this tuning pack mod grid I need to paste in the grid of my mod so that it automatically selects this tuning pack so if I click edit copy mod quid I can paste it in here so let's save and build now let's launch the game and I think it will work this time okay let's click mods my mods you'll notice my map now says bundle instead of crafted map then if I go back to play single player Skirmish create if I pick my map under game mode the tuning pack is automatically selected and it has the identical name as my map so the one downside to this is the host could break my map if they switch this To None before they started but since we've automatically selected it I think that's unlikely so it's not a big deal similarly under map State we've automatically selected revealed if they change to explored or concealed it would keep the fog of war in the game I guess with either option the game will still work it just won't be how I intended it without the tuning pack the Scout will run slowly and the Wolves will be small with the fog of War enabled it will actually make the game harder because you might not see that a wolf is right next to you so it's probably fine if I really did not want the user to override the value I could instead disable the fog of war in my Lua script instead of just defaulting the option in this game creation lobby but I think as long as the defaults are set it should be fine so let's start the game and see what happens this wolf is kind of weird when I select it the circle around it is huge but the model itself is small that's a bit strange let me go to my Scout okay the hit point is set to 1 and the movement speed I'm not sure what the default is but four tiles per second seems like a lot let's try to run around yeah that's definitely faster than normal and I think it feels like a decent speed I'm okay with that so definitely on this first Corridor I need to add more wolves because it's kind of boring if there's no obstacles to avoid so I guess I'll need to debug why the wolves are not working they are small and this should be big oh what was that the wolf just instantly got huge um okay I was not expecting that my heart uh jumped about a hundred times a second I actually think that's kind of cool maybe I'm gonna leave it like that just to uh scare the player so there must be some kind of bug where I don't know it's like it loaded the initial tuning pack before it created the wolves and then afterwards loaded the overridden tuning pack I don't know I probably could fix that if I instead create the wolves in script so that it happens after the game is fully loaded something like that but I don't think I'm going to worry about it it's kind of fun and also so it seems off normally the wolves are supposed to chase you and right now they're not acting like they're wanting to chase me so I'll need to fix that as well but the idea here is I want to just run Pat okay that guy actually is chasing me a little bit but he it's not very fast like even though he's right next to me he can't attack me for some reason because I'm not quite closer to him and then I just get a little bit away from him and he instantly leaves me alone so that's surprising so I'll need to fix that I want to test this island to make sure I actually win the game when I get there and in addition since I just died I want my unit to respawn here at the beginning when that happens so a few improvements to make but the basic concepts seem to be working so let's quit out and fix those last few pieces I think the first thing is I want to move the Wolves around right here I have way too many and in other places I have hardly any so let's just randomly grab a few and then on the transformation move I'll just pick a new spot I don't think it matters too much where I put it I can balance it later I I need to but I think I'll just do it kind of random I wish I could visually see how big they are in the editor because it's hard to know how many is a good number but I'm thinking maybe I want clusters of two or three at the most and to otherwise have them more spread out and I kind of like the idea of having them kind of hidden underneath these like trees where there's a choke point so that they're harder to avoid honestly I've moved a bunch of them around but I feel like there's still just too many overall on this one section so maybe I'll just delete a few of them I want it to be a little hard and scary but not impossible okay I think that's probably good I'll have to do another play test to see so let's see if I can fix the fact that they're being too passive under entity blueprints with my cloned version of the wolf I'm going to search for combat and you'll notice under the combat extension there are these scan intervals that's how often it's going to try to find a new Target and I'm wondering if there's something causing it to think that I'm an invalid Target too quickly maybe because I'm running so fast that I'm not staying within its range long enough so let's change some of these values first of all this interval with a valid Target that's how often in seconds it's going to keep rechecking if I'm a valid Target right now it's every two seconds I think I'm going to change that to zero so that it's every frame this could cause a performance issue but I just want to see if it even fixes the problem at all but because it's with valid Target it's only going to scan for me after it's first acquired me the first time so it's not like every wolf is going to be looking for me just the one and honestly this map should be very simple anyways as far as the grips performance because we don't have giant battles happening so I'll change this second interval to zero as well and then for an invalid Target that's if the wolf does not have anyone to attack how often it should look for someone into attack I think I'll change this to 0.25 so let's do similar values here 0.25 and 0 and 0.250 now this frequent scan radius that's how big of an area it's going to be searching and it's only running the frequent scan if it has a valid Target so I don't think it should be an issue to do this frequent scanning and in fact it even says it's necessary for melee units which the wolf is I don't know what units this radius is in but I'll just say a thousand and see what happens okay in addition there's this idle targeting section so let's increase its range as well and the fact that this is only 15 makes me think that the Thousand I chose is too big so let's change this to 100 and then on this idle range instead of 15 let's do 150. since we essentially made the model scale 10 times larger than normal we're increasing the range by 10 times as well I don't know for sure if this will fix sit but I'm hoping next let's fix the camera so in my scar file under Mission start let's search for camera functions it looks like there is a move to command so let's use that and first it wants a position which it says it can except a marker so let's use this respawn marker where all the scouts are respawn pan is a Boolean and pan rate is a float I think I just want it to be instant so I'll say false and 0 for the rate I don't think the rate matters since I told the not to pan okay keep locked I want false because I want them to move the camera after it's moved and reset to default I'm not entirely sure what the default camera is so I'll just say false to be safe I think that will fix it if I wanted some examples on how this move function should be used I mentioned earlier that by going to the top of the file you have this missionomatic.scar file if you right click and say Open document it will give you you all of the code you can also use the command Ctrl shift G what I chose to do this took a little bit of time but I think it was worth it is I hit Ctrl shift f for find in files and I searched for import in all open documents find all then I just double clicked each of these lines and hit Ctrl shift G to cause that next scar file to open and I just did that a whole bunch of times until I had opened every scar file and that seems a little strange the idea here is I want a copy of all of these files so that I can search them in the future if I right click on a file and do open containing folder you'll notice it's actually in my temp directory this is strange because I would have expected it to be in the file system already so this is actually a file that's embedded inside the game itself and I've researched it but I'm not sure how to extract it so by doing the search and the Ctrl shift G I was able to get all the scar file files from the mission-o-matic and then copy them out of the temp folder and I put them into this Age of Empires 4 decompilation folder so inside of mission-o-matic I have all these scar files now for General coding I like to use Visual Studio code and it has a search icon that can search any folder for a specific term so anytime I want to do research on something that I'm not sure how to code I can search the existing missions in the game and see how they did it for example by searching for camera I click the first result and I have a whole bunch of examples of how to use the camera that the other missions are using right now I'm only searching scar files but I've actually decompiled a bunch of other files as well so I can search pretty much anything in the game or the editor so there's two other tools I used for that one is called jetbrains.peak and it is a decompiler for microsoft.net programming languages like c-sharp so if I go to my X box games install folder for Age of Empires and inside of content search for dlls and executables I can drag them in and Dot Peak will actually decompile all the code this won't work if it was compiled with C plus plus it has to specifically be a net language but this is the actual editor itself and you can see this app class when I double click it it shows me all of the code it won't be a hundred percent identical to the original but it will be close as long as they have not obfuscated it which is them intentionally scrambling the variable names at compile time and even if it is obfuscated you can still read the code okay but in this case it's not so it's quite easy to read and I can right click on this and say export and it'll save all of the decompiled files to my hard drive so I have all of that in my decompilation folder under Essence editor but in addition the SGA file format is a compiled mod and there are a bunch of built-in mods for the editor and for the the game itself for example for custom campaigns so there is a tool on GitHub called AOE mods dot Essence and Essence is the code name for the editor that Relic created both for Age of Empires as well as for their other games like Company of Heroes but this tool was created by a member of the modding community and if you go to releases you can download the compiled version of this tool which I have here and the executable allows you to open an SGA file for example in my decompilation SGA art I have textures that are part of the game and probably icons and 3D models as well if instead of picking an art SGA I had picked one of the campaign Maps I would have a tuning pack Etc so I have opened up all of the SGA files that come with the game and also extracted them to this Age of Empires decompilation folder so I can very quickly search all of this for examples of how to code whatever I need to if you're interested in opening up the base game files you would just go to your Xbox games Age of Empires content folder if you have Xbox games pass but it would be similar if you have Steam and then just search for asterisk period SGA in this folder and you'll find all of these files to view okay so in case changing the camera the way I did is not successful I can quickly search and find examples for how to do it and the reason I went to all that effort is I got stuck earlier coding this event enter proximity function because the documentation is actually incorrect finally if you want to find the documentation easier it's as simple as going to script documentation and it will open it directly off your hard drive you can also go to help view help and that takes you to the mod Workshop both of these resources are valuable let's compile our mod and retest to see if the changes we made are working open the game play again Skirmish that will automatically pick the map and options I had from before click Start okay here's my horse so the main two things I want to test is are the Wolves more aggressive and does it feel more fair in terms of difficulty where they're not too many in one spot that I can't get past but also that there are not any boring spots with nothing to dodge at all and I'm gonna try not to get scared this time with a wolf instantly gets big yeah that still scared me Okay it definitely seems to be chasing me a lot more than he was before so he did stop after a minute though okay that surprisingly uh first try it actually is better I don't know that it's perfect I feel like maybe I need to increase his movement speed so he could chase me a little bit faster he seems like he runs really slowly back to the entity blueprint under wolf I'm honestly surprised that some of these combat attributes were in The Entity I would have expected it under Squad I wonder if that's because it's Gaia meaning animals instead of a civilization that you're supposed to control because I think it's supposed to be that the entity is the 3D model and the squad is the combat I'm wondering if Relic doesn't always follow that rule anyways let's increase these ranges instead of 10 times larger with 100 and 150 that we used before let's make it maybe 250 and actually the idle targeting doesn't allow any higher than 100. in addition let's see if we can increase its movement speed so it has the same speed level options that my Scout had I don't think we want it to be as fast as the Scout so that you can still Dodge it but I think it should be able to chase a little bit better so the Scout has 16 let's try eight for the wolf again when there are a whole bunch of different settings here I understand the concept of different movement speeds in case it's for example a vehicle that can accelerate but I'm assuming that's not actually enabled for these type of units so I don't know which of the values is actually in use and so that's why I'm just changing them all okay rebuild our mod now if you have the steam version you can also click build and launch but the Xbox games pass version gets confused on how to start up the game so you have to start it up by hand launching the game play again Skirmish start game okay hopefully the Wolves will chase me a little bit better but also hopefully I know this is going to get big uh okay yeah it's definitely chasing me a lot better now that scared me uh so this is actually kind of fun um I guess I forgot I still need to code the resurrect feature oh I was not expecting that guy to appear out of nowhere I feel like I'm probably gonna end up dying uh before I get to the end of the map which is the whole point it should be difficult so it's fine but for testing purposes I need to get to the end did I just die I died for testing purposes I need to get to the end just so I know if the island trigger for winning works and also I need to get through so I can see if the number of wolves is good it still feels like kind of a lot of wolves here maybe I need to delete a few okay I've deleted about half of them on these last two paths so hopefully that should be a bit better so let's make our gout automatically resurrect in my scar file in the setup player function it doesn't matter where I put this but I want to just create an event for when my Scout dies and then I will resurrect it and move it to the start as well as move the camera to the art so let's search for an event when a unit dies it looks like there's one called the event death so first it wants a call back so instead of player winner I'll make it player died or maybe even Scout died I don't know if I need any data yet but I probably want the actual unit which died so that's my callback next is the entity group ID which I'm hoping I can use this horses but that is a squad group rather than an entity group I know sometimes they're interchangeable and sometimes they're not so I'll just try it next it wants all units or any member or any squad I think I just want to know if any member dies but I don't know what data type it's wanting I'm assuming this is an enum and any member is the value inside of that enum let's try mousing over the event's death and see if it has any better documentation doesn't really look like it let's try typing any member okay there's no any member but there is any entity I'm gonna hope that's it but again I can take this event's death search for it in Visual Studio code in my decompilation and see if it finds anything unfortunately it doesn't seem to have found anything so I think I'm stuck just figuring this one out on my own it's possible there are similar events that I could have used instead maybe if I search for any entity I could find examples of that but let's keep going next it wants repeat for that I want true because even after the event is triggered one time I want it to still monitor for other Scouts to die and then require all entities dead I want Falls that seems kind of redundant because I've already said any entity rather than all units so kind of awkward and finally a table of data so the issue here is the horses group is all the scouts for any player ideally I'd like to pass in the specific Scout that died but for now I'll just leave it empty and I'll add a break point here to see if my event is even executing and if I've registered the event correctly and then I need to resurrect the unit so I have both an e-group respawn and an S group respawn since my horses was created with s group let's try that one s group respawn horses and the nice thing is it says it will only respond the despawned squads in a group but I don't want them to respawn at their current location and this horses group contains both the dead and the alive so first I need to find out which ones are dead so there is a method s group git despond at which needs a group and an integer so if I pass in my horses group and the number one it will find me the dead horse just in case more than one died simultaneously then I think I'll do this in a loop and this variable horses I will make it local and paste it into my event handler as well because the create if not found we'll just return the group if it already exists so in order to Loop over this I first need a count of how many have been despawned from the horses group and I'll put that into a count variable then I'll make my for Loop which goes from one to that count and instead of grabbing just the first despawn unit I'll use my incrementing variable from my for Loop so that it happens once for each dead unit in addition I'll have an S group just like horses but instead for the dead ones and each time I get a unit I'll store it into a local variable and then add it to this dead horses group with the S group underscore add function I'll pass in my group and my unit but because this event can execute multiple times as soon as my code has executed the horses should be revived so when I get this group each time I want to First Clear it with s group underscore clear so that will make sure it's empty each round so now I have my group it's cleared then I Loop through how many dead units I have and add them all to the group finally I want to respawn all of them and I want to set the position of all of them to my respawn coordinate and you have to pass two positions the first is where to stand and the second is which direction to be looking I don't care which direction they look so I'll just send the same position for both which will just kind of give it a random direction to look okay I have no idea if this will work or not but I'm hopeful so I'll remove my break points for now and run the code if it fails which I suspect it will then I'll add the break points again and debug it let's build it and open the game play again Skirmish dark game I just realized I forgot to move the camera to the position of the new unit when it responds so I should probably do that as well and something confusing is this camera function did not ask me which player so I feel like every player will have their camera moved to that position there should be player specific cameras that I can look for I'll need to research that but first let's see if I actually respond I'm surprised the code didn't just instantly crash so it at least compiled I'm gonna die on purpose okay I did die for sure I do not see any new Scout here so let's do script attach and remember that will only work if we launched the game with the dash Dev parameter so let's add a break point to when the Callback function is executed and then we'll restart the map in game okay running up to my wolf it killed me but no callback happened so let's run it again but execute this event in the the watch window and maybe execute a few alternatives to it like passing entities instead of squads and different parameters so restart the break point should hit as soon as the map loads and I'll paste this into the watch okay it return the number eight which the last time we debugged events with this enter proximity it also gave a number which makes me think it was registered but obviously it's not working so let's see what alternative parameters I could have sent it does bother me that it wants an e-group and I sent it a s group but instead of any entity I should try any member or any squad I don't think I could find and any member variable but there is an any squad and that would make more sense since I'm using a s group so that's one alternative I want to test so let's copy this version that uses any squad and undo all our code changes you can tell when there's an asterisk in the file tab that there are saved changes so as I click undo it should eventually remove the star once I get back to the original okay then I'll go into the watch paste in the alternate version it gives me a number nine so it has registered the event a second time with my new parameters and then now I'll die on purpose and see if my function gets called it's beneficial to do it this way rather than changing the code and recompiling because then I don't have to close the game and reopen it so it's just a little faster for testing especially if I have no clue what's wrong and I might have to change a lot of different things with trial and error okay script run go back to the game find my horse and suicide okay this looks very promising the game instantly froze when I died so that means I probably hit a break point I'll Tab out to my editor and here's my breakpoint so that's great news so I know I need to change this any entity to any squad let's step through this code one line at a time and just see how it works F10 to skip to the next line I'll open my locals tab tab so we can see my variables inside of horses this actually looks promising it says I have 15 spawned one despond so that means dying actually did despawn and this is my player name so it looks like that is the term for a dead unit is despawned so I'm actually hopeful this might work so step through I have my new group that's empty keep stepping it's now added one unit to this group and now it's going to call the respawn the dead horses table doesn't look any different but I wonder if I right click and refresh if it'll show that it's no longer despawned surprisingly there is no refresh so maybe if I check it from the watch window Dead underscore horses okay it still shows it as despawned so I'm a little bit nervous that maybe this s group respawn did not work but let's just keep going so next there's Squad set position I'll step over that okay it does not like that I sent it a table when it expected a squad star I don't know what the asterisk means here but in C plus plus that is a pointer so that's my assumption so it looks like it wanted me to send it an individual quad unit instead of a group of squad units so that's probably going to crash my game unfortunately if I say script run and go back to the game yeah fatal error so I'll hit OK quit out of the game change this to any squad and then I'll move this set position inside of this for Loop and pass in just the dead unit instead of the full s group but I do also want to try to move the camera I already did that before with this camera moved to with my respawn marker position so I'll copy this and paste it in my diet event handler but I'm a little bit nervous that this is going to force all the players cameras to move when one horse dies so let's see if I can do an if statement base based on the current player and only move the camera if the dead unit belongs to the player my assumption is that in order to avoid desyncs meaning that in a multiplayer game two different players have different code executing probably every player has all of the code run and so this camera moved to would normally execute for every player when any horse dies but it's actually only moving The Current player's camera so if I put an if statement to check which player's computer is currently executing the script then I can make sure that they were the player with the dead horse that's how it works in the Warcraft 3 map editor but Age of Empires might be different so I think I can do this with if game underscore get local player equals Squad underscore get player owner of the Dead unit I'll do this inside the for Loop then move the camera and the for Loop I'm hoping that will prevent the camera from moving for any player that didn't die and in that case I probably should pan so that it's not too jerky so I'll say true for panning and I have no idea what scale to use for the pan rate so I'll just use something like 0.5 okay let's rebuild launch the game play again Skirmish start game no crash so at least the script's compiled let me suicide I don't have any debugger breakpoints set right now okay it looks like it failed on quad set position it says it received a table for parameter two and expected a scar position let's check the respawn variable okay that's true it is a table of type marker I was not aware that's how markers worked I thought they were positions so it looks like underneath the table is the position there's probably a function for converting a marker table to a position okay marker underscore give position with marker ID I don't know what marker ID to pass except the respawn table does have a marker ID field with value 2. so let's do Marker get position with respawn dot marker ID okay but that gave an exception it wanted a scar marker to be passed in let's try marker get position with respawn okay that worked sometimes you just have to try a bunch of things until something works so I think on the squad set position for parameter 2 instead of passing respawn I want to pass marker get position respawn let's try that okay perfect so it still gave me an error but this time it's parameter three that's the error with essentially the same message so I need to pass the position version for the third parameter as well but now I got a different different error that says teleporting Squad failed I was nervous that that might be the case because if it's a dead unit maybe it's unwilling to teleport the unit so I think we have the correct version of the code unfortunately we weren't able to test the camera moving yet because the game will crash here and I can't skip this line but I think we need to take this step position and move it down to after the respawn so let's continue the code which will crash the game then let's kill the game and in the editor I'll do the set position in a separate for Loop I'll copy this for Loop and delete the camera code and the group adding code I'll move the set position inside and I can use the same count variable because even though it was originally the d-spawn units and now they're respond the count itself should still be the same and I'm just going to read out of the dead horses group so instead of reading the D spawned Squad I'll just read the squad because it's no longer despawned but instead of reading from horses I need to read from dead horses I'll copy and paste that variable over technically it's not dead so I could call it revived just for readability's sake and I'll set the position on the revived unit to that location now when I ran in the watch window it did not tell me why it would not set the position I'm just assuming it's because the unit is dead so if it still fails I'll need to do more debugging let's remove these break points save and compile and try again launch the game play again Skirmish start game and suicide our horse okay it still says teleporting Squad failed it does seem like it might be moving my camera although extremely slowly so that 0.5 value was not good and I'm not sure if it actually responded if it did respond it basically just died again instantly I have no control of my camera at all I can't move it because it's still trying to pan although I can zoom in and out so instead of 0.5 let's try 50 maybe let's do script attach again and restart and put a break point on Squad set position let's suicide again and when the break point happens I'll try alternate versions of this set position I feel like the S group respawn is not working because when I look at this revived variable it still says Health 0 out of zero which makes it feel like it's despawned and dead horses still shows it as despawned as well let's run this s group respawn from the watch to see if it gives an error of sorts it doesn't give an error it just returns a nil so I've decided to search my decompiled gar files and I looked for the respawn keyword and I found a function called respawn leader that seems to do exactly what I want it has a slightly different way of moving the unit which I might try but more importantly it sets the health of the unit it changes its inactive flag to false and it clears the pending death flag and finally it calls this extra function leader recovery which transfers the ownership back to the player so I'm assuming I need to do all of those things to truly revive a unit if that works that's the type of thing that really should be coded into a utility function that's reusable because that's a lot just to revive a unit so I don't think it's worth it to try to test all of that in the watch I may as well just code it and try again so script run let kill the game I'll use this other method to move the unit and even though the example code was using position I'll try the marker way first since I actually do have a marker revived and respawn location if that fails I will do warp 2 position with util underscore get position with my marker but I'll comment these two lines of code out since I'm hoping this top one will work and surprisingly the example code was moving the unit before they even responded in fact I don't even think they called this s group respawn so I'll comment that out since it doesn't seem to do anything anyways next I'll get the entity from my revived unit which I should rename since it's not actually revived yet and put that into a entity variable and I'll call entity set date model rule with the entity hero inactive and it'll be interesting to see if this is necessary because this character isn't really a hero it's just a normal unit I'm not sure what this property is for but the example code specifically was talking about a liter of some sort that's being revived I'll set that to false then entity clear pending death flag on the entity and it specifically says it's for Reviving leaders interesting and I forgot after I warped the unit I need s group underscore set average Health on the revived unit to 1 meaning 100 I'm hoping that this will work and honestly I think I prefer to put it inside the original for Loop and get rid of the dead horses group altogether I don't want to lose this code in case I need to revive any of it so I'll just copy it and paste it into notepad and then I'll just clean up this code remove dead horses don't add it to the group and then all this code to revive paste it inside the first for Loop delete all this code I don't need and change all the revived variables to dead finally I decided the camera was moving way too slowly let's try 50 and see how that works save it build load the game play against Skirmish start game no crash yet but I guess that makes sense because it doesn't actually run the event handler until I die so my Suicide invalid group guad during command stop that's a bit confusing because I don't have a line of code with command underscore stop but here you can see the call stack I executed s group underscore warp to marker internally that called warp to position and then inside of two other files groups.scar and command.scar which I did not write it's calling this command.stop so I think I sent it a squad and it wanted an S group so instead of dead here for S group or to marker I should have passed in just the dead horses variable that I deleted which I'm probably going to need on this set average Health as well but rather than rewriting this to add all of the units to that s group just for simplification I think I'll use the S group as a single item list because my functions probably only getting called with one horse anyways so I'll paste in the code I had before but instead of calling it dead horses I'll just say horse e for one horse and I will instantly clear it even though I'm inside of this for Loop so if there actually were two horses when it Loops over the for Loop two times each time the S group will get cleared and we'll call these methods separately the benefit to these methods is they can be used on a list of units for performance reasons and to avoid unnecessary for Loops but I'm already in a for Loop and the performance impact should be negligible I'm not going to worry about it okay so warp to marker we'll use dead horsey and set average Health we'll also use that because they're both s-group variables but immediately after clearing the group I need to add the dead unit to the group which means I need to read the dead variable in between clearing and adding I think this should work in the future I should maybe be more careful with my variable names I'm learning that the difference between a squad and a squad group and an entity and an entity group is very important so I may want to in the future add prefixes to variables something like SG underscore dead and S underscore dead for S group and Squad just to make it easier to keep track of but it's fine for now okay next round of testing quad get first entity failed no entities in Squad so this was where it was trying to clear the death flag which was a new thing I found in the other example I don't know if that's really necessary or not and maybe only leader units can be respond I'm not sure but what's interesting is the main thing that was failing before was warping it to a different position that was giving me an exception but this new version does not it's possible I don't need this entity code and just the better version of moving the unit is all I needed in addition it did allow me to change the health which you would think would revive it as well since I never got an error before when I tried to respawn the unit I think I'll keep that code and maybe just remove this entity code but I am curious about this death flag if I search for that is there anything else for example a squad death flag it doesn't look like it so I think I'll try again with this if it's still not working I might troubleshoot why there is no entity in the squad because my understanding is every unit is both an entity and a squad I'm wondering if the reason I can't get the entity is because it's dead or something maybe I need to test that by trying to get the entity here before it's died or maybe this function Squad get first entity even though it says it wants a squad maybe it actually wants an S group because I've learned that the documentation is not always accurate so let's try this and do another round of testing next round of testing to a side by unit okay that was interesting um my unit stayed dead but the camera definitely panned me and it felt like a decent speed for panning but I don't see any unit that I have control of I have the suspicion that it's not possible to revive a normal unit this way it must have to be defined as a leader of some sort I think what I need to do instead of trying to revive it is probably just spawn a brand new one so first once I have the dead unit I will remove it from the horses group s group underscore remove or sees dead then this s group I'll change to new horsey instead of dead horsey and instead of adding the dead unit to this group I will spawn a brand new unit I can do that with BP underscore for blueprint get quad Blue Print and pass in the name unit underscore Scout underscore one underscore Eng and save that to a variable next unit entry underscore deploy squads which needs a player which will be the owner of the dead horse and I need the ID of that player next the group I want it deployed to which is new horsey so I actually don't need this s group AD anymore and then I need a table with options I need to pass the blueprint and the number of squads to create that goes into this unit's parameter entry method stagger and options can be ignored and they'll just use default options I could put this location into this deploy squads and I shouldn't even need this health because it's going to default to 100 Health I'll comment this one out and I'll move the respawn marker to the bond parameter of deploy squads so I can comment out the warp to marker as well I think this should correctly create my new horse now I need to take the S group for horses that I started with the only purpose of it was to register these two events I need to make sure the new unit is added to this group so I'll say s group underscore add horses and S group underscore get Bond quad at new horsey comma one so let's try this out save build Run the game play again Skirmish start game and keep our fingers crossed of course an error invalid parameter 2 type Xbox did player received nil I think I should not have passed dot ID here on deploy Squad so let's recompile and test one last time okay I have a good feeling about this one


okay that works perfectly I will need to test with multiplayer but I think this is solid and now I've got to see talking so fast he's hard to get away from now I need to see if I can actually get all the way to the end to the island and end of the game and finally just some finishing touches like oh I did not expect that wolf it came out of nowhere I just died I mean I'm glad the game is hard I'm sure once you've played it 10 times you'll get the hang of it and it won't be hard but that should be the fun of it right I am nervous when I get to the other sides of the map where there are more wolves because it's hard when there's just one or two whoa where did all of these wolves come from I was not expecting like four in one spot there's definitely some finishing touches I could and should do for example oh I almost have to lure the wolf away so I can get around him because there's two wolves really close to each other I don't know I went the wrong direction I feel like I'm gonna die I need to change my character to invulnerable just for testing because if I get all the way to the end then it still doesn't work I'm gonna be upset let's see if I can walk around the wolf looks like I can little secret shortcut here so some finishing touches I think would be good obviously changing the start window to tell the player the goal that they're supposed to get to the island would be helpful I can't believe I still have an idea I know I'm about to though there's no way I survive here right oh no I all the way here and died I was so close I'd say the difficulty is just about right okay just for testing purposes I think I will make my player run faster and make him invulnerable but I'll have to remember to switch it back definitely for a version two I could add more advanced features but I think the gameplay in general is solid for just a fun little mini game obviously not something you would keep playing over and over again so let's test out this island quit out of the game make my horse faster with more hit points compile and it would be smart to code something like that into this setup where I check if my name is the local player name and if so I modify my Scout that way I don't have to remember to keep changing back and forth because if I do multiple rounds of testing and adding features I'll always have to remember to reset these settings whenever I'm ready to publish which would be annoying I have taken some damage but it's no big deal because I have 100 hit points I still think it's so weird that the unit just gets big all of a sudden I did not code that intentionally I don't know why it does that but it's actually super cool and scary okay I'm about to where I was last time when I died you know the multiplayer aspect might be helpful because you might have to as teammates one person lures a wolf away while someone else tries to run through okay I finally made to the island um okay this is very annoying uh it looks like I can't actually get to the island itself because I'm clicking and it's not letting me um I think the issue is this water is too shallow so let me fix that real quick and then I'll retest because we need to know if the trigger Works to say that we win once we get to the center quit out and then in the render Tab and the scenario window there's two options we could either just raise the ground level or reduce the water level here or the other option is there is something called an impasse map which basically just says if you can walk there or not it's designed where you have a left mouse and a right Mouse for drawing and painting so right now the right Mouse has the Eraser and the left Mouse has the paint so if I use my left Mouse it draws a green area but if I use my right Mouse it erases that green area so by looking at the settings I've got infantry and vehicle selected which I think should be fine I don't need to mess with water because I don't have boats in this map and I don't need to mess with building because I don't have villagers in this map so I think essentially if I just draw this green right here that means I can walk there so let's save and build start the game now I'm not going to record the entire walk because you've seen it 10 times already and it's getting boring so I'll just skip ahead to the end okay almost there hopefully I can run through you have got to be kidding me that impasse map made no difference at all I guess we'll try again so the other option instead of going to the impasse map is we can go to the water height map and same thing our left brush is set for painting the height and our right brush is for erasing the height you can mess around with different settings here but I'll just left click and drag and that seems to have completely gotten rid of the water so I think that worked I think I'll just go a little further to make it look like an island of sorts okay it doesn't look perfect but it's probably fine let's just double check the impasse map again it's still showing red I don't like that I guess one other thing we could try is instead of changing the water height change the height of the ground same thing just left click and drag it looks really funny how I did it but let's see if it fixed the impasse um doesn't seem like it so they're really stupid and obvious answer is I could just move this marker up higher so that basically when you get to this Edge you've made it but it feels sad to not actually build a walk onto the island itself I wonder if even though changing the height doesn't fix the impasse map and same thing with the water height the impasse map stays red I wonder if one of them actually does work so let's try each one separately and then try all three together if none of them individually fixes it so we'll start with the water height I'll reduce it all so that it should be payable save build okay I actually could walk the whole way this time so that fixed it the game like froze on me but I didn't get an error but it didn't say that I won so I can hit escape and quit out but I feel like it should have announced that I won I think it must have called this end of mission so the trigger works great and it looks like fixing the height Map works great I just need to figure out what's wrong with this end mission command I think the reason it failed is because I'm using mission-o-matic and Mission but I'm not really in a single player campaign so I don't really know how this is intended to work if I look inside the code I notice that it says game end single player that seems wrong to me because again I'm not in the single player campaigns but if I type core underscore set team Victorious I think that will work for multiplayer and technically if any player gets there the whole team is considered to have won which I guess could be annoying if you got halfway there and someone beat you to it but that's all right that's how the original map was in Warcraft 3 so I'm sticking with it so I'll say player get team and game get local player now I made it so all players are always Allied so no matter what this will always be the same team but git local player would be a bad idea to pass in here as it would cause a desync if there was more than one team the correct option would have been to register these event handlers separately and pass in the unit that got to the island so then this data variable would have the horse and I could get his team but I don't want to restructure the rest of my code so this is the easiest option and it'll work next for the presentation function I don't want any special function I'll just let the default happen and for the reason they won I'll say win reason underscore objective complete I got this by searching for core set team victorious in the decompiled code but I'm a little concerned that the objective complete was not found when I searched the documentation so I'm hoping it actually works okay let's just retest getting to the island to make sure the new wind condition works correctly okay gave me an error attempt to index a number value local team let's attach and restart I'm wondering if I'm passing a player ID and it expects me to pass a player object or vice versa okay we're at our break point so in the watch get local player is returning an actual player object get team with watch returning team zero I don't remember what the error was but it was something about like that the team didn't exist or something okay I think the issue is this is a team number and I think it wants a team object so if I call Core git teams entry from index with parameter zero that's not very helpful it's returning nil okay I've added a few functions to the watch table and I think I found the issue player get team is returning zero which does not seem correct because if I say core get player teams entry with the same player I get a table and it has an index with value one so I think the team is actually supposed to be one not zero so then when I tried to get the team's entry from index I should have passed one which gives me the team table there seems to be a bug in player get team but I'll just take this team's entry and pass it to the Victorious function I'm hoping if I just pass this whole thing to the watch I'm hoping I can continue the code and even though this method will crash I'm hoping the rest of the game will work but I'll probably have to recompile scripts run there's my error you have to run go back to the game oh it actually does seem like it knows I won because it says view summary which shows Victory okay perfect I think that worked let's quit out I think really the only other thing I want to change is just clicking on my scenario if I go into the description I just want to say get your horsey to the safety of the island and I've uploaded all of the code to my GitHub so that anyone else who wants to mess with this mod can so I'll just put my GitHub Link in that description so I'm going to say that was a success the only last thing I would probably change is this mod.png so that it doesn't look like it's in construction I'll add some kind of thumbnail but thank you so much for watching let me know in the comments below if you have any questions and more importantly let me know what kind of map you want me to create next I'm thinking maybe I'll do a tower defense although this map was fairly simple it was a big learning experience since I'd never done a map in Age of Empires before now that I have that experience I think I'm ready to tackle a harder map so hit that subscribe button so you can stay tuned for my tower defense video I create next

Popular posts from this blog

TeamFightTactics - Rules & Strategy - Coding an AI - Part 2

Intro to JavaScript - Coding a TFT AI - Part 3