Author Topic: OnEnemyKill  (Read 2183 times)

Offline Logorouge

  • Hero Member
  • *****
  • Posts: 514
OnEnemyKill
« on: February 13, 2016, 11:53:20 pm »
I just noticed the flying debris from those blue generator thingies seem to trigger the OnEnemyKill abilities. That doesn't really feel right. Is it intended that way?

Offline Ayrix

  • Newbie Mark III
  • *
  • Posts: 42
Re: OnEnemyKill
« Reply #1 on: February 14, 2016, 01:57:20 am »
Knowing the XML I think it's unavoidable, rather than intended

Code: [Select]
</entity>
<entity name="AntiGravitateBlock"
display_name="AntiGravitateBlock"
category="Obstacle"
special_object_type="AntiGravitateBlock"
max_health="150"
>
  <hitbox radius="96" />
  <system type="AntiGravitateBlock" offset="0,0" />
</entity>


 <system name="AntiGravitateBlock"
    category="DirectUseSystem"
    firing_timing="AllTheTime"
    only_fires_on_death="true"
    fire_rate="2"
    image_name="Invisible"
  >
    <effect timing="OnUse" type="SpawnEnemy" times_to_check="2" chance_out_of_100_to_happen="50" related_entities="AntiGravitateShards100" magnitude="10" second_magnitude="50" third_magnitude="90" />
    <effect timing="OnUse" type="SpawnEnemy" times_to_check="3" chance_out_of_100_to_happen="50" related_entities="AntiGravitateShards70" magnitude="30" second_magnitude="70" third_magnitude="120" />
    <effect timing="OnUse" type="SpawnEnemy" times_to_check="4" chance_out_of_100_to_happen="50" related_entities="AntiGravitateShards50" magnitude="50" second_magnitude="90" third_magnitude="150" />
    <effect timing="OnUse" type="SpawnEnemy" times_to_check="7" chance_out_of_100_to_happen="50" related_entities="AntiGravitateShards20" magnitude="70" second_magnitude="120" third_magnitude="220" />
  </system>

 

It's needing to use spawn enemy (which requires the thing spawned to be one), as it's coded to use an effect.
It is impossible to do things that vary the number spawned without using an effect, or at least very, very hard.
You could use the effect to add system and then create tons of systems that fire one bullet pattern (spawning the entity) then die. Which is messy as hell, as you then need something to attach those systems to (can't use the dead parent entity).

Offline Logorouge

  • Hero Member
  • *****
  • Posts: 514
Re: OnEnemyKill
« Reply #2 on: February 14, 2016, 02:15:30 am »
Ah, that's how it works behind the scene. Very interesting.
So changing it might be more trouble than it's worth. Oh well, thanks for the reply, Ayrix. :)

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: OnEnemyKill
« Reply #3 on: February 14, 2016, 02:20:55 am »
Perhaps asking Arcen to add a SpawnEntity to effects would be worthwhile?
Ayrix, since you did the research, do you want to post it to the mantis?
Note: This post contains content that is meant to be whimsical. Any belittlement or trivialization of complex issues is only intended to lighten the mood and does not reflect upon the merit of those positions.

Offline Ayrix

  • Newbie Mark III
  • *
  • Posts: 42
Re: OnEnemyKill
« Reply #4 on: February 14, 2016, 02:26:30 pm »
report up, and someone else also posted a duplicate/ related issue.