Eric Walch wrote:Anather Commander wrote:Actually, I would think that awardFuel had been fixed to work on script target on 1.70. Ark, try editing the script_actions for fuelpod in shipdata.plist to
Not in the plain 1.70 version. And those starting checking lines are necessary. Without then any NPC ship scooping a pod would give the player fuel. Remember the OXP is not only is used on 1.70+ but has to work also on 1.65 and earlier.
I agree about the pre-1.70 part of your response. If this doesn't work on 1.65, then it is not possible to use the OXP as intended. However, the awardFuel
does work on 1.70 and other craft scooping fuel pods do not create leaks or award fuel to player. I run a small test with vanilla 1.70. Hyperspaced, and had a script generate some fuel pods and add a scavenger craft. Here is part of the log:
Code: Select all
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState]: State for <ShipEntity 0x17c46d30>{"Llama" ID: 275 position: (9157.52, -7771.18, -4124.34) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT}:
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Universal ID: 275
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Scan class: CLASS_NEUTRAL
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Status: STATUS_IN_FLIGHT
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Position: (9157.52, -7771.18, -4124.34)
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Orientation: (0.679456 - 0.709931i + 0.151915j - 0.106109k)
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Distance travelled: 7535.51
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Energy: 150 of 150
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Mass: 77026.4
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.entity]: Flags: isShip, hasMoved, isSunlit
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Name: Llama
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Roles: <OORoleSet 0x1c556ba8>{scavenger sunskim-trader trader}
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Primary role: scavenger
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Script: <OOJSScript 0x16e17220>{"oolite-default-ship-script" version 1.70.1}
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Subentity count: 7
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Behaviour: BEHAVIOUR_COLLECT_TARGET
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Target: <ShipEntity 0x19f52b10>{"Fuel cannister" ID: 272 position: (9091.81, -8783.18, -4179.04) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT}
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Destination: (9091.81, -8783.18, -4179.04)
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Other destination: (0, 0, 0)
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Waypoint count: 0
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Desired speed: 300
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Fuel: 70
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Fuel accumulator: 1
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Missile count: 3
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity.ai]: AI:
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.ai]: State machine name: scavengerAI.plist
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.ai]: Current state: COLLECT_STUFF
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.ai]: Next think time: 84.342
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.ai]: Next think interval: 84.342
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Frustration: 0
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Success factor: 1018.61
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Shots fired: 0
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Time since shot: 100028
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Spawn time: 56.385 (27.932 seconds ago)
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Hull temperature: 60
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Heat insulation: 1
2008-02-25 16:48:05.605 oolite.exe[4496] [dumpState.shipEntity]: Flags: has_scoop, has_escape_pod, escortsAreSetUp, isFrangible
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState]: State for <ShipEntity 0x17c46d30>{"Llama" ID: 275 position: (12675.4, 1366.78, -3114.59) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT}:
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Universal ID: 275
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Scan class: CLASS_NEUTRAL
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Status: STATUS_IN_FLIGHT
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Position: (12675.4, 1366.78, -3114.59)
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Orientation: (0.21143 - 0.750934i - 0.154663j + 0.606197k)
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Distance travelled: 35413.8
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Energy: 150 of 150
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Mass: 77026.4
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.entity]: Flags: isShip, hasMoved, isSunlit
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Name: Llama
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Roles: <OORoleSet 0x1c556ba8>{scavenger sunskim-trader trader}
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Primary role: scavenger
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Script: <OOJSScript 0x16e17220>{"oolite-default-ship-script" version 1.70.1}
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Subentity count: 7
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Behaviour: BEHAVIOUR_COLLECT_TARGET
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Target: <ShipEntity 0x17c5ac00>{"Fuel cannister" ID: 274 position: (7501.34, -1704.88, -4188.72) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT}
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Destination: (7501.34, -1704.88, -4188.72)
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Other destination: (0, 0, 0)
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Waypoint count: 0
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Desired speed: 300
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Fuel: 0
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Fuel accumulator: 1
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Missile count: 3
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity.ai]: AI:
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.ai]: State machine name: scavengerAI.plist
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.ai]: Current state: COLLECT_STUFF
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.ai]: Next think time: 186.869
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.ai]: Next think interval: 186.869
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Frustration: 0
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Success factor: 6115.27
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Shots fired: 0
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Time since shot: 100125
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Spawn time: 56.385 (125.211 seconds ago)
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Hull temperature: 60
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Heat insulation: 1
2008-02-25 16:50:27.695 oolite.exe[4496] [dumpState.shipEntity]: Flags: has_scoop, has_escape_pod, escortsAreSetUp, isFrangible
2008-02-25 16:51:09.049 oolite.exe[4496] [gameController.exitApp]: .GNUstepDefaults synchronized. Exiting.
The first part of the entity dump is the scavenger at initial state. The second dump is after it had scooped a pod. You will see that its fuel has dropped to 0, as expected, without me (the player) experiencing any leak. But I did get a leak after scooping one of these pods myself. So, setFuelLeak works as intended. And below is the check for awardFuel itself:
Code: Select all
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState]: State for <ShipEntity 0x19625d50>{"Llama" ID: 277 position: (-2484.57, -1856.92, 4070.1) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT}:
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Universal ID: 277
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Scan class: CLASS_NEUTRAL
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Status: STATUS_IN_FLIGHT
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Position: (-2484.57, -1856.92, 4070.1)
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Orientation: (-0.815527 - 0.323781i - 0.402552j - 0.260831k)
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Distance travelled: 39245.4
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Energy: 150 of 150
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Mass: 77026.4
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.entity]: Flags: isShip, hasMoved, hasRotated, isSunlit, collisionTestFilter
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Name: Llama
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Roles: <OORoleSet 0x182217d0>{scavenger sunskim-trader trader}
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Primary role: scavenger
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Script: <OOJSScript 0x217fafa0>{"oolite-default-ship-script" version 1.70.1}
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Subentity count: 7
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Behaviour: BEHAVIOUR_COLLECT_TARGET
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Target: <ShipEntity 0x169d9430>{"Fuel cannister" ID: 275 position: (-2479.03, -1879.82, 4061.51) scanClass: CLASS_CARGO status: STATUS_BEING_SCOOPED}
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Destination: (-2479.03, -1879.82, 4061.51)
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Other destination: (0, 0, 0)
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Waypoint count: 0
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Desired speed: 300
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Fuel: 0
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Fuel accumulator: 1
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Missile count: 3
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity.ai]: AI:
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.ai]: State machine name: scavengerAI.plist
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.ai]: Current state: COLLECT_STUFF
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.ai]: Next think time: 199.607
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.ai]: Next think interval: 199.607
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Frustration: 0.26
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Success factor: 24.4813
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Shots fired: 0
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Time since shot: 100140
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Spawn time: 59.807 (139.765 seconds ago)
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Hull temperature: 60
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Heat insulation: 1
2008-02-25 18:09:43.716 oolite.exe[4240] [dumpState.shipEntity]: Flags: has_scoop, has_escape_pod, escortsAreSetUp, isFrangible
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState]: State for <ShipEntity 0x19625d50>{"Llama" ID: 277 position: (-1295.5, -1135.74, 2828.16) scanClass: CLASS_NEUTRAL status: STATUS_IN_FLIGHT}:
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Universal ID: 277
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Scan class: CLASS_NEUTRAL
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Status: STATUS_IN_FLIGHT
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Position: (-1295.5, -1135.74, 2828.16)
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Orientation: (0.100142 - 0.887736i - 0.153667j - 0.422237k)
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Distance travelled: 42967.3
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Energy: 150 of 150
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Mass: 77026.4
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.entity]: Flags: isShip, hasMoved, isSunlit, collisionTestFilter
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.shipEntity]: Name: Llama
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.shipEntity]: Roles: <OORoleSet 0x182217d0>{scavenger sunskim-trader trader}
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.shipEntity]: Primary role: scavenger
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.shipEntity]: Script: <OOJSScript 0x217fafa0>{"oolite-default-ship-script" version 1.70.1}
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.shipEntity]: Subentity count: 7
2008-02-25 18:10:10.908 oolite.exe[4240] [dumpState.shipEntity]: Behaviour: BEHAVIOUR_COLLECT_TARGET
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Target: <ShipEntity 0x18ac0cc0>{"Fuel cannister" ID: 276 position: (7501.34, -1704.88, -4188.72) scanClass: CLASS_CARGO status: STATUS_IN_FLIGHT}
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Destination: (7501.34, -1704.88, -4188.72)
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Other destination: (0, 0, 0)
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Waypoint count: 0
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Desired speed: 300
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Fuel: 10
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Fuel accumulator: 1
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Missile count: 3
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity.ai]: AI:
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.ai]: State machine name: scavengerAI.plist
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.ai]: Current state: COLLECT_STUFF
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.ai]: Next think time: 212.126
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.ai]: Next think interval: 212.126
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Frustration: 0
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Success factor: 11270
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Shots fired: 0
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Time since shot: 100152
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Spawn time: 59.807 (152.214 seconds ago)
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Hull temperature: 60
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Heat insulation: 1
2008-02-25 18:10:10.928 oolite.exe[4240] [dumpState.shipEntity]: Flags: has_scoop, has_escape_pod, escortsAreSetUp, isFrangible
See how the Llama is going from 0 fuel to 10, after it has scooped up a green fuelpod.
Edit: You can ignore the 1.70.1 mentioned in the script version running. It is actually a 1.70 executable that is being used.
Edit 2: Added the test for awardFuel itself.