No death_actions with missiles

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

No death_actions with missiles

Post by Eric Walch »

Working on Asteroid Storm I noticed an other problem with the changed code. The small asteroids used to head to the station with a missile script. When near the station they exploded and a death_action made that a new asteroid was added near the station to keep the flow of asteroids intact. Actually there were only a dozen of asteroids circling around.

With 1.72 this didn't happen anymore. The death_actions used to be called in the "becomeExplosion" itself. (in 1.70 it was still there). Since 1.71 or 1.72 the death_action is called sooner in the code before calling the "becomeExplosion" and the AI message "becomeExplosion" is not triggering this death_actions [and no shipDied()] anymore.

I had bypassed this problem by not exploding the small asteroids but let them hit the station wall. Even an easier way of destruction of the asteroids.

I think this can stay so, but than the wiki needs updated info that "becomeExplosion" won't trigger any death_actions anymore. (The AI script than just needs a "sendScriptMessage: shipDied" and this will even work when no js script is attached as it than will activate the default script)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: No death_actions with missiles

Post by JensAyton »

Eric Walch wrote:
I think this can stay so,
I disagree. Scripted deaths (but not removals) should cause death actions to fire.
Capt. Slog
Dangerous
Dangerous
Posts: 84
Joined: Sun Apr 26, 2009 10:24 pm

Post by Capt. Slog »

Is there a problem with death_actions?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Capt. Slog wrote:
Is there a problem with death_actions?
No, it works mostly as it should. pre 1.72 triggered the death_actions from within the explosion routine. To be able to give a reason of death with the death_actions, 1.72 calls it sooner. Once in the function that generates energy damage and once the function that generates heat damage.
However, the AI command "becomeExplosion" calls the explosion function directly and bypasses this way the death_actions that was now removed from this function.

For normal play no problem as only missiles blow themselves up and those don't use death_actions normally. (But the asteroids in asteroidStorm used both and stopped working as intended)

Ahruman is right that this should be altered for consistence. I don't think it is solved yet. Probably easiest solvable through the whitelist by transforming a becomeExplosion into a new function deathactionsAndExplosion. That saves renaming of the function itself throughout the whole code.
Capt. Slog
Dangerous
Dangerous
Posts: 84
Joined: Sun Apr 26, 2009 10:24 pm

Post by Capt. Slog »

:D
Last edited by Capt. Slog on Fri May 29, 2009 10:29 pm, edited 3 times in total.
Capt. Slog
Dangerous
Dangerous
Posts: 84
Joined: Sun Apr 26, 2009 10:24 pm

Post by Capt. Slog »

Eric,
I only ask because Tivva and I are having problems with the Kurtz mission in Galactic ops. I think that this requires this message to be sent but no matter how slowly we kill Nellie, the ship on which he resides, allegedly, he never evacuates. I'll dig deeper.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Capt. Slog wrote:
I think that this requires this message to be sent but no matter how slowly we kill Nellie, the ship on which he resides, allegedly, he never evacuates. I'll dig deeper.
You should probably do something else as I read in the death_actions:

Code: Select all

		<key>death_actions</key>
		<array>
			<string>set: mission_hofd KURTZ_ESCAPED</string>
		</array>
Have you considered docking with the target carrier?
Capt. Slog
Dangerous
Dangerous
Posts: 84
Joined: Sun Apr 26, 2009 10:24 pm

Post by Capt. Slog »

Eric Walch wrote:
You should probably do something else as I read in the death_actions:

Code: Select all

		<key>death_actions</key>
		<array>
			<string>set: mission_hofd KURTZ_ESCAPED</string>
		</array>
Have you considered docking with the target carrier?
Yes I've docked twice, once to meet Kurtz and afterwards to see what happened (and top up with fuel and arms). I believe Tivva has done the same.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Capt. Slog wrote:
Yes I've docked twice, once to meet Kurtz and afterwards to see what happened (and top up with fuel and arms). I believe Tivva has done the same.
Oolite 1.55 had a typo in its flasher definitions of escape-pods. This one has the same typo. I'm always curious why people keep copying stuff from other oxp's when similar stuff s also in oolite itself.
When you copy the lines of the 3 flashers from oolites own escapepod into GN it will work as expected. But that is only cosmetic. When the error is logged it just means the flasher is removed.

Your solution with the mission is quite easy. --- [edited out a possible mission spoiler] --- This is a very frustrating bug when working with carriers. It results in blocking the launches until all escorts of completely unrelated ships have arrived. This can take ages as they all start from the main station.

I have made a AI fix for that in New 1.72 AI's. It contains a bad fix for this specific problem as it introduces other potential anomalies. But those new bugs are only theoretical, the current bug is solved. I assume it is fixed proper in the code itself in 1.73.
Last edited by Eric Walch on Fri Jun 05, 2009 9:22 am, edited 1 time in total.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Above message is not the reason Galactic Navy does not work.

Looking how Math defined his ships, I think the whole oxp is broken when you have the newer behemoth.oxp installed. It uses like_ship definitions, however, the newer behemoth.oxp uses JS ship scripts. When those scripts are present any death_action or launch_action is ignored. For most ships Math sets a specific AI with launch_actions for his Behemoth clones. Now the ships just use the original behemoth.AI and ignore his specific AI's. Same for death_actions. They are just ignored.

In order to work you must delete all JS scripts. Looks difficult as there are none defined in this oxp itself. But you can do that by adding an empty script entry:

Code: Select all

		<key>script</key>
		<string></string>
to all ships that use a like_ship reference to an existing behemoth and contain death_or launch_actions. I tested it. With above key added the nelie-behemoth immediately starts attacking the player and uses the default ship script.

PS. I only have version 2.5. The current version seems to be 4.0. So I don't know if above also applies for 4.0.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Actually, that's not it at all. The death of Nellie is supposed to spawn Kurtz's escape shuttle, which then must be destroyed to spawn Kurtz's escape pod.

However, there is no command to spawn the shuttle in Nellie's death actions.

Add the following line to Nellie's death actions and tell me what happens.

Code: Select all

<string>spawn: hofd-shuttle 1</string>
If that doesn't work, it probably is related to the JavaScripts.
Dream as if you'll live forever
Live as if you'll die tomorrow
Capt. Slog
Dangerous
Dangerous
Posts: 84
Joined: Sun Apr 26, 2009 10:24 pm

Post by Capt. Slog »

Nemoricus,
I think Matt tried to do this in the AI.

Code: Select all

"ATTACK_SHIP" = {
        ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP"); 
        "ENERGY_LOW" = ("setStateTo: ABANDON_SHIP"); 
and
"ABANDON_SHIP" = {
        ENTER = ("launchShipWithRole: hofd-shuttle", "setSpeedTo: 0.0", performIdle); 
        EXIT = (); 
        UPDATE = (); 
    };
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Given that Nellie's death actions set the mission_hofd variable to KURTZ_ESCAPED, I think he also meant to spawn it in there.
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Capt. Slog wrote:
Nemoricus,
I think Matt tried to do this in the AI.
Yes, and it is working. I just tested it by adding nelie with the console. It launched a shuttle and when destroying the shuttle it spawned the pod that could be scooped.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Okay, what exactly worked? The AI? Or the change to the ship data?

Funny. matt634 didn't have the death script set mission_hofd to KURTZ_ESCAPED in Nellie's script. I wonder why.
Dream as if you'll live forever
Live as if you'll die tomorrow
Post Reply