Restricting Unit Upgrades?

bouncymischa

Synthetic Genie
Joined
Nov 28, 2012
Messages
1,537
Location
In a bottle
I want to make a unique unit that can only be built in limited numbers, but I'm not sure if CanTrain will also restrict upgrading an older unit into the new unit. MaxPlayerInstances only applies to a UnitClass, so I can't really apply it to a unique unit.

Any ideas?
 
I want to make a unique unit that can only be built in limited numbers, but I'm not sure if CanTrain will also restrict upgrading an older unit into the new unit. MaxPlayerInstances only applies to a UnitClass, so I can't really apply it to a unique unit.

Any ideas?
I would create a dummy resource, then require the Unique Unit to use that dummy resource. Then, of course, you give X of the dummy resource to the player, on turn 0 or some other similar method, via lua. You could give the resource with a dummy building placed in the capital, or I think just directly add it to the player's resource "stocks".
 
The "let's put in whoward's GameEvents" patch added this one:

GameEvents.CanHaveUpgrade(ownerId, unitId, eUpgradeUnitClass, eUpgradeUnitType)

Seems like this would be the best way to go about it.
 
The "let's put in whoward's GameEvents" patch added this one:

GameEvents.CanHaveUpgrade(ownerId, unitId, eUpgradeUnitClass, eUpgradeUnitType)

Seems like this would be the best way to go about it.
Neptunia! Hyperdimension!

I looked through that page and never saw it up there at the top. Grrr.
 
Neptunia! Hyperdimension!

I looked through that page and never saw it up there at the top. Grrr.

Can you Nep a Nep that can Nep the Test of Nep?

It's not on the (rather outdated) wiki page, the list of the most recently added GameEvents are here
 
Can you Nep a Nep that can Nep the Test of Nep?

It's not on the (rather outdated) wiki page, the list of the most recently added GameEvents are here
No I cannot! I is always no can have test of time, loser !

I was referring to that thread of new hooks. I generally look through the wiki, then that thread, and also the older one DonQuiche made soon after BNW was released. This I do because yes wiki is woefully outdated in many ways.

But the overlooked is overlooked for the overlooked of overlooked.
 
Back
Top Bottom