It is currently 26 Apr 2024, 06:31
   
Text Size

Working with creature types

Moderator: CCGHQ Admins

Working with creature types

Postby 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?
MisterBenn
 
Posts: 97
Joined: 19 Mar 2011, 16:19
Has thanked: 24 times
Been thanked: 11 times

Re: Working with creature types

Postby 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.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Working with creature types

Postby 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).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Working with creature types

Postby 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


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 54 guests


Who is online

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

Login Form