It is currently 19 Apr 2024, 12:07
   
Text Size

C targeting API, comments needed

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

Re: C targeting API, comments needed

Postby jatill » 24 Mar 2009, 19:07

I've used this a ton now. Let me say, the system is amazing.

Just a couple comments:
For cards where you select your own permanent, you must set

td.allowed_controller = player; AND
td.preferred_controller = player;

It took me a while to figure out that the preferred controller was required also.

Next, I have no idea what the last target in select_target does. Hopefully that will be clear once you update the docs.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: C targeting API, comments needed

Postby LoneFox » 24 Mar 2009, 19:35

jatill wrote:I've used this a ton now. Let me say, the system is amazing.

Just a couple comments:
For cards where you select your own permanent, you must set

td.allowed_controller = player; AND
td.preferred_controller = player;

It took me a while to figure out that the preferred controller was required also.
preferred_controller is for the AI. I'm not sure if "preferred" is correct word here, because the AI skips compulsory triggers if that field is set to opponent and all legal targets are controlled by the AI itself.
These default to opponent for preferred and both for allowed, because that is (or I believe it to be) the most common case.
jatill wrote:Next, I have no idea what the last target in select_target does. Hopefully that will be clear once you update the docs.
It is return location for selected target, in case you want it to go somewhere else than the first target slot in card_instance.
LoneFox
Programmer
 
Posts: 71
Joined: 08 Mar 2009, 13:43
Has thanked: 0 time
Been thanked: 7 times

Re: C targeting API, comments needed

Postby jatill » 24 Mar 2009, 19:56

It is return location for selected target, in case you want it to go somewhere else than the first target slot in card_instance.
Oh, that's exciting. So I could pass in instance->targets[1] if I wanted that to get loaded instead or targets[0]?

What, exactly, do I need to to to target a Plains. I know I need to set the 'special' field to something, but do you know what that something is?
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Previous

Return to Development

Who is online

Users browsing this forum: No registered users and 23 guests


Who is online

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

Login Form