It is currently 18 Apr 2024, 06:04
   
Text Size

Modding Questions

Moderator: CCGHQ Admins

Modding Questions

Postby firas724 » 10 Jun 2017, 01:11

Hello, I really appreciate the hard work the programmers have went through to make the game more fun for the general community. I have been toying around with making new cards and have stumbled upon a couple of things that I would like to know.

1. For the counter registration, do I HAVE to use an already built-in counter or can I create a new one? if I can, how can I add attributes to it. If not, can I for example use a blood counter, then cause every blood counter to add +3/+3 on the same creature? if so, can someone please show me how do I code that?
2.I have been trying to use the OR filter that uses card names, but It was to no avail. How would I code a filter to look for a card names "Soldier A" OR "Soldier B"? I tried but failed.
3.Is there a possibility to add a custom card subtype?
4.Regarding leveling, how to code a characteristic being added once a specific level has been reached? for example reaching lvl 3 and on, creature would have the intimidate ability.

Thanks in advance.
firas724
 
Posts: 3
Joined: 09 Jun 2017, 09:24
Has thanked: 1 time
Been thanked: 0 time

Re: Modding Questions

Postby Xander9009 » 10 Jun 2017, 02:41

1: You can use any counter name you want. If it's not pre-defined and needs attributes, such as a +3/+3 counter, then you'll need to define that attribute in a manager token. The one the CW uses is _MANAGER_CHARACTERISTICS. So, if you let us know which counters we're missing (or just let us know which ones you're using), we can add those counters to that manager. Then, any card which creates those counters needs this code:
Code: Select all
   <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_LIBRARY">
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         CW_General_CreateManagers("_MANAGER_CHARACTERISTICS")
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_HAND">
      <TRIGGER value="BEGINNING_OF_STEP">
         return MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
      </TRIGGER>
      <RESOLUTION_TIME_ACTION>
         CW_General_CreateManagers("_MANAGER_CHARACTERISTICS")
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
   <TOKEN_REGISTRATION reservation="1" type="_MANAGER_CHARACTERISTICS" />
2:
Code: Select all
local oFilter = ClearFilter()
local oSubFilter = oFilter:AddSubFilter_Or()
oSubFilter:Add(FE_CARD_NAME, OP_IS, "SOLDIER_A")
oSubFilter:Add(FE_CARD_NAME, OP_IS, "SOLDIER_B")
Check that actual card's CARDNAME value to make sure you've got it exactly right. (Everything is capitalized, spaces are replaced with underscores, accented characters or other non-roman letters are replaced with their roman letter equivalents. Everything else is removed.)

3: Yes and no. While it is possible (we managed to add emblems), it's a very complicated process. If it's possible to do what you're wanting using subtypes of already existing types, then do that. Otherwise, let me know and I'll explain how I got emblems working. However, it's only an approximation, and only a certain number of good approximations are possible because it relies on manipulating how the game handles compound types. So, since we're limited to using compound types that can't already exist, and even further by only using base types that won't exist in-game but can be displayed (snow-lands will display, as will world enchantments, but schemes will not, e.g.), there are only so many. In fact, for awhile, I expected there was only one possibility (using basic snow enchantments) which was already used for planeswalkers. I found another that I used for emblems, and I'm not sure if there are any more good combos, but I can look into it if it's important.

4:
Code: Select all
<CONTINUOUS_ACTION layer="6">
   local oSource = EffectSource()
   if oSource  ~= nil then
      local iLevel = oSource :CountCounters(MTG():GetCountersType("Level"))
      if iLevel &gt;= 3 then   ;Change 3 to whatever level it should begin having this ability.
         oSource :GetCurrentCharacteristics():Bool_Set(CHARACTERISTIC_INTIMIDATE, 1)
      end
   end
</CONTINUOUS_ACTION>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Modding Questions

Postby firas724 » 10 Jun 2017, 12:28

Thanks a lot for the help. As for the card subtypes, I wanted to fix some as I saw that some cards were missing subtypes (like the aetherborn).
firas724
 
Posts: 3
Joined: 09 Jun 2017, 09:24
Has thanked: 1 time
Been thanked: 0 time

Re: Modding Questions

Postby Xander9009 » 10 Jun 2017, 13:51

Subtypes are relatively easy, but none of the Aetherborn should be missing that particular subtype. It won't display properly in the deck builder, if that's where you're looking. However, it should be correct in-game.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times


Return to 2014

Who is online

Users browsing this forum: No registered users and 31 guests

cron

Who is online

In total there are 31 users online :: 0 registered, 0 hidden and 31 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 31 guests

Login Form