I was looking through the SLIC code and was wondering if anyone had any thoughts on what way to approach upgrading units once they become obsolete or possibly at least cashing them in for gold or resources.
Announcement
Collapse
No announcement yet.
SLIC question...can I use it to allow for upgrading units?
Collapse
X
-
You can code unit upgrading in SLIC but it would not be easy. The code would be simple but very very very long. I guess it would go something like (in pseudocode):
(I can provide more details on actually implementing this if you wish).Code:trigger on gaining advance if advance is bronze working loop through all units if warrior, change to phalanx if advance is ... loop through all units . . .
You could of course add some kind of cost to this upgrading, and prevent it if the player had insufficient gold, or upgrade only those units in cities, etc.
You can already cash in units for resources by disbanding them in cities, whereupon half their production goes towards helping whatever is under construction.Last edited by J Bytheway; December 9, 2002, 12:18.
-
Thanks so much for your help. Yes, I think I would like to try this and see if I can make an upgrade script of sorts. I got the idea from the powerslic mod I downloaded where every time a settler moves through a city it asks if you want to add the settler to the city POP. I was thinking I could do something similar if the unit is obsolete in asking if you want to upgrade the unit if an upgrade is available.
Comment
-
Well, I am in the middle of writing my script to do automatic unit upgrades. So far I am only testing it with one unit to see how it goes, then I will expand it to all the units with upgrade options. I want to make sure it works in multiplayer and also for the AI. Thanks again for your help.
Comment
-
I don't know if it can be of any help but there is already an Update slic file for the CtP2 Cradle mod and I am currently working on a conversion to the CtP2 Super Apolyton Pack 2.Originally posted by celicakydd
Well, I am in the middle of writing my script to do automatic unit upgrades. So far I am only testing it with one unit to see how it goes, then I will expand it to all the units with upgrade options. I want to make sure it works in multiplayer and also for the AI. Thanks again for your help.
"Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill
Comment
Comment