Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Working with creature types
Moderator: CCGHQ Admins
Working with creature types
by MisterBenn » 07 Aug 2012, 20:58
Hi again, I am wondering how best to approach the "Choose a creature type" part of cards like Adaptive Automaton. I could hard-code the creature type choice since it will play in a deck with a single creature type throughout, but that's a bit lame and wouldn't be acceptable if someone else managed to put it in play under their own control.
It seems to me that the best way would be to let the player select a creature card and then take its creature type... but what happens if the creature has more than a single creature type? Do functions exist to detect how many types a creature has and be able to loop through the types somehow? Is there a better approach that comes to mind?
It seems to me that the best way would be to let the player select a creature card and then take its creature type... but what happens if the creature has more than a single creature type? Do functions exist to detect how many types a creature has and be able to loop through the types somehow? Is there a better approach that comes to mind?
- MisterBenn
- Posts: 97
- Joined: 19 Mar 2011, 16:19
- Has thanked: 24 times
- Been thanked: 11 times
Re: Working with creature types
by thefiremind » 07 Aug 2012, 21:06
RiiakShiNal already worked on this, and came up with a nice approach:
viewtopic.php?f=63&t=7644
maybe it's a bit boring to browse through the types one by one, but it's as close as we could get to the original mechanic.
viewtopic.php?f=63&t=7644
maybe it's a bit boring to browse through the types one by one, but it's as close as we could get to the original mechanic.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Working with creature types
by RiiakShiNal » 07 Aug 2012, 21:23
I did add for a way to allow the coder of the card to limit the types to the most logical types, so you could do a RSN_FindPlayerCreatureTypesInZone or make a similar function to Find Creature Types in the game and initially limit it to those (though the player can optionally choose to pick from the full list).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Working with creature types
by MisterBenn » 07 Aug 2012, 23:32
Can't believe I missed that thread, it's still on the first page here! The forum activity's picked up a bit, there are too many threads to stay on top of these days.
I'll have a read through that thread, thanks.

- MisterBenn
- Posts: 97
- Joined: 19 Mar 2011, 16:19
- Has thanked: 24 times
- Been thanked: 11 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests