|
|
Posted By: Anonymous (2005-09-08 08:00:05)
i am making a unit which can create other units.. how can i make it kick the units out automatically like cities?
|
Posted By: Tully (2005-09-08 08:30:51)
Override unitBuilt( tile unitThatWasBuilt ) for the unit that will be building new units then in that method use kickOutStored( tile container, int indexOfUnitBuilt ) to push out the new unit. The easiest way is to use -1 for indexOfUnitBuilt which kicks out all stored units.
|
Posted By: Anonymous (2005-09-08 16:55:26)
i tried that but it is not working
|
Posted By: Tully (2005-09-08 18:33:12)
you have to make a seperate js file with the unitBuilt command in it and then at the time you build the main unit (in the city script) add the new script to that unit using setScript( tile tileToScript, stirng scriptName )
|
Posted By: Tully (2005-09-08 18:33:40)
If I get a chance I will block this out for you tonight
|
Posted By: Anonymous (2005-09-09 09:23:28)
i dont understand how that works
|
|
|