Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Two-Way harm from Interactions?  (Read 533 times)

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Two-Way harm from Interactions?
« on: August 18, 2014, 02:55:15 pm »

Would it be possible to make an interaction that, say, threw a rock at an enemy, but also added a syndrome to the user?
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: Two-Way harm from Interactions?
« Reply #1 on: August 18, 2014, 03:09:35 pm »

Of course. You just have to define another target within the interaction, and make that extra target be the recipient of the effect.

The closest vanilla example I can think of is MATERIAL_EMISSION_WITH_HIDE_EFFECT. You could just copy that and alter part D from a hide effect to a debuff syndrome. An in-game example of a creature that uses this interaction would be a squid, though it uses both the material emission and the hide effect on itself.
Logged

Chevaleresse

  • Bay Watcher
  • A knight, returned from a journey weary and long
    • View Profile
    • Patreon
Re: Two-Way harm from Interactions?
« Reply #2 on: August 18, 2014, 03:40:06 pm »

Most material emissions can catch the emitter in them if they're not immune.
Logged
GM of Trespassers V2.
If you like my work, consider becoming a patron. (Since apparently people think this is a requirement: no, my game(s) are free to play and always will be.

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Two-Way harm from Interactions?
« Reply #3 on: August 18, 2014, 11:24:25 pm »

There are major problems here, I can't post the raws right now, but I have the interaction set to lob a fireball and have the caster shout a word, then it debuffs the caster. The way it's not working is that the caster only says "". That's it. Just quotations. Then, it debuffs all units inside the range of the targeter. Except of course for the caster. He somehow goes from SPEED:1.000 to SPEED:1.111. The worst part? It doesn't even shoot the fireball, it doesn't even let you choose a target. Of course it's a useful weapon, but it's not what I was going for by a long shot. I know you guys can't help me much without the raws though. Expect those by noon tomorrow. Or noon by tomorrow in Central Daylight Time at least.
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Two-Way harm from Interactions?
« Reply #4 on: August 19, 2014, 08:16:34 am »

Ok, so here is the defective interaction:

Spoiler (click to show/hide)

And the one you use, just in case:

Spoiler (click to show/hide)
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

Roses

  • Bay Watcher
    • View Profile
Re: Two-Way harm from Interactions?
« Reply #5 on: August 19, 2014, 08:54:35 am »

That's not how material emissions work. Look at the interactions in interaction_standard.txt

Code: [Select]
[INTERACTION:MATERIAL_EMISSION]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:MATERIAL]
[IT_MATERIAL:CONTEXT_MATERIAL]
[I_TARGET:B:LOCATION]
[IT_LOCATION:CONTEXT_LOCATION] <-- this is always the emitter for now
[I_TARGET:C:LOCATION]
[IT_LOCATION:CONTEXT_CREATURE_OR_LOCATION] <-- lets projectiles be aimed at specific creatures
[IT_MANUAL_INPUT:target]
[I_EFFECT:MATERIAL_EMISSION]
[IE_TARGET:A]
[IE_TARGET:B]
[IE_TARGET:C]
[IE_IMMEDIATE]
Logged

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Two-Way harm from Interactions?
« Reply #6 on: August 19, 2014, 09:02:43 am »

I will try to fix this up accordingly.
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something

deepspaceprobe9

  • Bay Watcher
  • "Personal" Text
    • View Profile
Re: Two-Way harm from Interactions?
« Reply #7 on: August 19, 2014, 09:20:28 am »

It is now working as planned, I just need to nerf the stat loss
Logged
   (*) Stopped zombies from interrupting your sleep to ask if they can help you with something