Page 1 of 1

Refueler equipment (v0.001)

Posted: Wed Jan 03, 2007 5:47 pm
by Dr. Nil
Refueler v0.001 (not for playing)

Anyone up to some more ways to refuel?

I tried the following:

...\Oolite\AddOns\Refueler.oxp\Config\equipment.plist

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<array>
		<integer>2</integer>
		<integer>22000</integer>
		<string>Inflight Refueling System</string>
		<string>EQ_REFUELER</string>
		<string>Installs fuel lines from pylons and allows the mounting of fuel pods.</string>
		<dict>
			<key>available_to_all</key>
			<true/>
		</dict>
	</array>
	<array>
		<integer>2</integer>
		<integer>1000</integer>
		<string>Inflight Refueling Pod</string>
		<string>EQ_REFUELER_MINE</string>
		<string>Fuel pod for the Inflight Refueling System.</string>
		<dict>
			<key>available_to_all</key>
			<true/>
			<key>requires_empty_pylon</key>
			<true/>
			<key>requires_equipment</key>
			<string>EQ_REFUELER</string>
		</dict>
	</array>
</array>
</plist>
...\Oolite\AddOns\Refueler.oxp\Config\shipdata.plist

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>refueler_pod</key>
	<dict>
		<key>ai_type</key>
		<string>refuelerpodAI.plist</string>
		<key>energy_recharge_rate</key>
		<real>0.0</real>
		<key>max_energy</key>
		<real>10</real>
		<key>max_flight_pitch</key>
		<real>2</real>
		<key>max_flight_roll</key>
		<real>2</real>
		<key>max_flight_speed</key>
		<real>1000</real>
		<key>model</key>
		<string>qbomb.dat</string>
		<key>name</key>
		<string>Empty Refueler Pod</string>
		<key>roles</key>
		<string>energy-bomb(0.00000000001) EQ_REFUELER_MINE</string>
		<key>thrust</key>
		<real>0.0</real>
	</dict>
</dict>
</plist>
...\Oolite\AddOns\Refueler.oxp\AIs\refuelerpodAI.plist

Code: Select all

{
    
    GLOBAL = {
        ENTER = ("awardEquipment: EQ_FUEL", landonPlanet); 
        EXIT = (); 
        UPDATE = (landonPlanet); 
    }; 
}
Not even beginning to think of the problems with having it saying mine armed etc. My icon is not drawn (I get the standard mine icon). The idea was that the pod empties and is released and then at once disappears (deflates, blows to pieces, whatever). But it gives no fuel and just keeps floating around. (might be some really simple mistake). Is there even a way to work around the missile armed messages?

Another way to go could be to have an extra (disposable?) tank taking up the space for the escape pod. But I don't think there is a way to make oxp equipment activated by pressing a key - which is why I went the missile way at first.

Well this is v0.0001 - I just put it out there to get some input. It might not even be something that's worth looking into. I really don't consider it a priority. I'd rather have the Repair Droid:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<array>
		<integer>14</integer>
		<integer>1500000</integer>
		<string>Repair Droid</string>
		<string>EQ_REPAIR_DROID</string>
		<string>State of the art droid technology for automated maintenance and repair of your ship's hull and equipment.</string>
		<dict>
			<key>available_to_all</key>
			<true/>
		</dict>
	</array>
</array>
</plist>
But trying to understand PlayerEntity.m is still beyond me. It doesn't stop me from trying to look through it for interesting variables. But while I might have a very vague idea of general hull repair, I'm even further from substance on the repair of equipment.

Posted: Wed Jan 03, 2007 6:29 pm
by LittleBear
Think the command needs to be awardFuel: <amount> (0.0 to 7.0 as amount). If EQ_FUEL is not valid then that would explain why Oolite is not following the AI. I'm not sure however that you are allowed to have an awardFuel in AI. Could do it as a death_action in ship data and just have an AI that had a pause and then becomeExplosion. (The empty pod neatly self-destructing to avoid littering the space lanes!).

Probabley is a way to avoid the "missile armed" sound as Oolite seems to know what you have on a pylon as it says Missile Armed for a Missile and Mine Armed for a q mine, but don't know how.

Nice idea! :)

Posted: Wed Jan 03, 2007 7:56 pm
by Cmdr Wyvern
I think Oolite only reconizes EQ_**_MINE and EQ_**_MISSILE as hardpoint mounted ordinance, and assumes that equipment mounted on a hardpoint is either a missile or a mine, and thusly treats it with the arm/deploy/disarm/target lost thing.
In other words, Oolite isn't 'smart' enough to reconize and know what to do with a hardpoint mounted droptank. Oh well...

BTW, the repair droid sounds cool. Sort of like the hired engineer idea discussed in another thread.

