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
 
HomePortalCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | .
 

 Banish when leaves field/end phase

View previous topic View next topic Go down 
AuthorMessage
TGAP-Trixie

avatar


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

PostSubject: Banish when leaves field/end phase   Thu May 08, 2014 6:22 am

Card:
 
I've tried copying stuff like plaguespreader/birdman for the "if it is removed from the field" bit and rekindling for the end phase bit, but I kept getting an error. It was about a variable that most likely had to do with rekindling. As it is, I took all of that stuff out.

This is what I have after deleting the excess code

Code:
 

I could just leave it and ban it but it would be so op; every copy would be a monster your opp needs to run over during their turn, and during your turn, free level 6/9 synchros. It'll make another card I plan on coding useless if I leave it though so I'd prefer trying to make this one work right.
Back to top Go down
View user profile
outlaw1994

avatar
Admin
Admin

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

PostSubject: Re: Banish when leaves field/end phase   Thu May 08, 2014 6:48 am

try this it should work

Code:
function c60000051.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60000051,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1)
e1:SetTarget(c60000051.target)
e1:SetOperation(c60000051.operation)
c:RegisterEffect(e1)
--Non-tuner
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_NONTUNER)
c:RegisterEffect(e2)
end
function c60000051.target(e,tp,eg,ep,ev,re,r,rp,chk)
   if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
   and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
   Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c60000051.operation(e,tp,eg,ep,ev,re,r,rp)
   local c=e:GetHandler()
   if c:IsRelateToEffect(e) then
      Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
      local re1=Effect.CreateEffect(c)
      re1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
      re1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
      re1:SetCode(EVENT_PHASE+PHASE_END)
      re1:SetCountLimit(1)
      re1:SetReset(RESET_EVENT+0x47e0000)
      re1:SetOperation(c60000051.banop)
      c:RegisterEffect(re1,true)
      local re2=Effect.CreateEffect(c)
      re2:SetType(EFFECT_TYPE_SINGLE)
      re2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
      re2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
      re2:SetReset(RESET_EVENT+0x47e0000)
      re2:SetValue(LOCATION_REMOVED)
      c:RegisterEffect(re2,true)
   end
end
function c60000051.banop(e,tp,eg,ep,ev,re,r,rp)
   Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
Back to top Go down
View user profile http://mackpro.userboard.net
TGAP-Trixie

avatar


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

PostSubject: Re: Banish when leaves field/end phase   Fri May 09, 2014 4:02 am

Yup. Thanks. It does get banished when it leaves the field in any way, but the end phase bit still doesn't work. That bit won't matter most of the time really and I don't care much for that anyways; any smart player would just get around that by synchro/exceed'ing with it and it's not hard to run over with any monster so I'll just leave that out of the text. The "when it leaves the field" part was more necessary though as if it didn't get banished, you could just recycle them.

Well, onto scripting the king version of this card.
Back to top Go down
View user profile
cane_63106

avatar


Member Title : D.D. Dragon Kaiser
Posts : 454
Join date : 2013-07-23
Location : St. Louis, MO

PostSubject: Re: Banish when leaves field/end phase   Mon Jun 02, 2014 1:09 am

I think that if you take

      local re2=Effect.CreateEffect(c)
      re2:SetType(EFFECT_TYPE_SINGLE)
      re2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
      re2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
      re2:SetReset(RESET_EVENT+0x47e0000)
      re2:SetValue(LOCATION_REMOVED)
      c:RegisterEffect(re2,true)

out, then it should work the way you wanted it to.

_________________
Now...you will feel my wrath and know your place! I activate DIMENSIONAL END!!!

Custom Card Duels
Back to top Go down
View user profile http:// https://www.youtube.com/user/cane63106/videos
TGAP-Trixie

avatar


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

PostSubject: Re: Banish when leaves field/end phase   Mon Jun 02, 2014 5:29 am

It doesn't sadly Sad. It's fine though, it's not too big of a monster by itself that it presents that much of a problem to simply run over with an opponent's monster.
Back to top Go down
View user profile
cane_63106

avatar


Member Title : D.D. Dragon Kaiser
Posts : 454
Join date : 2013-07-23
Location : St. Louis, MO

PostSubject: Re: Banish when leaves field/end phase   Tue Jun 03, 2014 3:42 pm

you might want to take this out though:

e1:SetCountLimit(1)

_________________
Now...you will feel my wrath and know your place! I activate DIMENSIONAL END!!!

Custom Card Duels
Back to top Go down
View user profile http:// https://www.youtube.com/user/cane63106/videos
overcold_ice

avatar


