Author Topic: Bullet death upon death of parent?  (Read 11583 times)

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Bullet death upon death of parent?
« on: February 15, 2016, 07:23:49 pm »
Okay, so, basically, what I'm wanting to do here is have a bullet that dies the moment it's parent bullet does.  As opposed to me having to super carefully tweak wait values over and over again for 10 years to get the timing right.

As usual, the XML is a labyrinth of confusion and tragedy.

The dumb part is, I cant get the shot to simply slide entirely off the screen, despite telling it "NO YOU STUPID THING, DONT COLLIDE WITH ANYTHING".  Hits the room edge, pops. But the shots it fired DONT.  They just go right through.   Considering that they're orbiting the thing, they then just stay there, orbiting empty space, repeatedly passing outside of the edge that popped the main shot. 

Logic.  There isnt any.

These arent things I can attach systems to, either.

Any ideas?

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Bullet death upon death of parent?
« Reply #1 on: February 15, 2016, 07:35:24 pm »
Let me see the code? I'll make some guess next, but if you can just paste the code it might be easier.
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 ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Bullet death upon death of parent?
« Reply #2 on: February 15, 2016, 07:41:58 pm »
My initial thought was: do_not_do_rest_of_logic_on_early_death.
never_collides_with_terrain="true"?

Then: You can add a system to a shot that adds a system to that shot it launches.
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: Bullet death upon death of parent?
« Reply #3 on: February 15, 2016, 07:50:45 pm »
Had fun with the opposite of this when making spirographs.
The parent of a shot is the system that fired it, or the entity that system belongs to.

Make the bullet just a shot, attach to that shot (that either needs a custom shot type or the attach a system to my shots modifier) a system that shoots the bit of the pattern you need to die, then when that shot dies the  sub-pattern dies.

Also ensure you have don't do rest of logic on early death set appropriately

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Bullet death upon death of parent?
« Reply #4 on: February 15, 2016, 07:52:20 pm »
do_not_do_rest_of_logic_on_early_death

I tried every conceivable command that causes the horrid thing to not collide with terrain; there's like, FOUR things that do this.  ALL of them are utterly ignored.  I even tried all of them at once.  Ignored.  Sigh....

The "dont do logic" thing seems to have no effect whatsoever on anything.  Right now it's not in there.

I cant attach systems to these as they have unique patterns of their own (if I recall correctly, bullet patterns override shot attachments, yes?).

Anyway, here's the basic code for the first orbiting shot and the thing that fires it:

Code: [Select]
<var name="CondemnedShot">
    <bullet speed="500" angle="0" dumbfire="1" shot_type="CardinalMediumPink" never_collides_with_terrain="true" interval_mult="1" >
      <spawn>
        <bullet_pattern>
          $CondemnedOrbital
          $CondemnedWaver
        </bullet_pattern>
      </spawn>
      <wait time="20" />
      <change scale=".1" time=".3" />
    </bullet>
  </var>

  <var name="CondemnedOrbital">
    <bullet speed="0" angle="0" shot_type="CrackerMediumBurningRed" interval_mult="[INTERVAL]" use_performance_sensitive_logic="true" rotates_around_firing_entity="false" moves_with_firing_entity="true" spawns_offset_from_firing_entity="100,100" never_collides_with_terrain="true" dumbfire="true" offset_is_relative_to_parent_bullet_instead_of_firing_entity="true" >
      <spawn>
        <bullet_pattern>
          $CondemnedOrbital2
         
        </bullet_pattern>
      </spawn>

      <loop iterations="-1">
        <change offset_from_parent="100,100" time="0"/>
        <change relative="true" angle="10" time=".1"/>
      </loop>

      <wait time="10000" />
      <die />
    </bullet>
  </var>


As you can see there's more things that spawn from those, but I'll start by simply getting THAT orbital shot to vanish.   Or at least getting the initial shot to stop hitting the far wall.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Bullet death upon death of parent?
« Reply #5 on: February 15, 2016, 07:54:41 pm »
I need the system and bulletpattern code as well. Some of the properties that shots end up having are overridden by the system properties. I haven't figured out when/how.
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 Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Bullet death upon death of parent?
« Reply #6 on: February 15, 2016, 08:00:49 pm »
Code: [Select]
<system name="Condemned"
category="Weapon"
shot_type="Invisible"
damage_type="Ballistic"
    attack_power="2" fire_rate="20"
range_actual="100"
shots_per_salvo="1" shot_speed="2"
targeting_logic="Direct" firing_timing="AllTheTime"
    image_name="Invisible" special_bullet_patterns="Condemned"
    shots_use_performance_sensitive_logic="true"
    shots_never_collide_with_terrain="true"
>
    <modifier target="MyShots" type="IgnoresCollisionWithNonWallTerrain"/>
    <modifier target="MyShots" type="IgnoresCollisionWithWallTerrain"/>
  </system>


  <bullet_pattern name="Condemned">
    $CondemnedShot
  </bullet_pattern>



