Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
First of all, I wasn't trying to belittle you in my previous response on this topic. I don't have the luxury of knowing "why" you asked a particular question on this end. If you take a look at all the posts we get on AB, there are many questions that are a simple overlooking of something by the user, usually due to the complexity of working with AB. From reading your post, I must have misunderstood things, because I interpreted it differently from your actual intent.
The reason that you aren't being able to figure out how to access stats on items is because they don't exist on items. Based on your example, the example in the docs that you reference, and the previous details of this discussion, I thought you were manipulating items as the children of units. Is that not the case? In the example within the docs, I realize there are two separate unit stats being managed. But your last post eliminates the reference to the second unit stat, so that's what made me think you were ignoring the other unit stat and trying to solve it with one. I still don't understand why you eliminated the other unit stat, so maybe we need to start there and try moving forward again. I'm going to assume you ARE managing items as the children of units. If so, the stats you need to be focused on apply to the containing unit. That's where everything gets tallied and is accessible. If an item needs to manipulate a stat, it should be manipulating the stat of the containing unit. This is exactly what's being done within the example in the docs. At this point, I could easily be completely misunderstanding things, but I'm going to take a guess. I think that what's tripping you up is how to actually tally up the total number of points spent on items by each unit. This can be accomplished quite easily via the use of a special option that you might call "ItemTally". In the Cost script for this option, you would specify the one line below (change the name of the stat to match yours): *** unit.stat[PtsUsed] = unit.stat[PtsUsed] + unit.cost[item] You then need to assign this option to every unit. You can do this individually, or you can do this the easy way. If you create a linkset can designate it as "global", then add this one option to that linkset, you'll automatically add this option to every entity in the roster. By then modifying the option to specify a Live tagexpr of "entity.unit", you'll limit the option to only apply to every unit. The net result is that every unit automatically tallies the cost of items into the appropriate stat. I took a look through this entire thread and I don't think you need to access the cost from a tag expression. Was there another thread I need to review? The topic of accessing a stat via tag expression came from your use of such an access in your earlier example. I think that was just a mistake in the usage that ended up sending us down a wrong path. Anyways, please let me know if this solves the problem for you.... -Rob At 04:34 AM 3/26/2006, you wrote: Quote:
|
|
#11 |
|
|