Member Title : Overfrost!
Posts : 21
Join date : 2014-06-02

PostSubject: Re: Banish when leaves field/end phase   Tue Jun 03, 2014 7:54 pm

This will work, hopefully.

Code:
function c60000051.operation(e,tp,eg,ep,ev,re,r,rp)
  local c=e:GetHandler()
  if c:IsRelateToEffect(e) then
    Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
    c:RegisterFlagEffect(60000051,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,2)
    local e1=Effect.CreateEffect(c)
    e1:SetType(EFFECT_TYPE_SINGLE)
    e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
    e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
    e1:SetReset(RESET_EVENT+0x47e0000)
    e1:SetValue(LOCATION_REMOVED)
    c:RegisterEffect(e1,true)
    local e2=Effect.CreateEffect(c)
    e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
    e2:SetCode(EVENT_PHASE+PHASE_END)
    e2:SetReset(RESET_PHASE+PHASE_END,2)
    e2:SetCountLimit(1)
    e2:SetLabel(1)
    e2:SetLabelObject(c)
    e2:SetOperation(c60000051.remop)
    Duel.RegisterEffect(e2,tp)
  end
end
function c85138716.remop(e,tp,eg,ep,ev,re,r,rp)
  if e:GetLabel()>0 then
    e:SetLabel(0)
    return
  end
   local c=e:GetLabelObject()
  if c:GetFlagEffect(60000051)>0 then
    Duel.Remove(c,POS_FACEUP,REASON_EFFECT)
  end
end

_________________
_____________+ overcold_ice
Back to top Go down
View user profile
TGAP-Trixie

avatar


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

PostSubject: Re: Banish when leaves field/end phase   Wed Jun 04, 2014 6:15 am

@cane, I didn't notice any difference taking that out.

@overlord, yes that works, but only after the 2nd end phase after the effect. I changed the 2s to 1s but now it doesn't do anything. I took out setcountlimit which works but it causes the game to freeze.

Now leaving your code as is, but changing the 1 in setcount limit to 2 works. TYVM for your help @ cane & overlord. I gotta figure out what setcountlimit even is now :S.
Back to top Go down
View user profile
overcold_ice

avatar


Member Title : Overfrost!
Posts : 21
Join date : 2014-06-02

PostSubject: Re: Banish when leaves field/end phase   Wed Jun 04, 2014 9:38 pm

SetCountLimit is 'how many times it can run in a single turn', like 'Once per turn' = 'SetCountLimit(1)'.

I read your card, and it says 'banish it during the next End Phase'. So I made it during the next End Phase. :v