Posted: Wed Jan 03, 2007 8:38 pm
by Captain Hesperus
Cmdr Wyvern wrote:
I think Oolite only reconizes EQ_**_MINE and EQ_**_MISSILE as hardpoint mounted ordinance, and assumes that equipment mounted on a hardpoint is either a missile or a mine, and thusly treats it with the arm/deploy/disarm/target lost thing.
In other words, Oolite isn't 'smart' enough to reconize and know what to do with a hardpoint mounted droptank.
If Oolite recognises the tank as a mine, couldn't you simply set the result for deployment as AWARD_FUEL instead of creating a mine?

Captain Hesperus
"Stand back, he thinks he's getting technical!"

Posted: Wed Jan 03, 2007 8:56 pm
by Arexack_Heretic
hardcoded.

:(

You could just take a standard Heretic_inc fuelpod and change it's EQ_FUELPOD to EQ_FUELPOD_MINE + the Equipment.plist entry.

Should work fine.
I'm sure Missiles are deployed with the custom AI they are assigned in the shiplist and my pod can be scooped awarding the player with 1LY of fuel.
(I'm not so sure about the hardcoded limits of mines, as I had some trouble making a custom mine.)

Posted: Wed Jan 03, 2007 10:32 pm
by Captain Hesperus
Arexack_Heretic wrote:
hardcoded.

:(
Ach, well. It was worth a stab, all I've done is proved that I have no idea what I'm talking about :)

Captain Hesperus
"That's right, come around to what the rest of us think. Now get back into the engine rooms, the exhaust vents need descaling."

Posted: Wed Jan 03, 2007 10:46 pm
by Arexack_Heretic
Another tack would be a self-intercepting refueler droid.

Although this should be player-only, like energybombs. Otherwise NPC would refuel the player...

copy a missile,
CHANGE AI LIKE:
add an AI-STATE with:
ENTER= scanForShipsWithRole: PLAYER;
TARGETFOUND = setTargetToFoundTarget, "setStateTo: ÏNTERCEPT"
NO_TARGET = "setStateTo: EXPLODE"

replace DETONATE state for REFUEL state, that does "awardFuel: 4.0" upon close proximity.

Danger is of high speed collision though. :roll:

Posted: Thu Jan 04, 2007 6:26 pm
by Dr. Nil
Cmdr Wyvern wrote:
BTW, the repair droid sounds cool. Sort of like the hired engineer idea discussed in another thread.
Yeah. I gave up on having a hired person as equipment - decided it would sound too strange to have a damaged person lying around waiting for repairs on the shipyard. The repair droid is a piece of equipment I'd really like to buy, but I'm a bit blank on how to make it atm.

@everybody: Thanks for the ideas and feedback. Please steal this idea if you don't want to wait for me to implement it (if ever).

Posted: Fri Feb 23, 2007 12:26 pm
by Commander McLane
For a start you could just use ship_trade_in_factor instead of detailed informations about the state of hull and equipment. The repair droid would then simply increase the value of ship_trade_in_factor over the time.

And--forgive my ignorance, but that sounds really interesting to me--what is and where do I find PlayerEntity.m? It's not in the app, so much I know.

BTW another means of refueling is the Fuel Scoops Enhancer, delivered in Equilibrium.oxp some time (not too) soon.

Posted: Fri Feb 23, 2007 12:51 pm
by Arexack_Heretic
damaged person
---
It should be possible to script
Conditions:
"checkDamagedEquipment: EQ_JOE_THE MECHANIC"
Do:
"removeEquipment: EQ_JOE_THE MECHANIC",
"CommsMessage: "Joe has died""

or "Joe was injured and placed in stasistube by cargoloader droid"

---
Some convoluted scripting could check for narcotics or EQ_autoDoc, to 'repair' Joe.

---
checkDamagedEquipment:
could be achieved by setting a mission_parameter.
then check for Equipment and the mission parameter,
if NO+YES: Joe is injured otherwise he's not there or alive.

You'd still get the JOE DAMAGED message, but that is just the poor shipAI not being able to distinguish between biological and mechanical ship parts. :D

Posted: Sat Feb 24, 2007 7:52 am
by Commander McLane
And yet another question:

Code: Select all

      <dict> 
         <key>requires_equipment</key> 
         <string>EQ_REFUELER</string> 
      </dict> 
Is that really possible in equipment.plist? That's exactly what I was asking for in another thread, but was told by Arexack that in the <dict>-part of the script there are only available_to_all and portable_ between_ships as valid commands. So is also requires_equipment generally valid? Or only for things that fill missile slots? And do you know any other valid commands for equipment.plist? E.g. I would love to have <key>requires_stationName</key> to make a certain piece of equipment available at certain places only.

---

I tried the <key>requires_equipment</key>. It worked. But also still needed the <key>available_to_all</key>.

It would be really, really nice, if someone could write a document about equipment.plist and its methods for the wiki, it's one of the last things not yet documented.

Posted: Sat Feb 24, 2007 11:10 am
by Arexack_Heretic
Check out other oxps, if it is used elsewhere, it works. probably.

I've been out of the lOop for a while and can't be sure.

Document new features on the wiki, else the knowledge is lost.