|
|
|
|
# 1
|
|
Ouroboros-in-training
Join Date: Jul 2006
|
Advanced Coding: New Buildings & the Advanced Build Menu
Rating: Rookie to Competent
Warning - I won't be going as slow as the AE basics in this. A common question asked is "how do I add new buildings? I've created a new EBPS for them but I can't get it to show in the build list". Well, here's where I will answer that. Powers of Observation The build list is populated by all the buildings in a race's structures folder (yes, all, even the single player ones, you'll see). You don't have to do anything, the build list will populate itself automatically from the structures folder. "But my building still doesn't appear!" - where most people fail with this is simple observation and maths (use your brains please guys! ). Take space marines for example, they have 11 buildable structures. When you click on the build button those 11 building icons appear, and the 12th slot is filled with the 'back' arrow. ![]() Fig 1. - a full menu When you make your new, 12th building there is, of course, no room for it to appear. Where exactly were you expecting it to magic itself to? Somewhere else on the user interface? The reinforcement box? Squeezed inbetween some other build icons? Try it with Orks and it'll work out for you as they have a couple of spaces left.A Problem of Space So the problem now is one of space. The solution to this is that there is already a second build menu coded, the advanced build menu. Take a look in the structure_buildable_ext on the entity files for the buildings and you will see that there is an 'advanced_build_option' tick box. If that is ticked then the building will not appear in the basic build menu, but it will appear in the advanced build menu. This is where all the single player buildings that you see in the AE have gone, check them, they'll all have the advanced_build_option ticked. Buildings will appear on either the advanced menu or the basic one, but they will not appear on both. Right, well now we know that there is extra space, we just have to get access to it. To do this we need a file from the archives (go here for how to extract them). Extract DXP2data.sga (you may have done this already for another mod as it's a very useful archive). Inside the extraction open up 'game' folder. There's a file in there called taskbar.lua, copy and paste that file into yourmod/data/game i.e. a replica position within your own mod folder, you'll need to create the game folder yourself. Now open it up with a text editor and we can get working. (More on folder trees here) The advanced build menu appears as another button next to the normal build one that you click on to bring up a different menu. There's two things you need to change to get this working: First - there's a command that tells the UI where this button should go. Currently it's commented out and is having no effect, all we need to do is remove the comments for it to kick in. You need to find this line: Code:
Code:
Second - we need to UNcomment one more line. Code:
Code:
Okay, now save it and fire up the game. All your builders will now have that extra build menu with a dull grey icon. ![]() Fig 2. - Yuk! Open it up and you may see one or two building in there that look familiar, these will be the single player buildings, this is where they have gone (aaaahhh! I see!). So, now you can tick some other building's advanced_build_option in the AE and see how they move across to the new menu (remember you'll need to save binary for this to take effect). We'll sort those random buildings out in a moment. ![]() Fig 3. - the mythical Tau Turrets ready to be built Race Specific AH YES, BUT: - you only need/want the advanced build menu on ONE race right? Not a problem. If we look at some other parts of the taskbar.lua then we see that some bits of code are race specific. This is acheived by using this line Code:
Code:
Code:
So to make it work for say only Eldar the full code would be: Code:
So we still have one problem - unwanted single player buildings that are weird duplicates. Easy to fix, pick one you want to get rid of and simply set all the requirements in the building's requirement_ext to none, then change one requirement to required_structure and choose a structure from another race, then do the same again in a second requirement field, but this time tick the display_requirement box also. EG - set the Tau turret to require the Chaos HQ. This way you will never be able to build it as you will never have a building from another race, and it will never display either for the same reason. Repeat this for any other offending buildings you still have. If you want to change the tooltips for it then you can just edit them in that long line of code we messed with, there's one for the name and one for the description. And there you have it really. Here's a little build icon that I whipped up for no real reason. Use it if you like. The location and name for it is contained in the long line of code we UNcommented, I'll leave you to sort that out (icons tutorial here - the icon will go in yourmod/data/art/ui/ingame/command_icons). ![]() Fig 4. - my little icon, use and abuse people Thanks to - Compiler for figuring this out long before I even began modding, I only know how to do this through dissecting his work. Last edited by Octopus Rex : 13th Feb 09 at 6:05 AM. Reason: Tweakage |
|
|
|
|
# 2 |
|
Banned
Join Date: Nov 2006
Location: @0,0
|
hey Rex, your tutorials are fantastic, i love you!
can you make one how to make new units appear on a building's build list? i think im just clumsy, but i didnt find a tutorial about this (i know its havent actually, but this is part of my campaign to simplify English language haha ) |
|
|
|
|
# 4 | |
|
Banned
Join Date: Nov 2006
Location: @0,0
|
ok, ive found on one of the Skins@HiveWorldTerra Tutorials how to add he unit to the build list in the building:
Quote:
this should be added to the end of your hypa-dypa squad making tut, hmm? Thank you for all your help Octo!!!!![]() Last edited by edvin76 : 26th Oct 07 at 7:29 AM. |
|
|
|
|
|
# 5
|
|
Ouroboros-in-training
Join Date: Jul 2006
|
....ummmm, yeah, maybe you should post it the squad tutorial then?
![]() And no, I won't be adding it to the squads tutorial. 1. that information is already part of a tutorial on buildings that I'm working on, which is where it more rightly belongs. 2. Copy pasting other people's tutorial's is unnecesary, I should just link people to that tutorial instead. Thanks anyway ![]() Last edited by Octopus Rex : 26th Oct 07 at 9:35 AM. |
|
|
|
|
# 10
|
|
I love lamp
Join Date: Oct 2004
|
Sort of related to this - I have moved the eldar support platform into the ork ebps folder in my mod, and also deleted the mek_shop.lua with the intended result being that the mek shop was swapped for a scatter laser on the ork build menu. However... nothing has happened. In AE, the orks still have the mek shop listed and not the scatter laser.
Any advice? |
|
|
|
|
# 11
|
|
Ouroboros-in-training
Join Date: Jul 2006
|
The mekshop will still be listed because deleting won't do anything, it will still inherit from DXP2 or wherever, it won't burn a lack of lua in the data folder, this gap will just be overriden by the dxp2 archive.
As for the scatter laser, you will need to edit the inheritance path by hand, as it will stil be inheriting form eldar_building.nil at this point. |
|
|
|
|
# 12
|
|
I love lamp
Join Date: Oct 2004
|
That makes sense. I suppose I can untick it as buildable.
I've changed the eldar_support_platform_scatterlaser.lua to read GameData = Inherit([[ebps\races\ork\structures\ork_building.nil]]) MetaData = InheritMeta([[ebps\races\ork\structures\ork_building.nil]]) Is that on the right lines? |
|
|
|
|
# 14
|
|
I love lamp
Join Date: Oct 2004
|
damn inflected languages - of course I read Eldar and took it to be singular.
Have changed it to plural and it's not working still. Strangely I have added new C2C units in before, buildings are obviously harder. Will it make a difference that I haven't renamed the eldarplatform? Shouldn't imagine so. It will have to wait until the weekend now anyway I guess :S *goes off to search through other tuts for clues* |
|
|
|
|
# 15 |
|
Guest
|
I'm using advanced_build_option to make buildings unbuildable, but the skirmish mode AI seems to build them anyway if I wait long enough (the delay might just be it saving up resources, as I have them coming in really slow, I just thought of that).
Is there a better way to make them unbuildable for the AI? I guess I could set the cost prohibitively high, but there's got to be something more sensible? |
|
|
# 16
|
|
|
Ouroboros-in-training
Join Date: Jul 2006
|
Ai doesn't need to see the buildings to be able to build them.
Quote:
|
|
|
|
|
|
# 19 |
|
Guest
|
You got me, I must have skimmed that part. Now I'm one of those posters.
![]() Thanks! I have a wincondition that spawns a building that shouldn't otherwise be built, and was worried that a requirement would stop that from happening, but can confirm that it works fine, for any curious lurkers from the future. |
|
|
# 21
|
|
Ouroboros-in-training
Join Date: Jul 2006
|
He he,
![]() Daevel - yeah, I can see why you'd think that'd be a problem. So basically does SCAR not pay attention to building requirements at all? Another alternative would have been to edit the AI and remove the building from the build strategies. |
|
|
|
|
# 25 |
|
Member
Join Date: Oct 2008
Location: Up a mountain somewhere
|
hey octco,
great tutorial as usual, the've been a great help to me question: is it possible to have one unit able to build only from the basic build menue and another build only from the adanced one? e.g. working on the wolf lords mod and doing iron priest, who (in theory) can only built turetts while the thrall (sevitor) deals with all the other buildings. i need the thall to only have acsess to the basic menu and the iron priest to only have acsess to the advanced menu. is this even possible? any clue how it could be done? i have had a wee look and am guessing it would be an extension of the race specific section but exaccly how to do it is beyond me thanks Chief |
|
|
|
|
# 28 |
|
Member
Join Date: Jul 2009
Location: England
|
Hi.
I have used the build advanced structures for the defensive structures for my mod "Dawn of War: Unlimited" for Dark Crusade, But is it possible to have three build menus, as i have managed to create a third structure menu by copying the advanced structure info in the taskbar.lua file and changed it to 'build_def' instead of 'build_adv' and changed the UI number to 10, although don`t know how the set the buildings that to be built in this menu, because there is only a "advanced build option = true" on the structures RGD files i added a new child "defensive build option = true" though nothing happened. ![]() Neilmarines. |
|
|
|
|
# 29
|
|
PlasmaSQUID!
Join Date: Jul 2006
Location: Netbeans
|
You can't add a new child parameter and hope the game accepts it. There is no way to create a third menu and populate it with additional buildings because the hardcode (the code that makes the game work in the way it works) doesn't allow for that kind of flexibility.
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|