thefiremind wrote:jacque wrote:*don't really know the indexes thingie tho...*
Have you ever wondered what GetCountersType and GetBestOrWorstCounterType return? It's a number, you can check it by yourself with a DisplayMessage. When you declare a counter type for the first time, a unique number is assigned to it, and during different duels it's different for the same counter types. Once you have that number, do you know how to get back to the counter name? There's no way. So if you have a creature with a +1/+1 counter and a divinity counter, for example, the best
Clockspinning query you could do would be something like:
- Code: Select all
---- Choose a counter. ----
| [ -1374896 ] |
| [ 4574587 ] |
---------------------------
You have 50% chance to hit the counter you really wish to choose, good luck.

Actually, you can get a menu that would look something like this for the player to choose a counter type:
- Code: Select all
---- Choose a counter. ----
| [ +1/+1 ] |
| [ Divinity ] |
---------------------------
However, making the menu is fairly difficult. You would need to give each counter type a specific index in a data chest for example you set +1/+1 counters to index 0, -1/-1 to index 1, ..., Divinity to index 13, .... Then you get the numeric value for each of those types and put those values in the appropriate indexes PlusOnePlusOneCounters() to index 0, MinusOneMinusOneCounters() to index 1, ..., GetCountersType("Divinity") to index 13, then when building the multiple choice menu to the user you choose menu items based on whether or not the card has the counter type that is present in the data chest index for that name. Example:
- Code: Select all
player:BeginNewMultipleChoice()
if (oCard:CountCounters( oCounterDC:Int_Get( 0 ) ) > 0) then
player:AddMultipleChoiceAnswer( "COUNTER_PLUS1PLUS1" )
end
if (oCard:CountCounters( oCounterDC:Int_Get( 1 ) ) > 0) then
player:AddMultipleChoiceAnswer( "COUNTER_MINUS1MINUS1" )
end
...
if (oCard:CountCounters( oCounterDC:Int_Get( 13 ) ) > 0) then
player:AddMultipleChoiceAnswer( "COUNTER_DIVINITY" )
end
...
player:AskMultipleChoiceQuestion("CARD_QUERY_CHOOSE_COUNTER_TYPE", EffectSource())
Obviously this is fairly difficult to do right (especially if you have more than 7 counter types on a single card because then you would have to worry about paging the question), but it is possible to choose a counter type (this is really what should be done for Proliferate rather than basing it off of counter type weightings).
The actual indices chosen for each type doesn't really matter as long as they are consistent across the entirety of choosing a counter type.
thefiremind wrote:thepiebaker wrote:on a separate note, is it possible to program custom creature types?
Start from here:
viewtopic.php?f=109&t=11681&p=131467#p131467Remember that 2 mods with different creature types on the same line of CREATURE_TYPES.TXT will be incompatible.
Also I have an idea that can make mods with different CREATURE_TYPES.TXT specs compatible (though I haven't had any feedback on what people think about it):
RiiakShiNal wrote:Though this does give me an idea for another enhancement to the Deck Builder:
- The ability to merge spec files and generate a new LOL file with updated constants for those sub-types.
Though there are a couple of issues with that either modders would need to use a naming standard for sub-type constants (which the Deck Builder would follow when merging specs) or would need to create a file with information about the sub-type which the Deck Builder would then parse and process (think an XML file that would define the sub-type and the desired constant to use for it).
Also the Deck Builder would have to generate one or more extra constant(s) so that modders can determine how many sub-types are actually present. This could include something like _CREATURE_TYPE_COUNT which just says how many types are defined or could even generate constants like CREATURE_TYPE_FIRST and CREATURE_TYPE_LAST which would be the values of the first (1000) and last creature respectfully. It would be necessary to use constants in code for sub-types (which I think most modders already do) as the actual values of added types could vary depending on which mod would be scanned first for added types.
Granted if this feature is added and modders make use of it, regular users would need to also get the Deck Builder and run it to actually "Merge Specs" so that sub-types from the mods they have would get updated into a single spot and set with high priority to make sure it is used above all others.
Originally posted
here.