Yes there is the Wiki, but how many times have you wished you understood an issue / feature properly BEFORE wasting days trying to get something to work and finally posting on this forum for advice?
( which I'm glad to say is often very useful )
Such advice is usually already posted, but buried in old topics...

So...

1 ) I hope this thread will bring out a lot of similar feeling ( otherwise I must be dumber than I thought )
2 ) This becomes a definitive ( USEFUL ) place for tips on how to do stuff & what pitfalls to avoid.
3 ) Becomes a Sticky thread.
4 ) Is VERY strictly moderated so whinges like this are rapidy removed.
5 ) Once a question is answered to everyone's satisfaction a brief summary of both question + answer is put somewhere that can be easily searched & read.

Ps - What I think he means is:- Always do your dock along the z-axis facing to the front of the ship regardless of what direction you want it to end up facing...
Then use:-
<string>dockname x y z 1 0 0 0 </string> - for facing forward...
<string>dockname x y z 0 1 0 0</string> - for facing backward...
Rear-facing docks, once modeled, need to be rotated 180deg so the opening is facing forward ( but still located on 0.0 0.0 0.0 ) before converting to .dat
If not a uniform shape it also needs to be rotated 180deg along the z-axis or it will appear upsidedown in you ship!?!

No? Ok, here's hopefully a helpful start:
Crappy drawing - no?
But the point is this is how most of us think.

Heres a table of useful Quaternions:

Still makes little sence?
Remembering the crappy diagram of a ship its pointing along the Z+ axis.
This is equivalent to the first row of the 'grabbed' table.

Want to face the other way? ( Z-)
Pick an axis that you will rotate about: I'll say X for arguments sake & rotate 180deg.
Equivalent to the second row in the 'grabbed' table.

So what do we know?
0-1 = 0-180deg rotation about the axis we've picked - in this case X.

Consequences?
Imagine the rotation happening in the 'crappy' diagram...
Got it? Yes you're now facing along z- but upsidedown!!
( This is why you launch upsidedown from my Consitution ship's dock - doh! )
Oolite expects a dock to be made facing Z+ & then I had to rotate it into place facing backward for the model.

Hope this helps...
W? I hear you ask?
Have a think, compare to the table Dr. Nil kindly supplied - spot the difference? What ( if any ) difference does it make?
Think of W as a way of making the numbers add up to 1.0ish...

obviously the number is changed to suit your needs. i copied an ASP and saved it off to make sure it was unique to my OXP. "kissmyasp" is the name key of the escort, not the ROle or whatever.
also, give it its own AI, such as mothershipAI or whatever.

2) in the escort's dict, i did "likeship asp", gave it kissmyaspAI.plist, and a Role "aspestos" ~ cos it protects you from (incoming) fire. look, it was funny at the time, right?

Hi Charlie, there's a mistake in your Quaternion-post. As the information provided here should be accurate, I think it's better to correct that. I wouldn't mind you to just edit your post and c&p the following correction into it. Then one of the Mods could delete this post (but only then, please!).

Remember that the methods are handled as they are read, so as you already noticed, "switchAITo: sunSkimExitAI.plist" changes the AI BEFORE setUpEscorts can be called.
reverse their order and it should work fine.
(maybe add pauseAI: 5.0 in between for extra security)

---

I got my own problem:

I want to spawn a ship near a ship planted by script.plist.
I tried putting spawn in the AI, in script_actions, in setup_actions, I also tried spawnShip, but I really need the specific roles.
what happens is: the first ship is placed. according to the errorfile the next ship is spawned

It's not "lost in limbo", but already landed! Or, in fact, buried deep within the planet.

You see, "addSystemShips: <role> <number> <location>" adds a number of ships with a role at a certain location along the witchpoint-beacon -- planet line. It can range from 0..1, 0.0 being the witchpoint, 1.0 being the planet.

That just means that you have spawned your ship in the middle of the planet ! Not even a Pelamis was made for that.

Reducing the last number to 0.9 or 0.8 should make the ship appear in a reasonable distance from the planet.

I thought so at first too.
However, addsystemships adder 20 1 creates a cloud of ships around the station.
I think route1 actually ends at the Eagis.
Anyhow, it is not the addship that is not turning up, but the ship spawned by that one.

Not off-topic, because eventually it will lead to some useful information... (I hope). BUT at some point all these post should be heavily edited to finally result in ONE post that will contain this useful information. I don't have the power to do that, so one of the mods will have to do it (e.g. I am asking Charlie for a long time now o make a start by editing his Quaternion-post, so that I can remove two then-superfluous posts of mine).

Anyway, as for spawning, I have had the same problem when I wanted to surround my Hacker Outposts with asteroids. When I did that with "spawn" all the asteroids tended to be created within the Outpost's docking bay--not a particularly good place.

The problem seems to be that the spawning-location is just too close to the spawning entity. (Well, the example-use for the method is to substitute one entity with another in death_actions, so it makes perfect sense to have the coordinates very close.) What I would like to have is something like spawnWithinRadius: <role> <number> <radius> analogue to addShipsWithinRadius. That would allow exactly what you are trying to do.

So probably your rubberduck is spawned within its mothership then? For checking: Give it a beacon-code and look if it appears on the compass.

Another way to create your rubberducks would be to set them up as escorts of their spawning convoy.

Or you have to create the convoy with addShipsAtPrecisely and then add the rubberducks with addShipsWithinRadius and the same coordinates. addShipsAt wouldn't work, because it has too big an error-margin, so the the convoy would be too far off the rubberducks.

escorting is not an option as the rubberduck is the leader of the convoy

the idea is that the convoyAI scans (range 100000) for the presence of #5,4,3,2,1,rubberduck and follows the first ship it can find. (if none found at all, it will revert AI to rubberduck aka enteringTraderAI)
the elegant part is that I can call for one one ship in the list of convoyers and it should spawn it's 'leader' when set-up, thus I always have a full convoy as long as the role# I called in script.
Also if any in the convoy is lost for any reason, the line will close itself.
secondly, when they arive at Eagis and dock, each one in turn will turn 'duck' and dock....that is when I customise the AI, as enteringTrader may deside to go on vacation to the sun....

I'll just have to addShipsWithinRadius then...
but then another problem arises: the ships will be placed again when they are destroyed, not my intention. This then calls for some local_variable to be set by each convoyee upon death. Needlessly complex, but perhaps inevitable.

_________________Riding the Rocket!

Last edited by Arexack_Heretic on Thu Mar 15, 2007 1:06 pm, edited 1 time in total.

Remember that the methods are handled as they are read, so as you already noticed, "switchAITo: sunSkimExitAI.plist" changes the AI BEFORE setUpEscorts can be called.
reverse their order and it should work fine.

?? it is working fine, that's why i put the script here.
i'll qualify that tho : it was working fine in the tanker OXP, so i put it here...i've since tried to spawn some sentry gun emplacement models on another model, and it's flatly refusing. i did try the setUp first too, though i might try the pause as well. odd that the escort thingy worked fab for one model and not at all for another :-/

<editd> - the problem was sorted by Commander McLane - i'd put "string" instead of "integer" when specifying the number of escorters. what a mook, eh? Cheers Commander!

Quote:

escorting is not an option as the rubberduck is the leader of the convoy