a place for all your custom card needs you can post scripts pics and request for card to be made also please donate to the funding for a new server made for custom card duels
 
HomePortalLatest imagesSearchRegisterLog in

Share
 

 How to negate effect when Token leaves field?

View previous topic View next topic Go down 
AuthorMessage
clamiborn




Member Title : Ultimate Pet Dragon
Posts : 6
Join date : 2014-08-21

How to negate effect when Token leaves field? Empty
PostSubject: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeThu Aug 21, 2014 10:11 pm

Hi everyone, I'm very new to scripting, but I was doing pretty well and had created a few working effects before I ran into this issue.  Here's the effect I'm trying to create:

-- Once per turn, during your Main Phase 1, you can reduce this card’s attack by half until the End Phase to Special Summon 1 “Prank Token” (Fiend-Type/Wind/Level 1/ ATK 500/DEF 500).  These tokens cannot declare an attack.  When a “Prank Token” leaves the field, you can target 1 card your opponent controls and negate its effects until the End Phase. --


So far, I can Summon the Token with its ATK restriction just fine, but I can't get the negation effect to activate at all.  That effect is just a modified version of Contrast HERO Chaos' negation effect, and when I apply it to a regular Effect monster as a LEAVE_FIELD trigger effect, it works just fine. 


 Therefore, I expect the problem has something to do with the way I'm translating the effect to the Token, rather than the Handler.  It's just seemingly impossible to find Tokens with very complicated trigger effects (like beyond that of Ojama Trio), so I can't find a good reference.  Here is the code I've got at the moment:


Code:
function c413.initial_effect(c)
 --token
 local e1=Effect.CreateEffect(c)
 e1:SetDescription(aux.Stringid(413,0))
 e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
 e1:SetType(EFFECT_TYPE_IGNITION)
 e1:SetCountLimit(1)
 e1:SetRange(LOCATION_MZONE)
 e1:SetCondition(c413.condition)
 e1:SetTarget(c413.sptg)
 e1:SetCost(c413.atkcost)
 e1:SetOperation(c413.operation)
 c:RegisterEffect(e1)
end
function c413.condition(e,tp,eg,ep,ev,re,r,rp)
 return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c413.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
 if chk==0 then return true end
 local c=e:GetHandler()
 if c:IsRelateToEffect(e) and c:IsFaceup() then
 local e1=Effect.CreateEffect(c)
 e1:SetType(EFFECT_TYPE_SINGLE)
 e1:SetCode(EFFECT_SET_ATTACK)
 e1:SetValue(c:GetAttack()/2)
 e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
 c:RegisterEffect(e1)
 end
end
function c413.value(e,c)
 return c:GetAttack()/2
 end
function c413.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
 and Duel.IsPlayerCanSpecialSummonMonster(tp,414,0,0x4011,500,500,1,RACE_FIEND,ATTRIBUTE_WIND) end
 Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
 Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c413.operation(e,tp,eg,ep,ev,re,r,rp)
 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
 if not Duel.IsPlayerCanSpecialSummonMonster(tp,414,0,0x4011,500,500,1,RACE_FIEND,ATTRIBUTE_WIND) then return end
 local token=Duel.CreateToken(tp,414)
 Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
 local e1=Effect.CreateEffect(e:GetHandler())
 e1:SetType(EFFECT_TYPE_SINGLE)
 e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
 e1:SetReset(RESET_EVENT+0x1fe0000)
 token:RegisterEffect(e1,true)
 local e2=Effect.CreateEffect(e:GetHandler())
 e2:SetDescription(aux.Stringid(413,0))
 e2:SetCategory(CATEGORY_DISABLE)
 e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
 e2:SetCode(EVENT_LEAVE_FIELD)
 e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
 e2:SetTarget(c413.target)
 e2:SetOperation(c413.negop)
 e2:SetReset(RESET_EVENT+0x1fe0000)
 token:RegisterEffect(e2,true)
end
function c413.filter(c)
 return c:IsFaceup() and not c:IsDisabled()and not c:IsType(TYPE_NORMAL)
