Page 5 of 7
Posted: Sat Feb 24, 2007 1:55 pm
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).
Posted: Sat Feb 24, 2007 3:26 pm
by Arexack_Heretic
have a look at piratecoves.oxp too. this messes some with the hermit ai.
Posted: Mon Feb 26, 2007 6:15 am
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!
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.
Posted: Mon Feb 26, 2007 1:05 pm
by Dr. Nil
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
Posted: Tue Feb 27, 2007 6:22 am
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.
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?
Posted: Tue Feb 27, 2007 10:05 am
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.)
Posted: Tue Feb 27, 2007 11:06 am
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.
Posted: Tue Feb 27, 2007 11:23 am
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.
Posted: Tue Feb 27, 2007 2:26 pm
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”); };
Posted: Wed Feb 28, 2007 1:14 pm
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?
Posted: Wed Feb 28, 2007 1:55 pm
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?
Posted: Wed Feb 28, 2007 2:28 pm
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.
-----
Still, how can I get the Hacker Outpost become surrounded by asteroids?
Posted: Wed Feb 28, 2007 2:44 pm
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.
Posted: Wed Feb 28, 2007 2:50 pm
by Killer Wolf
i thought that's what i said? or what i meant to say, but truncated it to the point of obscurity!
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?
Posted: Wed Feb 28, 2007 3:22 pm
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?