It is currently 19 Apr 2024, 23:48
   
Text Size

How do I add the scroll down / scroll up bar to a card?

Moderator: CCGHQ Admins

How do I add the scroll down / scroll up bar to a card?

Postby Kieran » 06 Aug 2013, 18:33

For example, when Slivers grand each others their abilities. Is there a way to have the scroll bar on a card as soon as it comes to the battlefield without the use of another card to make it happen?
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: How do I add the scroll down / scroll up bar to a card?

Postby RiiakShiNal » 06 Aug 2013, 19:54

The only way to put the scroll bar on a card is to grant it enough abilities (the abilities granted could simply be a STATIC_ABILITY with just text and no code) that the scroll bar is actually needed. The card can grant itself abilities in which case when enough abilities appear on the card it will get a scroll bar. Though abilities in general should not be granted unless necessary.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: How do I add the scroll down / scroll up bar to a card?

Postby Kieran » 06 Aug 2013, 23:18

Okay. I think I understand. What would be a good example card? Or what does the code look like?
Last edited by Kieran on 07 Aug 2013, 07:50, edited 1 time in total.
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: How do I add the scroll down / scroll up bar to a card?

Postby RiiakShiNal » 06 Aug 2013, 23:27

Well something simple that will grant an ability to itself would be something like this:
Code: Select all
<STATIC_ABILITY>
   <CONTINUOUS_ACTION layer="6">
      if (EffectSource() ~= nil) then
         local oCharacteristics = EffectSource():GetCurrentCharacteristics()
         if (oCharacteristics ~= nil) then
            oCharacteristics:GrantAbility(1)
         end
      end
   </CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY resource_id="1">
   <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[This is a really long block of text designed to make the scroll bar appear even though there is only one granted ability.  Though since this is the only granted ability and there may not be any other text on the card I can't guarantee this will be enough to actually make the scroll bar appear.  As such it might require one or more other abilities (whether granted, regularly present, or even just some flavour text) to be present (with text, though code is optional) on the card.  Hopefully it should be long enough of a text block by now that the scroll bar will be present.  If not you could try padding this string even more to see if that helps.]]></LOCALISED_TEXT>
</STATIC_ABILITY>
Though remember the scroll bar won't appear until there is enough text (from regular abilities, flavour text, and granted abilities) to necessitate needing the scroll bar.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: How do I add the scroll down / scroll up bar to a card?

Postby Kieran » 17 Aug 2013, 18:41

Riiak, I copied the code you provided above but it crashes the game. Perhaps you can refine it or is there an official card I can look to? The Sliver cards I looked @ didn't have any particular code that stood out to me. Am I overlooking something? Lastly, I vaguely remember playing with a Merfolk DLC deck and one of the cards had the scroll bar but I'm not sure which card it was.
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: How do I add the scroll down / scroll up bar to a card?

Postby RiiakShiNal » 18 Aug 2013, 12:23

Kieran wrote:Riiak, I copied the code you provided above but it crashes the game. Perhaps you can refine it or is there an official card I can look to? The Sliver cards I looked @ didn't have any particular code that stood out to me. Am I overlooking something? Lastly, I vaguely remember playing with a Merfolk DLC deck and one of the cards had the scroll bar but I'm not sure which card it was.
Are you sure you put it in right? I just copied it into Ornithopter and it worked without any problem (no crash, even played a mirror match and the AI had no problem with it either). If you have your DotP set to a different localization then you need to make sure the there is text for that localization in the ability (I only included some English text because this is an example).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: How do I add the scroll down / scroll up bar to a card?

Postby Kieran » 20 Aug 2013, 15:50

I'll retest it today. Thanks!
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times


Return to 2014

Who is online

Users browsing this forum: No registered users and 51 guests


Who is online

In total there are 51 users online :: 0 registered, 0 hidden and 51 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 51 guests

Login Form