idea for [unit] tag

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Forum Moderators, Developers

idea for [unit] tag

Postby enclave » October 27th, 2016, 10:28 am

I was looking for some wml that would create a random unit from the list or something similar.. And I didn't look thoroughly but I think the best way to do it is with lua, or am I wrong? Why not make it possible in [unit] tag?
For example if:
type=Peasant,Ruffian,Gorilla,Godzilla,Dragon,Spearman
then it would create a random 1 of these?
Just a though to make life easier.. somewhat..
Thanks..
enclave
 
Posts: 533
Joined: December 15th, 2007, 8:52 am

Re: idea for [unit] tag

Postby zookeeper » October 27th, 2016, 11:03 am

Well surely that one additional {RANDOM "Peasant,Ruffian,Gorilla,Godzilla,Dragon,Spearman"} line that you currently need for it isn't a big complication?
User avatar
zookeeper
WML Wizard
 
Posts: 9617
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: idea for [unit] tag

Postby enclave » November 6th, 2016, 8:52 pm

thanks, you probably right, I didn't look into macros, so didn't know it could be done the way you showed.

it would still be easier in [unit] because then you could modify it straight away without storing unstoring.. it's just an idea to make life easier, nothing more..
enclave
 
Posts: 533
Joined: December 15th, 2007, 8:52 am

Re: idea for [unit] tag

Postby zookeeper » November 6th, 2016, 9:10 pm

enclave wrote:it would still be easier in [unit] because then you could modify it straight away without storing unstoring

What? There's no storing or unstoring.

Code: Select all
{RANDOM "Peasant,Ruffian,Gorilla,Godzilla,Dragon,Spearman"}
[unit]
    type=$random
    ...
[/unit]
User avatar
zookeeper
WML Wizard
 
Posts: 9617
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: idea for [unit] tag

Postby enclave » December 18th, 2016, 12:15 am

Yeah you right, i'm stupid.. sorry, didn't know/think of this at the point of writing.. Or I don't even know what I was thinking back there.. But it's good example.. thanks!
enclave
 
Posts: 533
Joined: December 15th, 2007, 8:52 am


Return to Coder’s Corner

Who is online

Users browsing this forum: No registered users and 3 guests