A Pirates Joice

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Thanks, LittleBear,

I try to download BlackMonks and have a look into the code. Perhaps that can resolve the station issue. And perhaps the problem is with the original rockHermit.AI? Have no idea how rock hermits react when attacked.

As for the ship I DID give them a custom role (lizardophobe) and and a custom AI (lizardophobeAI), that works fine except that they head towards the planet instead of towards the witchpoint. (And they are not related to the Hacker Outpost, but from another OXP).
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

have a look at piratecoves.oxp too. this messes some with the hermit ai.
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

I resolved the hackerStationAI-problem. It turned out it wasn't the AI at all, but in the shipdata I had c&p'd another entry to make up the defense_ship_role-key. And then it read <integer>pirate</integer>. Stuuuuuupid! :oops: :oops: :oops:

After I finally discovered that (and believe me, I would have sworn that in shipdata everything is alright, and I had gone through it quite some times) everything works just fine.
User avatar
Dr. Nil
---- E L I T E ----
---- E L I T E ----
Posts: 983
Joined: Thu Sep 28, 2006 5:11 pm
Location: Nearest Hoopy Casino
Contact:

Post by Dr. Nil »

:lol:

I know how that feels. I spend three days trying to figure out what was wrong with the Ore Processor when first constructing it. I had a lot of help, but nothing could get it to work right, until LB suggested that the problem might be me like-shipping something to a role instead of an entity key :roll:
Image

300 billboards in Your Ad Here!
Astromines and more in Commies.
AVAILABLE HERE along with other Oolite eXpansion Packs.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

The Hacker Station now spills out a couple of defense-ships, but I'm still not too happy with how these ships behave. I called them with pirateAI, expecting they immediatly would got after me, but they don't. hardpirate.AI is also not a good idea, because if I kill them chances are that they will blow the whole station up--not a very good defense. :shock: I don't want to give them a police AI (hey, they are outlaws, they won't fine me).

So I was just wondering whether somebody has had a similar problem and perhaps wrote something like defendStation.AI, that I could use?
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

IMHO the best way to get defense ships is to
define number and type in the hermit-shipdata,
set hermitAI to settargettoPrimaryagressor when attacked and have it performAttack.
as the hermit has no offensive capability (usually), it should launch defenseships.

These defenders inherit some of the states of the 'mothership', among which the primary target.
using interceptAI should have them attacking whatever target they are launched against and return them once it is destroyed.
(they may go on patroll instead, so some modification maybe needed.)
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

@ Arexack: Thanks, I'll try that out. But still, if there is a ready-made defendStationAI somewhere out there, I'd like to know.


Another question:
For the Hacker Outpost and the Salvage Gang I wanted to have something bigger than a Rock Hermit. Actually I envision them living IN the asteroid, not in a hut standing on it. So I took the two Large Asteroids out of Asteroid Storm and positioned docking slids in them. Works fine and looks nice and big.

But of course I want to ask: Charlie, do you mind me using your asteroids in this way? I hope not.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Sure, good idea.
Hermits are only in small asteroids, because those were the standard asteroids of the day.
The background story says, hermits hollow out exceptionally large asteroids. The models just weren't around back then.
I hope there is a little bit more to see than just the dock....

Just look at how the piratecoves' hermit-pirate AI works, that should fix most problems I think.
Riding the Rocket!
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

piratecoveAI:

Code: Select all

