Thank you Riiak as i wrote on another topic I think i am going to be crazy.
I know i have to pass true or false value but it doesn't work.
I have stored a value with LinkedDC and now when this value is "1" i have to enable the corresponding answer into a multiple choice.
I have defined a simple function :
Folder =
\DATA_DLC_DECK_BUILDER_CUSTOM\DATA_ALL_PLATFORMS\FUNCTIONSFileaname = D14_560_GENERAL_FUNCTIONS.LOL
Function code
- NEO_CheckOne | Open
- Code: Select all
NEO_CheckOne = function(oValue)
-- returns true if oValue is 1
return oValue == 1
end
The function works i have tested on simple code with DisplayMessage.
When i use this function inside the multiple choice the game freeze!
- Code: Select all
<PLAY_TIME_ACTION>
local oPlayer = EffectController()
local oCard = EffectSource()
local oFly = LinkedDC():Int_Get( 0 )
local oFirstStrike = LinkedDC():Int_Get( 1 )
local oTrample = LinkedDC():Int_Get( 2 )
local oHaste = LinkedDC():Int_Get( 3 )
local oVigilance = LinkedDC():Int_Get( 4 )
local oLifelink = LinkedDC():Int_Get( 5 )
local oDeathTouch = LinkedDC():Int_Get( 6 )
if (oPlayer ~= nil) then
oPlayer:BeginNewMultipleChoice()
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", NEO_CheckOne(oFly) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FIRST_STIRKE", NEO_CheckOne(oFirstStrike) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_TRAMPLE", NEO_CheckOne(oTrample) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_HASTE", NEO_CheckOne(oHaste) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_VIGILANCE", NEO_CheckOne(oVigilance) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_LIFELINK", NEO_CheckOne(oLifelink) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_DEATHTOUCH", NEO_CheckOne(oDeathTouch) )
oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard )
end
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local oAbility = EffectController():GetMultipleChoiceResult()
LinkedDC():Int_Set( oAbility, 2 )
</RESOLUTION_TIME_ACTION>
I try to describe to you the whole situation :
1. LinkedDC works properly because if i check the variables are correctly passed, and if i remove the boolean check from the multiple choice it works.
2. I tried both PLAY_TIME_ACTION and RESOLUTION_ACTION, the first one freeze with the card magnified in foreground, the second one freeze with the card on the battelfied. Both solution doesn't show any choice box!
3. Before to make this dump function, i thought to pass directly a boolean variable, so i used all my imagination to pass many different syntax, examples :
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 )
if oFly == 1 then
local bFly = true
else
local bFly = false
end
......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", bFly )
......
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 ) == 1
.......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", oFly )
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 )
.......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", oFly == 1 )
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 )
.......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", return oFly == 1 )
4. I also tried to filter AddMultipleChoiceAnswer with a condition before to add it but i receive a strange result. In this case i have all 7 answer without the right custom text, all answer are "player" and all enabled.
the code was something like this :
- Code: Select all
...........
oPlayer:BeginNewMultipleChoice()
local oFly = LinkedDC():Int_Get( 0 )
if oFly == 1 then
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING" )
end
if oFirstStrike == 1 then
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FIRST_STRIKE" )
end
............