Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Debugging interactions  (Read 1669 times)

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Debugging interactions
« on: January 25, 2013, 10:48:13 pm »

I'm trying to create a new megabeast to act as a sort of "boss" encounter that will hopefully turn up in a new fort of mine.  Part of that means making it have a few very dangerous interactions.  I'm having a lot of trouble getting them to work properly though.  First, to the meat of things.

Here's the relevant bits of my creature definition:

Code: [Select]
[CAN_DO_INTERACTION:NECROSIS_STRONG]
[CAN_DO_INTERACTION:PARALYZE_STRONG]
[CAN_DO_INTERACTION:UNCONSCIOUS_STRONG]
[CAN_DO_INTERACTION:DIZZY_STRONG]

And the relevant interactions:

Code: [Select]
[INTERACTION:NECROSIS_STRONG]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:CREATURE]
[IT_LOCATION:CONTEXT_CREATURE]
[IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
[IT_MANUAL_INPUT:victim]
[I_EFFECT:ADD_SYNDROME]
[IE_TARGET:A]
[IE_IMMEDIATE]
[IE_ARENA_NAME:Necrotic]
[SYNDROME]
[SYN_NAME:necrosis]
[SYN_AFFECTED_CLASS:GENERAL_POISON]
[CE_NAUSEA:SEV:100:PROB:100:RESISTABLE:SIZE_DILUTES:START:5:PEAK:10:END:30]
[CE_PAIN:SEV:60:PROB:100:RESISTABLE:SIZE_DILUTES:START:5:PEAK:10:END:30]
[CE_OOZING:SEV:40:PROB:100:RESISTABLE:SIZE_DILUTES:START:5:PEAK:10:END:30]
[CE_NECROSIS:SEV:100:PROB:100:RESISTABLE:SIZE_DILUTES:START:5:PEAK:10:END:30]
[CDI:WAIT_PERIOD:150]
[CDI:ADV_NAME:Necrotic]
[CDI:VERB:sneer:sneers:NA]
[CDI:TARGET:A:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:A:25]
[CDI:USAGE_HINT:ATTACK]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:TARGET_VERB:beginning to feel ill:begins to feel ill]

All of the interactions look exactly the same, aside from the flavor text and the CE_X syndrome tags for the effects.  The problem is that it appears that my creatures are hitting themselves with the interactions for some reason.  I can spawn one, then an aardvark, and immediately the aardvark and the creature are suffering from anything from paralysis to dizziness, and soon suffocate.  Have I screwed something up in the targeting that's causing that?

Also, for my paralysis attack, I've been trying to prevent complete cheap shots by suffocation and added a [CE_ADD_TAG:NO_BREATHE:START:0:END:30] tag to the syndrome.  I'm not sure this is working though, since victims still suffocate.  I think they may be suffering complete paralysis that outlasts the NO_BREATHE token however.  Is that what's happening, or does this not work this way at all?

Thanks for any help.  I'm still debugging these, so I'll have more soon I imagine.
Logged
Through pain, I find wisdom.

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Debugging interactions
« Reply #1 on: January 25, 2013, 10:53:05 pm »

You have the whole syntax kind of entirely screwed up :)

All those "CDI:" tags have to go in the creature entry immediately under the corresponding "CAN_DO_INTERACTION:"s, not in the interaction file.
 

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #2 on: January 25, 2013, 10:56:37 pm »

That's not surprising at all, heh.  The examples I were looking at must have had it mixed up too... and I thought it was kind of strange that you had to duplicate the CDI tags per creature since they described the interaction...

Ah well.  I'll move those over and hopefully things will be a bit better.  Thanks!
Logged
Through pain, I find wisdom.

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Debugging interactions
« Reply #3 on: January 25, 2013, 11:10:08 pm »

np, other than that it looks pretty good, but i still do syndromes by trial and error too  8) 

for the paralysis question, the way you're doing it is pretty inventive, but another option would be to have the paralysis target specifically arms and/or legs, or whatever, instead of the whole body.  check out on the wiki how to do BP (bodypart) tokens within your CE_PARALYSIS tag.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #4 on: January 25, 2013, 11:24:55 pm »

Yep, moving the CDI tags to the creature file fixed it quite nicely.  That's one mystery solved.  :)

Now, oddly my reanimation interaction seems to be creating undead that are quite happy to strangle their new master to death.  I added [NOT_LIVING] to the creature that does the reanimating already.  Is there something else needed to prevent reanimated dead from attacking their creators?

And that's a good suggestion on the bodypart specific targeting for paralysis.  I should probably try that instead.
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #5 on: January 25, 2013, 11:58:48 pm »

np, other than that it looks pretty good, but i still do syndromes by trial and error too  8) 

for the paralysis question, the way you're doing it is pretty inventive, but another option would be to have the paralysis target specifically arms and/or legs, or whatever, instead of the whole body.  check out on the wiki how to do BP (bodypart) tokens within your CE_PARALYSIS tag.

Paralysis doesn't accept body parts.

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Debugging interactions
« Reply #6 on: January 26, 2013, 01:53:13 am »

O, oops!  i stand corrected, sorry about that.  thanks Putnam :)

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #7 on: January 26, 2013, 02:31:32 am »

Ok then, here's the other interaction I need to get working.  I'm trying to create new regional drifting cloud interactions, which I've been told is possible to use through advanced world gen.  Before wasting time with that though, would anyone mind taking a look at this interaction to see if I've set it up properly?