{
 "ATTACK" = {
  "ATTACKED" = (setTargetToPrimaryAggressor, increaseAlertLevel, groupAttackTarget, launchPirateShip, "pauseAI: 10.0");
  "ENTER" = (increaseAlertLevel);
  "EXIT" =();
  "INCOMING_MISSILE" = (fireECM, increaseAlertLevel);
  "NO_TARGET" = ("setStateTo: IDLE");
  "RED_ALERT" = (launchPirateShip, "pauseAI: 10.0");
  "TARGET_DESTROYED" = ("setStateTo: IDLE");
  "TARGET_LOST" = ("setStateTo: IDLE");
  "UPDATE" = (launchPirateShip, groupAttackTarget, "pauseAI: 10.0");    };
“GLOBAL” = {
 “ENTER” = (“setStateTo: SCAN_PREY”);  };
“IDLE” = {
 “ATTACKED” = (setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “CONDITION_GREEN” = (“setStateTo: SCAN_DEBRIS”);
 “ENTER” = ();
 “EXIT” = ();
 “INCOMING_MISSILE” = (fireECM, setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “UPDATE” = (“pauseAI: 20.0”, decreaseAlertLevel);  };
“SALVAGE” = {
 “ATTACKED” = (setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “ENTER” = (launchScavenger, “pauseAI: 20.0”);
 “INCOMING_MISSILE” = (fireECM, setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “NOT_FOUND” = (“setStateTo: SCAN_PREY”);
 “TARGET_FOUND” = (launchScavenger, “pauseAI: 20.0”);
 “UPDATE” = (scanForLoot, “pauseAI: 20.0”);  };
“SCAN_DEBRIS” = {
 “ATTACKED” = (setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “ENTER” = (scanForLoot, “pauseAI: 5.0”);
 “INCOMING_MISSILE” = (fireECM, setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “NOTHING_FOUND” = (“setStateTo: SCAN_PREY”);
 “TARGET_FOUND” = (setTargetToFoundTarget, “setStateTo: SALVAGE”);
 “UPDATE” = (scanForLoot, “pauseAI: 5.0”);  };
“SCAN_PREY” = {
 “ATTACKED” = (setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “ENTER” = (scanForRandomMerchantmen, “pauseAI: 5.0”);
 “EXIT” = ();
 “INCOMING_MISSILE” = (fireECM, setTargetToPrimaryAggressor, “setStateTo: ATTACK”);
 “NOTHING_FOUND” = (“setStateTo: SCAN_DEBRIS”);
 “TARGET_FOUND” = (setTargetToFoundTarget, “setStateTo: ATTACK”);
 “UPDATE” = (scanForRandomMerchantmen, “pauseAI: 5.0”);  };
Riding the Rocket!
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Thanks, Arexack, for the piratecove.AI. I think I can make something out of that.

For now I've got another problem. I'm trying to make the Hacker Outpost appear at more random positions, by having a couple of entries in the shipdata with different spawn-positions. So far so good. But I also would like it to be in an asteroid field. That asteroid field obviously has to be in the same place as the Hacker Outpost. So I can't add it in the script or the henchmanAI. The position has to be coded in the different Hacker Outpost entries.

Now I've tried

Code: Select all

		<key>script_actions</key>
		<array>
			<string>addShipsWithinRadius: asteroid 20 wpm 0 0 -120000 30000</string>
		</array>
(one example of a position) in shipdata, but for some reason the asteroids are not created together with the station. They appear only when I dock with that station. I have no idea why. But it would be strange to dock at a lonely asteroid, and when you launch again you find it surrounded by asteroids.

Any idea what else I could do? Is there perhaps a possibility to let more ships appear in the

Code: Select all

		<key>spawn</key>
		<dict>
			<key>position</key>
			<string>wpm 0 0 -120000</string>
			<key>facing_position</key>
			<string>pwm 0 0 0</string>
		</dict>
-part of the shipdata? Or any other way? Help appreciated!

EDIT: I just revisited this post https://bb.oolite.space/viewtopic.php?p=29918#29918 and tried

Code: Select all

		<key>spawn</key>
		<dict>
			<key>position</key>
			<string>wpm 0 0 -120000</string>
			<key>facing_position</key>
			<string>pwm 0 0 0</string>
			<key>spawn_actions</key>
			<array>
				<string>debugOn</string>
				<string>addShipsWithinRadius: asteroid 20 wpm 0 0 -120000 30000</string>
				<string>debugOff</string>
			</array>
		</dict>
Still nothing. There are not even debugging messages in my log-file. So it seems that part wasn't implemented. Or what am I doing wrong?
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

if i'm reading this right, the -120000 is the distance FROM the planet, using the WP (witchpoint/planet)set up : would it not be better to try WSM (ie, witchpoint/sun in metres) and a positive value, maybe?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

No, wpm means that the origin of the system is at the witchpoint, and the z-axis points toward the planet. So 0 0 -120000 is 120km behind the witchpoint-beacon, as seen from the planet.

For all possible coordinate-systems in Oolite the basics are the same: the first letter determines the origin (= 0 0 0), the second letter determines the direction into which the z-axis is pointed and the last letter determines what kind of measure is used: m(eters), p(lanet's radius), s(un's radius) or u (=distance between the two bodies determined by the first two letters).

But that's all in the methods.plist-ducumentation in the wiki. :wink:

-----

Still, how can I get the Hacker Outpost become surrounded by asteroids?
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

Commander McLane wrote:
Still, how can I get the Hacker Outpost become surrounded by asteroids?
Didn't LittleBear manage a similar thing in Assassins? If I remember correctly it was to do with Q mine disabling satellites around a station. :?
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

i thought that's what i said? or what i meant to say, but truncated it to the point of obscurity! :-D

i had been reading the same bit, so explaining a bit better (i hope!) :-
you got a line running WP, witchpoint to planet, and then want to go -120000 along it, backwards from the witchpoint (when i said FROM, i meant taking the witchpoint as the starting point, cos according to how i understood it if you missed off the "-" it would be TO the planet. i shoulda sid AWAY FROM, lol). so, just incase it didn't like the negatives i thought defining the line Witchpoint-sun and going positive in that direction might be worth a try??

but anyways, in the hacker shipdata Plist, have you tried (sorry, can't guarantee the syntax here) :
<key>startup-actions</key>
<array>
(do some spawny stuff, or addships, if that works for astys)
</array>
or maybe putting it in a simple AI?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

@ Uncle Reno: Thanks for the hint. I'll have a look into Assassins. But I have the strong feeling that he didn't use the spawnShip-command, so he didn't need to create the satellites in the shipdata. But I'll definitely have a look.

@ Killer Wolf: Sorry that I didn't understand you from the beginning. But the answer is still no. Oolite has no problem at all with negative numbers. And as long as I created the Hacker Outpost in the script.plist there was no problem. Only when Arexack suggested having more than one possible location for the Hacker Outpost and I needed to create the asteroids via shipdata.plist the problem arose.

As for the startup-actions I guess you are referring to the setup_actions method. I have to confess that the wiki-entry on those leaves me with a big :?:
wiki wrote:
setup_actions

Arranges a process that may be necessary for some objects, like ball turrets..
What's that supposed to mean, for whoever's sake? But anyhow, I give it a try.

Thanks for the replies anyway!

-----

While I'm typing this I tried setup_actions. It works! Thanks a lot, Killer Wolf!

-----

@ Arexack: And stuck again. If I want to have a randomly chosen Hacker Outpost I can't use spawnShip, because that is called with the unique ship-name, not with a role. But for any other method I have to fix the coordinates in the method (and remember: all that in a scriptActionsOnTarget in an AI), so no random. So what shall I do? Any suggestions?
Post Reply