I want to have buildings that have researchable upgrades. I've been able to do this fine for the most part, but I am having trouble with two of them:
1. I want to be able to build a "turret" in the building (i.e. allow it to fire at enemies). In order to do this, my plan was to give the building a weapon in the unitdef and set
so that the unit could not attack unless I changed the fire state manually (which I would do when the building was upgraded). However, it seems as though noAutoFire = true locks the firestate on "Fire at Will". Is there a way to get around this? Or a better way to do what I want to do?
2. I want the buildings to be able to repair units when a certain upgrade is researched. However, apparently I can't set canRepair = true if I have a yardmap in the unitdef. What gives?
Joined: 24 Jan 2006, 21:12 Location: There is no god - and reality is his prophetess
Why not just allow the weapon to exist normally and then set a boolean on aiming, so that the hidden, not yet upgraded weapon cant fire?
Setting it in the unitdef could (unless changed) permanently label it as a peacefull constructor unit.
Sorry, but it seems a bit overcomplicated.
edit: Sorry, re-reading my post i sound arrogant as SomeWhat. Guess i should keep my lips sealed, using 1200 overcomplicated lines for one freaking train. So disregard my post.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
smoth wrote:
I'd recommend unit swap instead of toggling weapons for upgrades as it will cause issues with info box tooltips.
Would rather fix w/e info tooltip wupget then. Weapon upgrades is something that should work without unit swapping simply by (un)blocking weapons or editing them. Spring.SetUnitWeaponState can also be used to "upgrade" weapons, at least "reloadTime" works as expected. "aimReady" is maybe even better for blocking but I have not tested.
cannot re-designate primary weapon, what if he needs to be able to choose weapons? the unit still primarily aims with the weapon 1. Unless they changed that.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
yea, i think its still like that. Though it only matters when you change what stuff the weapon can target. (like swap a cannon vs torpedo or different weapon range) For a stationary building primary weapon does not matter so much (at all?) because it can not move into range anyway.
Is the building in question a factory? If it is then it cannot do things like repairing. I'm not sure what the restrictions on non-factory buildings are but there are plenty of those with build capability in the form of nanotowers in various mods.
Users browsing this forum: Google [Bot] and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum