Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0005690Dwarf FortressCombat -- Target Selectionpublic2012-03-22 11:322012-03-28 04:49
narhiril 
Toady One 
normalminoralways
resolvedfixed 
0.34.05 
0.34.07 
0005690: Interactions do not recognize valid targets when CE_ADD_TAG is used.
Tokens added or removed by syndromes are not acknowledged by interaction target tokens. For example. adding a token through a curse (i.e. a vampire's BLOODSUCKER) and then specifying [IT_REQUIRES:BLOODSUCKER] in another interaction will not allow the interaction to target the vampire, even though the condition is met.
Add the following raws to an interaction file:


[INTERACTION:SELF_ADD_REMOVE_TAG]
    [I_SOURCE:CREATURE_ACTION]
    [I_TARGET:A:CREATURE]
        [IT_AFFECTED_CLASS:GENERAL_POISON]
        [IT_LOCATION:CONTEXT_CREATURE]
        [IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
        [IT_MANUAL_INPUT:target]
    [I_EFFECT:ADD_SYNDROME]
        [IE_TARGET:A]
        [IE_IMMEDIATE]
        [SYNDROME]
            [SYN_NAME:add/remove tags]
            [CE_ADD_TAG:MISCHIEVOUS:START:0]
            [CE_REMOVE_TAG:TRANCES:START:0]



[INTERACTION:TEST_ADD_TAG]
    [I_SOURCE:CREATURE_ACTION]
    [I_TARGET:A:CREATURE]
        [IT_LOCATION:CONTEXT_CREATURE]
        [IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
        [IT_MANUAL_INPUT:target]
        [IT_REQUIRES:MISCHIEVOUS]
    [I_EFFECT:ADD_SYNDROME]
        [IE_TARGET:A]
        [IE_IMMEDIATE]
        [SYNDROME]
            [SYN_CLASS:EXPOSE_LFR]
            [SYN_NAME:add tag test result]
            [CE_DISPLAY_NAME:NAME:(added):(added):test:START:0]


[INTERACTION:TEST_REMOVE_TAG]
    [I_SOURCE:CREATURE_ACTION]
    [I_TARGET:A:CREATURE]
        [IT_LOCATION:CONTEXT_CREATURE]
        [IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
        [IT_MANUAL_INPUT:target]
        [IT_FORBIDDEN:TRANCES]
    [I_EFFECT:ADD_SYNDROME]
        [IE_TARGET:A]
        [IE_IMMEDIATE]
        [SYNDROME]
            [SYN_CLASS:EXPOSE_LFR]
            [SYN_NAME:remove tag test result]
            [CE_DISPLAY_NAME:NAME:(removed):(removed):test:START:0]


...

Add the following to dwarves:

[CAN_DO_INTERACTION:SELF_ADD_REMOVE_TAG]
    [CDI:ADV_NAME:Add mischievous, remove trances]
    [CDI:TARGET:A:SELF_ONLY]
    [CDI:TARGET_RANGE:A:1]
    [CDI:WAIT_PERIOD:5]
[CAN_DO_INTERACTION:TEST_ADD_TAG]
    [CDI:ADV_NAME:Test for mischievous addition]
    [CDI:TARGET:A:SELF_ONLY]
    [CDI:WAIT_PERIOD:5]
[CAN_DO_INTERACTION:TEST_REMOVE_TAG]
    [CDI:ADV_NAME:Test for trances removal]
    [CDI:TARGET:A:SELF_ONLY]
    [CDI:WAIT_PERIOD:5]


...

Open up arena or adventure mode, control a dwarf, and use the interactions in descending order. Even though the MISCHIEVOUS tag was added and the TRANCES tag was removed (using CE_ADD_TAG and CE_REMOVE_TAG) by the first interaction, the second and third interactions fail to recognize the change.
I know this is not the most interesting bug in the world, but as a modder, this breaks my heart. With this working properly, I would be able to make vampire hunters, spies disguised as your civilization's members, dwarves that signal when they require a healing interaction, and oh so much more.
interaction, modding, syndrome, tag
Issue History
2012-03-22 11:32narhirilNew Issue
2012-03-22 11:35narhirilTag Attached: modding
2012-03-22 11:35narhirilTag Attached: syndrome
2012-03-22 11:35narhirilTag Attached: tag
2012-03-22 11:35narhirilTag Attached: interaction
2012-03-22 11:40narhirilNote Added: 0021663
2012-03-22 12:59narhirilIssue Monitored: narhiril
2012-03-22 12:59narhirilIssue End Monitor: narhiril
2012-03-22 13:00narhirilNote Added: 0021664
2012-03-22 13:00narhirilNote Edited: 0021664bug_revision_view_page.php?bugnote_id=0021664#r8080
2012-03-28 04:49Toady OneStatusnew => resolved
2012-03-28 04:49Toady OneFixed in Version => Next Version
2012-03-28 04:49Toady OneResolutionopen => fixed
2012-03-28 04:49Toady OneAssigned To => Toady One

Notes
(0021663)
narhiril   
2012-03-22 11:40   
There wasn't an "interaction" or "token" category, so I picked "combat: target selection" since I thought that was closest. Hopefully I didn't screw that up too badly.
(0021664)
narhiril   
2012-03-22 13:00   
http://dffd.wimbli.com/file.php?id=5968 [^]

Uploaded a region with the changes stated above. Fire up arena or adventure mode as a dwarf to reproduce the bug.