idea for [unit] tag

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

Moderator: Forum Moderators

Post Reply
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

idea for [unit] tag

Post by enclave »

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..
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: idea for [unit] tag

Post by zookeeper »

Well surely that one additional {RANDOM "Peasant,Ruffian,Gorilla,Godzilla,Dragon,Spearman"} line that you currently need for it isn't a big complication?
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: idea for [unit] tag

Post by enclave »

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..
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: idea for [unit] tag

Post by zookeeper »

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]
enclave
Posts: 936
Joined: December 15th, 2007, 8:52 am

Re: idea for [unit] tag

Post by enclave »

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!
Post Reply