Code: [Select]
[INTERACTION:DISCORDIFY]
[I_SOURCE:REGION]
[IS_REGION:EVIL_ONLY]
[IS_REGION:SAVAGE_ALLOWED]
[IS_REGION:ANY_TERRAIN]
[IS_FREQUENCY:100]
[I_TARGET:A:MATERIAL]
[IT_MATERIAL:MATERIAL:INORGANIC:DISCORDANT_MAGIC:WEATHER_CREEPING_GAS]
[I_EFFECT:MATERIAL_EMISSION]
[IE_TARGET:A]
[IE_INTERMITTENT:WEEKLY]
[I_EFFECT:ANIMATE]
[IE_TARGET:A]
[IE_INTERMITTENT:WEEKLY]
[SYNDROME]
[CE_ADD_TAG:OPPOSED_TO_LIFE:START:0]

I copied the example that ships with DF and basically removed the rain and direct targeted reanimation bits, provided a material (which is defined, it has a boiling point of 20 urists, if it matters), and I changed it so that it only makes hte target OPPOSED_TO_LIFE.

The goal is to just have a magic cloud that drifts around in evil biomes, and if something is unfortunate enough to get caught in it it goes berserk and attacks anything on sight.  Is there a better way to do that?  Unless I'm mistaken, this will cause such creatures to attack each other, correct?  All I'd need to do to fix that is add NOT_LIVING as well?
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #8 on: January 26, 2013, 02:33:44 am »

You have to define the syndrome in the material. not in the interaction. What that does is animate the dead and make them opposed to life. Just remove everything below I_EFFECT:ANIMATE and put everything below and including [SYNDROME] into the DISCORDANT_MAGIC raw.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #9 on: January 26, 2013, 02:53:09 am »

Ah, that makes sense.  Thanks!  I'll have to gen a world to test that with though.  Hopefully that goes well.
Logged
Through pain, I find wisdom.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #10 on: January 26, 2013, 09:24:49 pm »

Alright, so I changed the interaction and material like suggested and I'm not getting any warnings in the error log at least.  So, how exactly do I test this?  I believe I read once that if I go through advanced world gen and remove all of the regional, evil cloud and evil rain interactions in advanced world gen I can (or should always) see my new cloud interaction show up in appropriate regions.  Is this true?
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #11 on: January 26, 2013, 09:30:41 pm »

Alright, so I changed the interaction and material like suggested and I'm not getting any warnings in the error log at least.  So, how exactly do I test this?  I believe I read once that if I go through advanced world gen and remove all of the regional, evil cloud and evil rain interactions in advanced world gen I can (or should always) see my new cloud interaction show up in appropriate regions.  Is this true?

Very.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #12 on: January 27, 2013, 01:06:43 am »

Alright, thanks.  Well, while trying that out I'm getting some bizarre problems during world gen.  The game consistently crashes in the first few years of history during world gen.  After spending a lot of time debugging this, I've tracked the problem down to having more than one interaction on a creature (a megabeast in this case) causing the crash.  Here's the raws (from the creature raws):

Code: [Select]
[CAN_DO_INTERACTION:UNCONSCIOUS_STRONG]
[CDI:WAIT_PERIOD:150]
[CDI:ADV_NAME:Unconscious]
[CDI:VERB:gesture:gestures:NA]
[CDI:TARGET:A:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:A:25]
[CDI:USAGE_HINT:ATTACK]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:TARGET_VERB:feeling dazed:feels dazed]
[CAN_DO_INTERACTION:DIZZY_STRONG]
[CDI:WAIT_PERIOD:150]
[CDI:ADV_NAME:Stunned]
[CDI:VERB:swipe a finger:swipes a finger:NA]
[CDI:TARGET:A:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:A:25]
[CDI:USAGE_HINT:ATTACK]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:TARGET_VERB:feeling stunned:feels stunned]
[CAN_DO_INTERACTION:PARALYZE_STRONG]
[CDI:WAIT_PERIOD:150]
[CDI:ADV_NAME:Paralyzed]
[CDI:VERB:swipe a finger:swipes a finger:NA]
[CDI:TARGET:A:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:A:25]
[CDI:USAGE_HINT:ATTACK]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:TARGET_VERB:feeling stiff:feels stiff]

For whatever reason, if I put more than one of those three interactions in, the game crashes eary on in world gen.  If I take all but one out, it never crashes.  The more I put in, the more likely it is to crash (two seems to work occasionally).  The mysterious part is that it works flawlessly in the arena, and I get no warnings in the error log.  I have no idea what the problem is.

Any ideas?  Am I using the CDI tags wrong perhaps?

Actually, can I just add the interactions back in after world gen?  They work in the arena just fine anyway.   :-\

Edit: Put in the last offending interaction.
« Last Edit: January 27, 2013, 01:12:56 am by Telgin »
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #13 on: January 27, 2013, 01:24:27 am »

(BTW, ADV_NAME refers to what will show up in your interactions menu--as in, "you have learned the power "Paralyzed"!")

It may have something to do with them, for some reason, using that in worldgen, which I don't think they should be.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #14 on: January 27, 2013, 01:28:28 am »

Yeah, I figured those were used in adventure mode somewhere (not possible or relevant in this case), but I left them just in case they were required for some arcane reason.

Seems like a stretch, but I'll remove / tweak them and see if it makes any difference.

If I can't figure that out I'll just remove the interactions for world gen and try putting them back in after the fact.  I expect that would work.  Kind of funny that I'm going through all of this trouble for a megabeast I'm unlikely to ever even encounter in game.  :)
Logged
Through pain, I find wisdom.
Pages: [1] 2