Page 1 of 1

Allow only one unit of is type

Posted: Tue Dec 20, 2016 7:05 am
by Mizukami999
Hello everyone!

I wanted to make special units/heroes that can be hired, but onlu one per type.
What's the easiest way to do this by using scripting only?

I thought it's right to introduce new resource types, but I can't figure out how to, so I suppose they're within the compiled game not scripts.

Any ideas, please?

Re: Allow only one unit of is type

Posted: Tue Dec 20, 2016 8:25 pm
by Yukiko
Resources are defined via scripts. However, I believe you can limit it to one via the build button. You should be able to make the button disappear when you've already got the unit.

Re: Allow only one unit of is type

Posted: Tue Dec 20, 2016 10:39 pm
by Mizukami999
Thank you - I'll investigate about the buttons...

Re: Allow only one unit of is type

Posted: Tue Dec 20, 2016 11:40 pm
by Mizukami999
I found the answer. At least, for SP:

viewtopic.php?t=3537

Re: Allow only one unit of is type

Posted: Thu Mar 02, 2017 8:09 am
by Andrettin
Mizukami999 wrote:Hello everyone!

I wanted to make special units/heroes that can be hired, but onlu one per type.
What's the easiest way to do this by using scripting only?

I thought it's right to introduce new resource types, but I can't figure out how to, so I suppose they're within the compiled game not scripts.

Any ideas, please?
The maximum quantity of resource types is defined in the engine (namely 6), but you can define what they are in the scripts. 6 resource slots is probably enough for you to achieve what you want.

Re: Allow only one unit of is type

Posted: Sun Apr 23, 2017 6:14 am
by Mizukami999
The maximum quantity of resource types is defined in the engine (namely 6), but you can define what they are in the scripts. 6 resource slots is probably enough for you to achieve what you want.
Thank you! For now I used dynamic unit disallowing - too many unique units.