View Single Post
osman
Junior Member
 
Join Date: Nov 2006
Posts: 10

Old December 4th, 2006, 12:46 PM
I've got a bug that I've boiled down to a fairly simple case at this point. I have a simple unit, with three links. One link (priority 5, nature cost) is an upgrade option. The eval script looks like:
Code:
var result as number
result = unit.assign[myTags.SomeTag]
That option determines which one of two other options should be automatically selected. So I have two other links (priority 70, nature include), pointing to two different alternate options (option1 and option2).

One link has a live expression:
Code:
myTags.SomeTag
and the other has the opposite live expression
Code:
!myTags.SomeTag
This works perfectly whenever I create the unit and play with the upgrade option. My actual case is more complex, but it works perfectly. However, if I create an instance of this unit in my roster, select the upgrade option (so the tag is assigned), and then duplicate the squad, the new (copied) squad is in an incorrect state.

His upgrade option is selected (And 'show tags for unit' indicates that he has myTags.SomeTag assigned). He only has one of the two dependent options visible, but it isn't selected. It should be auto-selected, because of the include nature. If I do select it, I'm unable to de-select it (and at this point, the unit works correctly).

So I need to do something else to make sure that copied units are initialized correctly on the first eval pass? Or do they not even get a first eval pass?
osman is offline   #1 Reply With Quote