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 | .
 

 Need help with text related stuff (in game)

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: Need help with text related stuff (in game)   Fri Jan 23, 2015 10:23 pm

I simply need help with text box effects. If you don't know what I mean, I mean stuff like how djinn releaser gives the ritual monster that used it the effect that the opponent cannot special summon when you hover over that ritual monster. Or like how bi'an gives the synchro monster that used it as material the effect that it cannot be destroyed by battle when you hover over that synchro monster.

I also need help with the victory quotes. I've added them into the strings file at the end with a difference hex number (0x54 and higher since the last one is 0x53), but it seems like you still need to add it to the script of the card that has a victory condition as well, by referencing the hex (which I did) and adding in the card name separated by underslashes. When I tried it, it just said Victory! and nothing else when it should say by the effect of (the card).

Thanks in advance
Back to top Go down
View user profile
DactylicMonster

avatar


Member Title : DactCoder
Posts : 7
Join date : 2015-01-21

PostSubject: Re: Need help with text related stuff (in game)   Sat Jan 24, 2015 1:29 am

Help seems to be fairly slow on this site, sadly....
Anyways, hope this can help you out. Tried my best to detail it all, any questions about anything here please ask.

To give cards effects...

The card in the effect that is the target, most often in script: tg=g:GetFirst()

then you'd just write the new effect in the SetOperation of the effect you're doing.

ex: Here's the code for Lightforce Sword (anime)
Code:
--光の封札剣
function c49587034.initial_effect(c)
 --Activate
 local e1=Effect.CreateEffect(c)
 e1:SetCategory(CATEGORY_REMOVE)
 e1:SetType(EFFECT_TYPE_ACTIVATE)
 e1:SetCode(EVENT_FREE_CHAIN)
 e1:SetHintTiming(0,TIMING_END_PHASE)
 e1:SetTarget(c49587034.target)
 e1:SetOperation(c49587034.activate)
 c:RegisterEffect(e1)
end
function c49587034.target(e,tp,eg,ep,ev,re,r,rp,chk)
 if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
 Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
 Duel.Hint(HINT_SELECTMSG,tp,564)
 local ac=Duel.AnnounceCard(tp)
 e:SetLabel(ac)
 e:GetHandler():SetHint(CHINT_CARD,ac)
end
function c49587034.activate(e,tp,eg,ep,ev,re,r,rp)
 local ac=e:GetLabel()
 local card=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND,nil,ac)
 local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
 local tg=card:GetFirst()
 Duel.ConfirmCards(tp,hg)
 Duel.ShuffleHand(1-tp)
 if tg==nil then return end
 if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 then
 local ph=Duel.GetCurrentPhase()
 local cp=Duel.GetTurnPlayer()
 local e1=Effect.CreateEffect(e:GetHandler())
 e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
 e1:SetRange(LOCATION_REMOVED)
 e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
 e1:SetCountLimit(1)
 e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
 e1:SetCondition(c49587034.thcon)
 e1:SetOperation(c49587034.thop)
 e1:SetLabel(1)
 tg:RegisterEffect(e1)
 e:GetHandler():RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_SELF_TURN,0,2)
 c49587034[e:GetHandler()]=e1
 end
end
function c49587034.thcon(e,tp,eg,ep,ev,re,r,rp)
 return Duel.GetTurnPlayer()==tp
end
function c49587034.thop(e,tp,eg,ep,ev,re,r,rp)
 local ct=e:GetLabel()
 e:GetOwner():SetTurnCounter(ct)
 if ct==3 then
 Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
 e:GetOwner():ResetFlagEffect(1082946)
 else
 e:SetLabel(ct+1)
 end
end



Looking at the code at about halfway down, you'll see where the effect Lightforce Sword is giving it to the target card.

There has to be a target card: In this case: "local tg=card:GetFirst()"
There's the card information to relay on to the effect.
you then continue to write the effect: "local e1=Effect.CreateEffect(e:GetHandler())"
at the end of the effect, be sure to give the RegisterEffect command to the target card: "tg:RegisterEffect(e1)"

I've been doing this for a long while, hope this helps.

For the Victory Condition text:

In the Strings file where you have the !victory(hex_number)
after the Hex number you will input the text of what you want it to say.
If you look at the file, there will be many examples:
Mine is in Japanese, but it looks like this:
!victory 0x10 Victoryツ・byツ・theツ・effectツ・ofツ・Exodia

The code file should just have the line:
Duel.Win(tp,(hex_number))

In Exodia for example:
     The hex is set to a value(WIN_REASON_EXODIA):
local WIN_REASON_EXODIA = 0x10
local wtp=c33396948.check(g1)
local wntp=c33396948.check(g2)

     Then it has the 3 win conditions (Player1, Player2, Draw):
if wtp and not wntp then
   Duel.ConfirmCards(1-tp,g1)
   Duel.Win(tp,WIN_REASON_EXODIA)
elseif not wtp and wntp then
   Duel.ConfirmCards(tp,g2)
   Duel.Win(1-tp,WIN_REASON_EXODIA)
elseif wtp and wntp then
   Duel.ConfirmCards(1-tp,g1)
   Duel.ConfirmCards(tp,g2)
   Duel.Win(PLAYER_NONE,WIN_REASON_EXODIA)
end
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: Need help with text related stuff (in game)   Sun Jan 25, 2015 2:55 am

I've done it that way, but going over a few yang zings, I've noticed they set a description, which then is applied to the monster and not the yang zings themselves. I simply have to add in a description in the effect you mentioned (thanks for helping pinpoint where I put that).

For the victory condition, does it matter if the card name is written correctly in the script? One of my cards that has a victory condition (which is the one I tried with) was originally named the abomination- Codename: F/S101. I don't know if it was the addition of a hyphen and a colon that made the script show up with nothing aside from victory but that's how it came up.

And yes, I added it to the strings file first, which read "!victory 0x54 Victory by the effect of The Abomination- Codename: F/S101". Again, it was probably the hyphen and/or the colon that messed it up.

I'll try it with another one of my cards that doesn't include a hyphen or colon and see if it works
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: Need help with text related stuff (in game)   Mon Jan 26, 2015 3:38 am

K both works now, thanks Very Happy. The first extra text box didn't show up until I added the property
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
though, I think that's important to note for anyone else trying that.

I took off the colons and the hyphens for the Victory conditions so that works now as well.
Back to top Go down
View user profile
DactylicMonster

avatar


Member Title : DactCoder
Posts : 7
Join date : 2015-01-21

PostSubject: Re: Need help with text related stuff (in game)   Mon Jan 26, 2015 9:21 am

Well, glad I could help. Sorry I had a very late reply, been working a lot, using all of my time. At least you were able to figure the rest out.

Smile
Back to top Go down
View user profile
Sponsored content





PostSubject: Re: Need help with text related stuff (in game)   

Back to top Go down
 

Need help with text related stuff (in game)

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

 Similar topics

-
» Mai-Otome Elimination Game: The Greatest Otome ROUND 7
» Gerard Butler's New Action Film will be "Citizen Game"-name change confirmed false (April Fools joke)
» Fans of Enigma & Game Zone minis REJOICE!
» Yugioh card game
» Map and game pieces for upcoming campaign

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