RiiakShiNal wrote:NeoAnderson wrote:Just a simple question, i need to set a integer value into a register and i would avoid to build a DuelDataChest.
I need that this flag is stored when i play an ability from hand, and it must be keeped also throught the zone changes of the card.
I tried with LinkedDC but it is resetted when the card is cast.
I tried with RSN_ObjectDC but it is resetted when the card is cast.
I tried RSN_Characteristics the same as above.
I need to set an Int value = to 1 when i use an activated ability from hand, i need it to keep the duration of an effect until i set it to 0 again.
Any idea will be appreciated

My ObjectDC functions does use the DuelDataChest behind the scenes as that is the best place to put chests that are associated with a card that should be universally accessible. If you really don't want to use the DuelDataChest then using a delayed trigger as suggested by thefiremind is probably the best solution.
If, however, you don't care that DuelDataChest is used behind the scenes you can still use the ObjectDC functions. Instead of using RSN_ObjectDC() you would use something like this:
- Code: Select all
local oChest = RSN_GetObjectDC( Object(), true )
Since the Object() pointer is not invalidated between zone changes it should be able to retain the data chest. This would probably be the simplest solution since all the behind the scenes code is already written.
Custom Characteristics are not suitable for this as they are meant to be constantly set and cleared (every time state-based effects are calculated) and even then they use the ObjectDC functions behind the scenes.
As always Riiak I really appreciate your answers, probably i made a mistake using your function RSN_ObjectDC because i simply create the Object chest using RSN_ObjectDC() function, as you said i should use the other one (RSN_GetObjectDC( Object(), true ))
Anyway i have already done with a workaround, i am using a card embedded characteristic.
When i activate the ability from the hand i set the duration :
- Code: Select all
<DURATION>
return Object():GetCurrentCharacteristics():Bool_Get( CHARACTERISTIC_CANT_BE_PLAYED )
</DURATION>
So when i have to turn off i simply use a RESOLUTION block as the follow :
- Code: Select all
<RESOLUTION_TIME_ACTION>
Object():GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_CANT_BE_PLAYED, 1 )
MTG():ReevaluateContinuousEffects()
</RESOLUTION_TIME_ACTION>
This has no effect with other cards, because the Object is already on battlefield, so "can't be played" has no meaning, and it is set to 1 just for few seconds.
Anyway i will make also some test using Firemind solution and also your different object function so i can have more options...