Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: More MATERIAL_EMISSION fun  (Read 866 times)

Xangi

  • Bay Watcher
  • ɛkzændʒiː
    • View Profile
More MATERIAL_EMISSION fun
« on: November 21, 2012, 02:17:55 am »

Alright, now THIS is something I'm actually stumped on. I want to modify MATERIAL_EMISSION to allow for a creature to have the source of the emission be a location other than themselves.

Code: [Select]
[INTERACTION:MATERIAL_EMISSION_DRAUGR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:MATERIAL]
[IT_MATERIAL:CONTEXT_MATERIAL]
[I_TARGET:B:CREATURE]
[IT_LOCATION:CONTEXT_CREATURE] <-- this is always the emitter for now
[IT_MANUAL_INPUT:target]
[I_TARGET:C:LOCATION]
[IT_LOCATION:CONTEXT_LOCATION]
IT_MANUAL_INPUT:target
[I_EFFECT:MATERIAL_EMISSION]
[IE_TARGET:A]
[IE_TARGET:B]
[IE_TARGET:C]
[IE_IMMEDIATE]

This is being used with code for an undirected vapor emission, which is completely functional. However, the emission still comes from the creature causing the interaction, not the creature that is targeted. Anyone have any advice?
Logged
A spooky ghost.

Previous mod (34.11):
<<Fear The Night!>>
http://www.bay12forums.com/smf/index.php?topic=103747.0

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: More MATERIAL_EMISSION fun
« Reply #1 on: November 21, 2012, 01:43:34 pm »

It can't be done directly.  However, you could use a long-distance interaction that temporarily gives the target creature the ability to use the material emission on itself, and give it FREE_ACTION and no USAGE_HINT.  When controlled by a CPU, the target creature should use the material emission on itself as soon as it has a free turn.  It won't work on player-controlled creatures, though, unless they want to use it.

random_odd_guy

  • Bay Watcher
    • View Profile
Re: More MATERIAL_EMISSION fun
« Reply #2 on: November 21, 2012, 01:48:18 pm »

I just realized how much !!FUN!! could be had by giving UNDIRECTED_DUST with USAGE_HINT:GREETING...heh..heh...heh...
Logged

Xangi

  • Bay Watcher
  • ɛkzændʒiː
    • View Profile
Re: More MATERIAL_EMISSION fun
« Reply #3 on: November 21, 2012, 02:03:01 pm »

It can't be done directly.  However, you could use a long-distance interaction that temporarily gives the target creature the ability to use the material emission on itself, and give it FREE_ACTION and no USAGE_HINT.  When controlled by a CPU, the target creature should use the material emission on itself as soon as it has a free turn.  It won't work on player-controlled creatures, though, unless they want to use it.
I guess I'll use the plan B version then, which should also work nearly just as well. Slightly more of a pain in the ass though.
Logged
A spooky ghost.

Previous mod (34.11):
<<Fear The Night!>>
http://www.bay12forums.com/smf/index.php?topic=103747.0