end
function c413.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
 if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c413.filter(chkc) end
 if chk==0 then return Duel.IsExistingTarget(c413.filter,tp,0,LOCATION_ONFIELD,1,nil) end
 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
 local g=Duel.SelectTarget(tp,c413.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
 Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c413.negop(e,tp,eg,ep,ev,re,r,rp)
 local c=e:GetHandler()
 local tc=Duel.GetFirstTarget()
 if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() and tc:IsControler(1-tp)then
 Duel.NegateRelatedChain(tc,RESET_TURN_SET)
 local e1=Effect.CreateEffect(c)
 e1:SetType(EFFECT_TYPE_SINGLE)
 e1:SetCode(EFFECT_DISABLE)
 e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
 tc:RegisterEffect(e1)
 local e2=Effect.CreateEffect(c)
 e2:SetType(EFFECT_TYPE_SINGLE)
 e2:SetCode(EFFECT_DISABLE_EFFECT)
 e2:SetValue(RESET_TURN_SET)
 e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
 tc:RegisterEffect(e2)
 if tc:IsType(TYPE_TRAPMONSTER) then
 local e3=Effect.CreateEffect(c)
 e3:SetType(EFFECT_TYPE_SINGLE)
 e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
 e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
 tc:RegisterEffect(e3)
 end
 end
end


I appreciate any advice I can get on this one.  Thanks!
Back to top Go down
Project Leviamon

Project Leviamon


Member Title : Busy with high school sadly
Posts : 320
Join date : 2013-08-03
Age : 25
Location : Digital World

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeFri Aug 22, 2014 1:47 am

I'm not exactly sure how tokens work, but the leave field condition doesn't work because they don't exist anymore after being removed from the field. Try the when destroyed condition, and make sure if it triggers when sent to hand/deck with card effects.
Back to top Go down
http://www.pokecommunity.com/member.php?u=364458
clamiborn




Member Title : Ultimate Pet Dragon
Posts : 6
Join date : 2014-08-21

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeFri Aug 22, 2014 3:23 am

Unfortunately, none of the "destroyed" conditions seem to trigger the effect, though they do when scripting the exact same effect to an Effect monster.  It seems like it's gotta be a token thing...
Back to top Go down
AoO

AoO


Member Title : Noob4ever
Posts : 241
Join date : 2014-04-25
Location : I only know that it is dark :/

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeFri Aug 22, 2014 11:11 am

I replaced your part, when the tokens leave the field with the one of Ojamas Trio, but also replaced the operation with the one of effect veiler. I'm not sure whether it works, but I hope so^^'


Code:
function c413.initial_effect(c)
 --token
 local e1=Effect.CreateEffect(c)
 e1:SetDescription(aux.Stringid(413,0))
 e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
 e1:SetType(EFFECT_TYPE_IGNITION)
 e1:SetCountLimit(1)
 e1:SetRange(LOCATION_MZONE)
 e1:SetCondition(c413.condition)
 e1:SetTarget(c413.sptg)
 e1:SetCost(c413.atkcost)
 e1:SetOperation(c413.operation)
 c:RegisterEffect(e1)
end
function c413.condition(e,tp,eg,ep,ev,re,r,rp)
 return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c413.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
 if chk==0 then return true end
 local c=e:GetHandler()
 if c:IsRelateToEffect(e) and c:IsFaceup() then
 local e1=Effect.CreateEffect(c)
 e1:SetType(EFFECT_TYPE_SINGLE)
 e1:SetCode(EFFECT_SET_ATTACK)
 e1:SetValue(c:GetAttack()/2)
 e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
 c:RegisterEffect(e1)
 end
end
function c413.value(e,c)
 return c:GetAttack()/2
 end
function c413.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
 and Duel.IsPlayerCanSpecialSummonMonster(tp,414,0,0x4011,500,500,1,RACE_FIEND,ATTRIBUTE_WIND) end
 Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
 Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c413.operation(e,tp,eg,ep,ev,re,r,rp)
 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
 if not Duel.IsPlayerCanSpecialSummonMonster(tp,414,0,0x4011,500,500,1,RACE_FIEND,ATTRIBUTE_WIND) then return end
 local token=Duel.CreateToken(tp,414)
 Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
 local e1=Effect.CreateEffect(e:GetHandler())
 e1:SetType(EFFECT_TYPE_SINGLE)
 e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
 e1:SetReset(RESET_EVENT+0x1fe0000)
 token:RegisterEffect(e1,true)
    local e2=Effect.CreateEffect(e:GetHandler())
         e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
         e2:SetCode(EVENT_DESTROY)
         e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
         e2:SetOperation(c413.operation)
         e2:SetReset(RESET_EVENT+0x1fe0000)
         token:RegisterEffect(e2,true)
end
function c413.filter(c)
 return c:IsFaceup() and not c:IsDisabled()and not c:IsType(TYPE_NORMAL)
end
function c413.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
 if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c413.filter(chkc) end
 if chk==0 then return Duel.IsExistingTarget(c413.filter,tp,0,LOCATION_ONFIELD,1,nil) end
 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
 local g=Duel.SelectTarget(tp,c413.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
 Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c413.operation(e,tp,eg,ep,ev,re,r,rp)
   local c=e:GetHandler()
   local tc=Duel.GetFirstTarget()
   if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() and tc:IsControler(1-tp)then
      Duel.NegateRelatedChain(tc,RESET_TURN_SET)
      local e1=Effect.CreateEffect(c)
      e1:SetType(EFFECT_TYPE_SINGLE)
      e1:SetCode(EFFECT_DISABLE)
      e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
      tc:RegisterEffect(e1)
      local e2=Effect.CreateEffect(c)
      e2:SetType(EFFECT_TYPE_SINGLE)
      e2:SetCode(EFFECT_DISABLE_EFFECT)
      e2:SetValue(RESET_TURN_SET)
      e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
      tc:RegisterEffect(e2)
   end
end
Back to top Go down
clamiborn




Member Title : Ultimate Pet Dragon
Posts : 6
Join date : 2014-08-21

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeFri Aug 22, 2014 6:39 pm

Hmmm.  Now no matter what I do, everything is fine until the Token is destroyed and I get "[Script error:] [string "./script/c413.lua"]:74: attempt to index local 'tc' (a nil value)".  Now, your Ojama Trio setup didn't include a SetTarget, which Veiler's effect needs, and it had two instances of "c413.operation" instead of "c413.negop" for the second part, so I changed it thinking that that might be the issue... and I got the same message.  I then swapped out my Contrast Hero Chaos code for the Veiler one, just because I've had better success with it... and the same error occurred!  Why, why won't it seem to accept the target effect?  Both Veiler's and CHC's negations work fine on non-Tokens...

Thanks very much for the help though.  At least now it seems to be initiating SOMEthing when the Tokens are destroyed.  I suspect that had something to do with the only major setup change being "EFFECT_TYPE_CONTINUOUS" rather than "EFFECT_TYPE_TRIGGER_O" in the Ojama Trio function... which I just learned must be because the Tokens have "Lingering" effects, not Trigger effects.  D'oh.  So, progress has been made!  Just need to know why that "tc" is being so sneaky.

Here's the error-producing code as it stands now.


Code:
function c413.initial_effect(c)
 --token
 local e1=Effect.CreateEffect(c)
 e1:SetDescription(aux.Stringid(413,0))
 e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
 e1:SetType(EFFECT_TYPE_IGNITION)
 e1:SetCountLimit(1)
 e1:SetRange(LOCATION_MZONE)
 e1:SetCondition(c413.condition)
 e1:SetTarget(c413.sptg)
 e1:SetCost(c413.atkcost)
 e1:SetOperation(c413.operation)
 c:RegisterEffect(e1)
end
function c413.condition(e,tp,eg,ep,ev,re,r,rp)
 return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c413.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
 if chk==0 then return true end
 local c=e:GetHandler()
 if c:IsRelateToEffect(e) and c:IsFaceup() then
 local e1=Effect.CreateEffect(c)
 e1:SetType(EFFECT_TYPE_SINGLE)
 e1:SetCode(EFFECT_SET_ATTACK)
 e1:SetValue(c:GetAttack()/2)
 e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
 c:RegisterEffect(e1)
 end 
end
function c413.value(e,c)
 return c:GetAttack()/2
 end
function c413.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
 and Duel.IsPlayerCanSpecialSummonMonster(tp,414,0,0x4011,500,500,1,RACE_FIEND,ATTRIBUTE_WIND) end
 Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
 Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c413.operation(e,tp,eg,ep,ev,re,r,rp)
 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
 if not Duel.IsPlayerCanSpecialSummonMonster(tp,414,0,0x4011,500,500,1,RACE_FIEND,ATTRIBUTE_WIND) then return end
 local token=Duel.CreateToken(tp,414)
 Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
 local e1=Effect.CreateEffect(e:GetHandler())
 e1:SetType(EFFECT_TYPE_SINGLE)
 e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
 e1:SetReset(RESET_EVENT+0x1fe0000)
 token:RegisterEffect(e1,true)
    local e2=Effect.CreateEffect(e:GetHandler())
    e2:SetDescription(aux.Stringid(413,0))
         e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
         e2:SetCategory(CATEGORY_DISABLE)
         e2:SetCode(EVENT_DESTROY)
         e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CARD_TARGET)
         e2:SetTarget(c413.target)
         e2:SetOperation(c413.negop)
         e2:SetReset(RESET_EVENT+0x1fe0000)
         token:RegisterEffect(e2,true)
end
function c413.filter(c)
 return c:IsFaceup() and not c:IsDisabled()and not c:IsType(TYPE_NORMAL)
end
function c413.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
 if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c413.filter(chkc) end
 if chk==0 then return Duel.IsExistingTarget(c413.filter,tp,0,LOCATION_ONFIELD,1,nil) end
 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
 local g=Duel.SelectTarget(tp,c413.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
 Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c413.negop(e,tp,eg,ep,ev,re,r,rp)
   local c=e:GetHandler()
   local tc=Duel.GetFirstTarget()
   if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() and tc:IsControler(1-tp)then
      Duel.NegateRelatedChain(tc,RESET_TURN_SET)
      local e1=Effect.CreateEffect(c)
      e1:SetType(EFFECT_TYPE_SINGLE)
      e1:SetCode(EFFECT_DISABLE)
      e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
      tc:RegisterEffect(e1)
      local e2=Effect.CreateEffect(c)
      e2:SetType(EFFECT_TYPE_SINGLE)
      e2:SetCode(EFFECT_DISABLE_EFFECT)
      e2:SetValue(RESET_TURN_SET)
      e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
      tc:RegisterEffect(e2)
   end
end

EDIT: Just learned that the error message actually tells you which line is screwed up.  So, here's line 74 of this code:


Code:
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() and tc:IsControler(1-tp)then

EDIT 2: I realized I was missing the "Duel.SpecialSummonComplete()," which apparently, among other things, prevents your Tokens from changing position during their Summon turn.
Back to top Go down
Project Leviamon

Project Leviamon


Member Title : Busy with high school sadly
Posts : 320
Join date : 2013-08-03
Age : 25
Location : Digital World

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeSat Aug 23, 2014 9:35 am

add tc to
Code:
function c413.negop(e,tp,eg,ep,ev,re,r,rp)
Back to top Go down
http://www.pokecommunity.com/member.php?u=364458
clamiborn




Member Title : Ultimate Pet Dragon
Posts : 6
Join date : 2014-08-21

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeSat Aug 23, 2014 6:34 pm

Trying it...

Darn.  That does nothing to help activate the effect or eliminate the error.  Thanks for the idea though, I thought that was it for sure...
Back to top Go down
AoO

AoO


Member Title : Noob4ever
Posts : 241
Join date : 2014-04-25
Location : I only know that it is dark :/

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeWed Aug 27, 2014 1:19 pm

I just copied your script and paste it in my luaEdit and noticed, that the part, where you said, that the error occurs there is, in line 73, but not 74. I've got in line 74 
"Duel.NegateRelatedChain(tc,RESET_TURN_SET)"
What you can try is, that you can put a "nil", "1" or "2" there and see, what happens then, because the line you gave seems ok to me.

Sorry that I post is so late, but I was somewhere else last week^^'
If you already fixed it, could you please tell, what you changed?? I would like to know, so that I can improve my scripting skills a little bit Smile
Back to top Go down
clamiborn




Member Title : Ultimate Pet Dragon
Posts : 6
Join date : 2014-08-21

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeThu Aug 28, 2014 4:49 am

Argh, you know, I actually just forgot to copy the card's name at the top of the script, so the line I gave is indeed line 73 listed here, but it's still 74 in my lua file.  Sorry about that.  X_x

I've made no real progress.  At the moment I've conceded and replaced the script with Crazy Box's negation effect, which does not target, only "selects and negates," so I can test the deck.  I really wanted the card to have to target, so it's not ideal, but it's ok for now.

The Crazy Box part of the function looks like this:


Code:
local e2=Effect.CreateEffect(e:GetHandler())
   e2:SetDescription(aux.Stringid(413,0))
         e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
         e2:SetCode(EVENT_DESTROY)
         e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
         e2:SetOperation(c413.negop)
         e2:SetReset(RESET_EVENT+0x1fe0000)
         token:RegisterEffect(e2,true)
end
function c413.negop(e,tp,eg,ep,ev,re,r,rp)
   Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
      local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
      if g:GetCount()>0 then
         Duel.HintSelection(g)
         local tc=g:GetFirst()
         local e1=Effect.CreateEffect(e:GetHandler())
         e1:SetType(EFFECT_TYPE_SINGLE)
         e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
         e1:SetCode(EFFECT_DISABLE)
         e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
         tc:RegisterEffect(e1)
         local e2=Effect.CreateEffect(e:GetHandler())
         e2:SetType(EFFECT_TYPE_SINGLE)
         e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
         e2:SetCode(EFFECT_DISABLE_EFFECT)
         e2:SetValue(RESET_TURN_SET)
         e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
         tc:RegisterEffect(e2)
         end
      end


As you can see, there are a few differences, a big one being that the first one I tried ultimately uses "Duel.SelectTarget," while the new one uses "Duel.SelectMatchingCard."  Thus, nothing is being set as the "FirstTarget" that I couldn't obtain to make "tc" work before.  There's also no "EFFECT_FLAG_CARD_TARGET" under SetProperty.  Basically, it's just me cutting out confusing variables that don't work when transposed to Tokens.

The true effect has to be a matter of making the Targeting effect come from the Handler, through some more complex variable substitution than I can figure out at the moment.  It's 413's effect, not the Token's, and it has to be coded as such, somehow.

Sigh.
Back to top Go down
AoO

AoO


Member Title : Noob4ever
Posts : 241
Join date : 2014-04-25
Location : I only know that it is dark :/

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeThu Aug 28, 2014 8:46 am

Ok, sorry about that, but did you try to put an "nil", "1" or "2" in there?? Sometimes the error occurs on places, which have nothing to do with the mistake, but are only a consequensce of another mistake
(just try it out and leave an "end" within a script and see where the error occurs;D).
Back to top Go down
outlaw1994

outlaw1994
Admin
Admin

Member Title : Red-Eyes Lord
Posts : 797
Join date : 2013-07-09
Age : 30
Location : bundaberg qld australia

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeThu Aug 28, 2014 4:43 pm

also on this line 
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsDisabled() and tc:IsControler(1-tp)then
there should be a space b4 then will take a good look tomorrow as its late here and m tired
Back to top Go down
https://mackpro.forumotion.com
clamiborn




Member Title : Ultimate Pet Dragon
Posts : 6
Join date : 2014-08-21

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeSat Aug 30, 2014 11:06 pm

No luck with those solutions, I'm afraid.  This is a sneaky one...
Back to top Go down
AoO

AoO


Member Title : Noob4ever
Posts : 241
Join date : 2014-04-25
Location : I only know that it is dark :/

How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitimeSat Aug 30, 2014 11:09 pm

Well outlaw said, that he will take a look on it, so I guess everything will be fine^^'
I hope it at least XD
Back to top Go down
Sponsored content





How to negate effect when Token leaves field? Empty
PostSubject: Re: How to negate effect when Token leaves field?   How to negate effect when Token leaves field? Icon_minitime

Back to top Go down
 

How to negate effect when Token leaves field?

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Banish when leaves field/end phase
» Magical Hats (Anime) Effect + Dark Sage (Anime) Effect [Help Please]
» Field Spells
» Multi-Field Tag Duels?
» Had an idea for manipulating zones on the field but not sure if it would fly.

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Custom Card Ruling and Bugs-