Yeah, right now I stuck in every "DONT HIT THE WALL" thing all at once because argh.  But the same happens if there's only one.  The basic bullet pattern is simplistic until more of the actual shots are complete, which is usually how I do things.

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Bullet death upon death of parent?
« Reply #7 on: February 15, 2016, 08:04:21 pm »
To sum up then:
CondemnedShot fires CondemnedOrbital
You want CondemnedShot to go through walls.
You want CondemnedOrbital to die when CondemnedOrbital dies.
You want CondemnedOrbital to die when it hits a wall.
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 Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Bullet death upon death of parent?
« Reply #8 on: February 15, 2016, 08:06:54 pm »
Any of those three options would do the trick, yes.

Specifically, the wall the main shot wont pass through is the actual room boundary.  The others ignore it though and just keep plowing right through it.

Offline Ayrix

  • Newbie Mark III
  • *
  • Posts: 42
Re: Bullet death upon death of parent?
« Reply #9 on: February 15, 2016, 08:11:44 pm »
for crazy system to shot inheritance discussion.

bulletpattern
-bullet (broken) I think anything specified on the system overrides these
--spawn
---bullet pattern
----bullet (and vice versa on the nested one,  everything you don't specify is overridden by the system)

or something equally arcane.

either way all your shots are getting the     IgnoresCollisionWithNonWallTerrain and IgnoresCollisionWithWallTerrain mods.
 


Quote
if I recall correctly, bullet patterns override shot attachments, yes?
they do if the modifier is on the system. You can put one on the bullet within the bullet pattern (in theory). If not just make a shot type that comes with attached gun.
« Last Edit: February 15, 2016, 08:16:58 pm by Ayrix »

Offline Misery

  • Arcen Volunteer
  • Core Member Mark V
  • *****
  • Posts: 4,109
Re: Bullet death upon death of parent?
« Reply #10 on: February 15, 2016, 08:15:19 pm »
for crazy system to shot inheritance discussion.

bulletpattern
-bullet (broken) I think anything specified on the system overrides these
--spawn
---bullet pattern
----bullet (and vice versa on the nested one,  everything you don't specify is overridden by the system)

or something equally arcane.

However it works, it always confuses the heck outta me.

Granted for my design style, individual shots are usually pretty straight-forward, so it's usually fine, but not when the patterns need to get weird like this one does.

Offline Ayrix

  • Newbie Mark III
  • *
  • Posts: 42
Re: Bullet death upon death of parent?
« Reply #11 on: February 15, 2016, 08:55:47 pm »
okay, fun question, what does this version do instead?

Code: [Select]

<var name="CondemnedShot">
<bullet>
<spawn>
<bullet_pattern>
    <bullet speed="500" angle="0" dumbfire="1" shot_type="CardinalMediumPink" never_collides_with_terrain="true" interval_mult="1" >
      <spawn>
        <bullet_pattern>
          $CondemnedOrbital
          $CondemnedWaver
        </bullet_pattern>
      </spawn>
      <wait time="20" />
      <change scale=".1" time=".3" />
    </bullet>

</bullet_pattern>
</spawn>
<die/>
</bullet>
  </var>

Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Bullet death upon death of parent?
« Reply #12 on: February 15, 2016, 09:13:36 pm »
Orbital rotation is not like regular movement. Once you enter orbital rotation movement you become special. One of those features is that you now ignore the boundary of the world. I'm guessing this is to keep things from dying if they accidentally brush up against the boundary (e.g., drones).

In the buzzsaws I ended up spawning a new orbital ring every second or so. Once the center parent shot dies, the outside ring isn't refreshes and soon perishes.

re:Ayrix
Syntax error. And then once I fix it, it does the same as it did previously.
« Last Edit: February 15, 2016, 09:17:51 pm by ptarth »
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: Bullet death upon death of parent?
« Reply #13 on: February 15, 2016, 09:39:44 pm »
hmm, my orbital stuff all died on hitting walls. Yours have all got does not collide with terrain modifiers in there somewhere (so far as I can tell). 

Drones use a FamiliarType and FlockBehaviorType not bullet patterns, and tons of change relative angle.


Offline ptarth

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,166
  • I'm probably joking.
Re: Bullet death upon death of parent?
« Reply #14 on: February 15, 2016, 09:45:28 pm »
Strange. I deleted the do not collide tags and attributes from everything, shots, sytems, patterns, vars, etc.

Are you using walls or room boundaries?

When using location based movement, it ignores collisions. I've had issues with shots and enemies moving themselves off screen into oblivion. At least I hope they died sometime, otherwise I've cursed a lot of things to wander forever, undying and lonely. Its the Lost Dutchmen of SBR.
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.

 

SMF spam blocked by CleanTalk