Anyway, for this turn's End Phase:
Code:
function c60000051.operation(e,tp,eg,ep,ev,re,r,rp)
  local c=e:GetHandler()
  if c:IsRelateToEffect(e) then
    Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
    c:RegisterFlagEffect(60000051,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
    --that last number is how many turns it will stay,
    --or maybe, how many times it needs to be reset'd (by those RESET_ stuffs)
    --I honestly still don't know much about this
    --changed from 2 to 1
    local e1=Effect.CreateEffect(c)
    e1:SetType(EFFECT_TYPE_SINGLE)
    e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
    e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
    e1:SetReset(RESET_EVENT+0x47e0000)
    e1:SetValue(LOCATION_REMOVED)
    c:RegisterEffect(e1,true)
    local e2=Effect.CreateEffect(c)
    e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
    e2:SetCode(EVENT_PHASE+PHASE_END)
    e2:SetReset(RESET_PHASE+PHASE_END)
    --removed the second parameter ('2')
    --by default, the second parameter is 1
    e2:SetCountLimit(1)
    --e2:SetLabel(1)
    --this was the thing that made it 'only during the next end phase'
    --actually, it only attaches that value (in this case, '1')
    --to the effect 'e2'
    e2:SetLabelObject(c)
    e2:SetOperation(c60000051.remop)
    Duel.RegisterEffect(e2,tp)
  end
end
function c85138716.remop(e,tp,eg,ep,ev,re,r,rp)
--[[
  if e:GetLabel()>0 then
    e:SetLabel(0)
    return
  end
  this is the actual thing that made it 'only during the next end phase'
  on the first end phase, it just change that attached value from 1 to 0
  then on the second end phase, because that value is greater than 0
  it passes this check, and goes down below
]]--
  local c=e:GetLabelObject()
  if c:GetFlagEffect(60000051)>0 then
    Duel.Remove(c,POS_FACEUP,REASON_EFFECT)
  end
end

_________________
_____________+ overcold_ice
Back to top Go down
View user profile
TGAP-Trixie

avatar


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

PostSubject: Re: Banish when leaves field/end phase   Wed Jun 04, 2014 11:11 pm

Yeah I wrote the text kinda like evilswarm thunderbird's effect. His says the next standby phase too and if you mst something in the DP and chain, he returns that very same standby phase. I'll change it to "banish it during the end phase"

Also, the code does work and all. It kinda bothers me, now that you explained it, that it's working when it probably doesn't make much sense and really shouldn't work at all.

I'll try your new revised code, but if it doesn't work, I'll go back to the current one

EDIT: Nope, they just stay on the field. I'll post the current working code. Maybe outlaw can explain why it works and if something should be taken out so the game doesn't freeze or crash. But I have tried leaving them in the GY and using monster reborn to bring them back. When they're not summoned by their own effect, they stay on the field and if they're used for a synchro summon, they're not banished and can be SS by their own effect again. And I haven't gotten any crashes with that yet.


Current code:
 

I'm thinking maybe the count limit affects the label in this code? With countlimit being 1 and the label being 1 it would've been equal and not over so remop wouldn't have done anything I guess, not that turn but the next anyways. I really don't know what I'm talking about, I'm just stating what was going through my mind when I slightly edited overlord's code :S.
Back to top Go down
View user profile
overcold_ice

avatar


Member Title : Overfrost!
Posts : 21
Join date : 2014-06-02

PostSubject: Re: Banish when leaves field/end phase   Thu Jun 05, 2014 7:03 am

Code:
function c60000051.operation(e,tp,eg,ep,ev,re,r,rp)
  local c=e:GetHandler()
  if c:IsRelateToEffect(e) then
    Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
    c:RegisterFlagEffect(60000051,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
    local e1=Effect.CreateEffect(c)
    e1:SetType(EFFECT_TYPE_SINGLE)
    e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
    e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
    e1:SetReset(RESET_EVENT+0x47e0000)
    e1:SetValue(LOCATION_REMOVED)
    c:RegisterEffect(e1,true)
    local e2=Effect.CreateEffect(c)
    e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
    e2:SetCode(EVENT_PHASE+PHASE_END)
    e2:SetReset(RESET_PHASE+PHASE_END)
    e2:SetCountLimit(1)
    e2:SetLabelObject(c)
    e2:SetOperation(c60000051.remop)
    Duel.RegisterEffect(e2,tp)
  end
end
function c60000051.remop(e,tp,eg,ep,ev,re,r,rp)
  local c=e:GetLabelObject()
  if c:GetFlagEffect(60000051)>0 then
    Duel.Remove(c,POS_FACEUP,REASON_EFFECT)
  end
end

This was the problem (see the card code):
Code:
function c85138716.remop(e,tp,eg,ep,ev,re,r,rp)
That's Rescue Rabbit's code. Funny, the first one has this same problem. Did you fix it?

I forgot to mention that 'RegisterFlagEffect' actually only attaches a little variable that automatically wears off. It doesn't do a thing other than that. Except for its third parameter which is rarely used. If I'm remembering and guessed right, it's some sort of conditions (FLAGs) for that attached stuff. Technically, it actually makes an effect that wears off by using that usual 'SetReset' function.

_________________
_____________+ overcold_ice
Back to top Go down
View user profile
TGAP-Trixie

avatar


Member Title : Trixie does not even...
Posts : 273
Join date : 2014-04-17

PostSubject: Re: Banish when leaves field/end phase   Thu Jun 05, 2014 7:28 am

I didn't overlook that. In fact, it was fixed in the code I put up Razz.
Back to top Go down
View user profile
overcold_ice

avatar


Member Title : Overfrost!
Posts : 21
Join date : 2014-06-02

PostSubject: Re: Banish when leaves field/end phase   Thu Jun 05, 2014 9:34 am

Well, I have compared it to Rescue Rabbit's script. Nothing goes wrong in the script. Or maybe, Rescue Rabbit's script is also bugged. u,u

Test it again. If it still goes wrong, change the last number on that RegisterFlagEffect to 2. And if it still goes wrong (again), add a second parameter on e2's SetReset, with a value of 2 - e2:SetReset(EVENT_blablabla,2).

_________________
_____________+ overcold_ice
Back to top Go down
View user profile
Sponsored content





PostSubject: Re: Banish when leaves field/end phase   

Back to top Go down
 

Banish when leaves field/end phase

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

 Similar topics

-
» Field maple leaves turning yellow!!
» Field Maple problems
» Leaf Curl on my Field Maple
» Miniature Leaves!
» Trick with Half or Nothing, use Vayu to tune on the field

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Requests-