 |
|
celicakydd
|
|
Harrisburg, PA
Nov 2001 time: 00:24
|
|
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.
|
|
|  |
 |
|
J Bytheway
|
 |
England
Jul 2001 time: 05:24
|
|
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):
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
.
.
.
(I can provide more details on actually implementing this if you wish).
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 on 09-12-2002 at 21:18
|
|
|  |
 |
|
celicakydd
|
|
Harrisburg, PA
Nov 2001 time: 00:24
|
|
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.
|
|
|  |
 |
|
celicakydd
|
|
Harrisburg, PA
Nov 2001 time: 00:24
|
|
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.
|
|
|  |
All times are GMT. The time now is 05:24. Apolyton Time is 00:24. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|