Jump to content

Build menus - How do I give different units different build queues?


LordStark
 Share

Recommended Posts

Hi everyone,

I want my "Lord" unit to be able to build a castle (and only a castle) and my "Vassal" unit to be able to build a Fortress (and only a fortress). But I can't figure out how to give the two units different build queues - any ideas?

Link to comment
Share on other sites

Currently they inherit the builder mixin. Think of mixins as partial templates. You can remove elements from the queue by writing -building Or you can change the inheritance to not have to do that.

Link to comment
Share on other sites

Thanks for your reply. I did not quite understand what you meant - where would I write -building? 

Also, do you mean that exact code or do you mean <Builder disable=""/> which is the code that I use to completely remove a build option from a unit?

How would I change the inheretence? Apologies for all the questions, i'm really trying to figure this stuff out on my own and I often use the search function before asking a question.

Link to comment
Share on other sites

I tried that code and it didn't work. I thought I had already tried it but just in case I copied and pasted your code exactly - and checked the path directories that there are not spelling mistakes or missing capitals etc etc

Link to comment
Share on other sites

@LordStark it would be much more efficient for you yourself to read either the templates in the main game (<Entity parent="builder|template_unit"> means the template_unit "inherits" from the template "builder" in the "mixins" folder, and that is where your answer can be found) or at least the docs at https://docs.wildfiregames.com/ (e.g. https://docs.wildfiregames.com/entity-docs/trunk.html#component.Builder). :)

Link to comment
Share on other sites

Thank you, this is amazing. Could these two documents and the path page be stickied?

Path page: simulation in ps/trunk/binaries/data/mods/public – Wildfire Games

When I came to these forums I read the tutorials that I could find and often use the search function. I really find what I am looking for - but you guys have been amazing. I think these two documents would have substantially helped me and cut down on all my questions (and so saved you all some time).

I have decided to learn Java so maybe one day I can help with the game - I am on my second lesson and loving it!

Really appreciate all the help.

  • Like 1
Link to comment
Share on other sites

Actually Java is very different from Java script which we are using you need to be very careful with names when dealing with computer languages after all we have been doing it for over 50 years now so it's complicated ;)

Enjoy the Choice :) 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...