Allow only one unit of is type

Wargus is a Warcraft 2 mod that allows you to play Warcraft 2 with the Stratagus engine.
Mizukami999
Posts: 14
Joined: Tue Dec 20, 2016 7:00 am

Allow only one unit of is type

Postby Mizukami999 » Tue Dec 20, 2016 7:05 am

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?
Yukiko
Posts: 52
Joined: Sun May 24, 2015 6:52 pm

Re: Allow only one unit of is type

Postby Yukiko » Tue Dec 20, 2016 8:25 pm

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.
Mizukami999
Posts: 14
Joined: Tue Dec 20, 2016 7:00 am

Re: Allow only one unit of is type

Postby Mizukami999 » Tue Dec 20, 2016 10:39 pm

Thank you - I'll investigate about the buttons...
Mizukami999
Posts: 14
Joined: Tue Dec 20, 2016 7:00 am

Re: Allow only one unit of is type

Postby Mizukami999 » Tue Dec 20, 2016 11:40 pm

I found the answer. At least, for SP:

viewtopic.php?t=3537
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: Allow only one unit of is type

Postby Andrettin » Thu Mar 02, 2017 8:09 am

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.
Mizukami999
Posts: 14
Joined: Tue Dec 20, 2016 7:00 am

Re: Allow only one unit of is type

Postby Mizukami999 » Sun Apr 23, 2017 6:14 am

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.

Who is online

Users browsing this forum: No registered users and 1 guest