I rewrote the thing from scratch.
Code: Select all
<ship name="ARC_CIVILIAN_SHIP" auto_blueprint="SHIPS_CIVILIAN">
<destroyed load="ARC_DAMAGED_SHIP_DESTROYED"/>
<deadCrew load="ARC_DAMAGED_SHIP_DEADCREW"/>
</ship>
<event name="ARC_DAMAGED_SHIP">
<text>As you jump into the system you see a very unlucky ship. They hail you: "Hi there! My engines are damaged and I haven't got the parts to fix it, have you got any to spare?"</text>
<ship load="ARC_CIVILIAN_SHIP" hostile="false"/>
<choice>
<text>Send over the spare parts they need.</text>
<event>
<text>You send them some scrap.</text>
<item_modify>
<item type="scrap" min="-15" max="-30"/>
</item_modify>
<choice hidden="true">
<text>Continue...</text>
<event load="ARC_DAMAGED_SHIP_PARTS"/>
</choice>
</event>
</choice>
<choice hidden="true">
<text>Tell them you don't have enough resources to spare, but offer them to come aboard.</text>
<event load="ARC_DAMAGED_SHIP_INVITE"/>
</choice>
<choice>
<text>[Pirate] Attack the ship.</text>
<event>
<text>You choose to plunder the unfortunate soul before anyone else does.</text>
<ship hostile="true"/>
</event>
</choice>
</event>
<eventList name="ARC_DAMAGED_SHIP_PARTS">
<event>
<text>"You're a life safer! I would have died out here, you have my thanks. I haven't got much to give, but here's what I spare."</text>
<item_modify>
<item type="drones" min="0" max="1"/>
<item type="missiles" min="0" max="2"/>
<item type="fuel" min="1" max="3"/>
</item_modify>
</event>
<event>
<text>"Boy, am i glad you came along! Thanks for the parts. Take this in return for your help."</text>
<item_modify>
<item type="drones" min="1" max="3"/>
<item type="missiles" min="1" max="4"/>
<item type="fuel" min="1" max="5"/>
</item_modify>
</event>
<event>
<text>Out of nowhere the ships engines and weapon systems come online and power up. In seconds the ship is within range and opens fire on you. Must have been a trap, waiting for you to lower your guard.</text>
<ship hostile="true"/>
</event>
</eventList>
<eventList name="ARC_DAMAGED_SHIP_INVITE">
<event>
<text>"That's unfortunate! Oh well, I'll bring whatever I can on board, and thank you."</text>
<autoReward level="LOW">scrap_only</autoReward>
<crewMember amount="1"/>
</event>
<event>
<text>"I guess I have no choice, please drop me off at the nearest planet or station."</text>
<autoReward level="LOW">scrap_only</autoReward>
</event>
</eventList>
<eventList name="ARC_DAMAGED_SHIP_DESTROYED">
<event>
<text>You are able to pull out a lot of useful items from the wreckage.</text>
<autoReward level="MED">stuff</autoReward>
<augment name="RANDOM"/>
</event>
<event>
<text>Unfortunately, the wreckage didn't contain anything of real value.</text>
<autoReward level="LOW">fuel_only</autoReward>
</event>
</eventList>
<eventList name="ARC_DAMAGED_SHIP_DEADCREW">
<event>
<text>No more life signs detected. You salvage everything you can from the ship remains.</text>
<autoReward level="HIGH">stuff</autoReward>
<augment name="RANDOM"/>
</event>
<event>
<text>The ship remains didn't contain anything of real value. At least you're able to empty their fuel reserve in peace.</text>
<autoReward level="MED">fuel_only</autoReward>
</event>
</eventList>
This should work. I'm going to edit this post later explaining what i did and why. Gotta run now.
EDIT: So, what did I do?
I added the prefix "ARC_" to each one of your event names, so to avoid unwanted conflicts with possibly existing events. This isn't necessary, but i consider it good measure.
As Sleeper pointed out, nothing should go after the <event load=...> tag, since nothing would be executed after it. In my code i added a step for the event that removes the scrap from your wallet and then calls the ARC_DAMAGED_SHIP_PARTS event.
DAMAGED_SHIP_PARTS was pretty good. The only thing that wouldn't work was the <ship load=...> statement. Since a ship has already been loaded, just a <ship hostile="true"/> would suffice.
(Also i took the liberty of trying to give the user some resources that don't include scrap, since we just gave some to them. It was weird)
When you load an event you should do so on a single line.
Code: Select all
like this:
<event load="EVENT_NAME"/>
I am not sure if this works, but it's better to use the first method anyway:
<event load="EVENT_NAME>
</event>
The DAMAGED_SHIP_INVITE eventList was pretty much perfect.
The third option just wouldn't work. There is nothing to turn the ship hostile, but even if there was, the <autoReward> and <augment> tags wouldn't show. This is because when the ship is destroyed or its crew is killed, the game calls some events defined in events_ships.xml. Lookie here:
Code: Select all
<ship name="CIVILIAN_SHIP" auto_blueprint="SHIPS_CIVILIAN">
<destroyed load="DESTROYED_DEFAULT"/>
<deadCrew load="DEAD_CREW_DEFAULT"/>
</ship>
This is because you loaded a CIVILIAN_SHIP earlier in the main event. To load some custom events after the ship is destroyed, i defined a new ship group at the beginning of the file.
Code: Select all
<ship name="ARC_CIVILIAN_SHIP" auto_blueprint="SHIPS_CIVILIAN">
<destroyed load="ARC_DAMAGED_SHIP_DESTROYED"/>
<deadCrew load="ARC_DAMAGED_SHIP_DEADCREW"/>
</ship>
This one calls for some custom events when it's destroyed or its crew is killed. So i then defined two eventLists for each case and that's it!