Page 1 of 3
Bang
Posted: Thu Feb 15, 2007 10:56 am
by Killer Wolf
Hi again,
nother question for my latest model. it's a ship, but when it dies i want a huge explosion instead of the normal type. am i right in thinking i just need a DEATH_ACTIONS bit, and if so, is there a list of what the actions are? i was looking at teh nuke missile thing to see if that would help but it all seems tied in w/ AIs, and my ship already will have the normal sunskim-trader AI.
ta,
Posted: Thu Feb 15, 2007 9:09 pm
by LittleBear
death actions can do most anything!
Easiest way to get a big bang would to have a spawn: specialfrag 20 (say) as a death action. Define specialfrag as a like_ship to a metal fragment, but give it an AI that just had a become:bigexpolsion (check the wilki for the exact command but it somthing like that!). Then when you ship dies it splits into loads of little bits that then each blow up most spectacually. Be warned though this is likley to cause hugh slow down, so play about with the numbers!
Posted: Fri Feb 16, 2007 12:39 pm
by Killer Wolf
cheers LittleBear.
never done AI before, is it literally just that command in {} or do i have to expand it a bit as in the missile AI :
EXPLODE = {
ENTER = (becomeExplosion);
EXIT = ();
UPDATE = (); };
GLOBAL = {
ENTER = ("setStateTo: EXPLODE");
EXIT = ();
UPDATE = ();
};
(i've adapted that a bit to what i think it might be).
thinking of using becomeenergyblast too :-)
ta
Posted: Fri Feb 16, 2007 1:21 pm
by LittleBear
Yeah, that should do it!
Think energy blast is what the q-mine uses, so you might spawn a load of q-mines if you used that one!
EDIT : You would need the full set of commands you posted, as the command needs to be in an AI "state" like "EXPLODE" rather than just on its own and the GLOBAL is necessary to set Oolite into the right "state" to perform the command.
Posted: Fri Feb 16, 2007 3:49 pm
by TGHC
LittleBear wrote:Yeah, that should do it!
Think energy blast is what the q-mine uses, so you might spawn a load of q-mines if you used that one!
Not related to the Krays are you?
Posted: Fri Feb 16, 2007 6:56 pm
by Killer Wolf
i should spawn a lot of q-tips instead. that would be interesting.
Posted: Fri Feb 16, 2007 7:07 pm
by LittleBear
If you want the ship to spawn a q-mine when it dies, then just have a:-
Code: Select all
<key>death_actions</key>
<array>
<string>spawn: EQ_QC_MINE 1</string>
</array>
In shipdata. No need to do an AI or a likeshiped fragment. Its a bit mean though!
A few of my Renegades do this!
Posted: Sun Feb 18, 2007 9:30 am
by Killer Wolf
cheers people, that's working pretty sweet. minor disappointments are :
- billions upon billions of shrapnel fragments, a la a pirate cove distruction
- spawning a q-bomb thingy does exactly that - a q-bomb, not just the blast. i therefore get my ship exploding, a bit of a pause and then a blue sphere some distance away. i tried changing my shrapnel AI to BecomeEnergyBlast instead of BecomeExplosion but it didnt seem to work :-/
still, i think i'll just tweak the model IRO centre-of-mass and some flashers and i'll stick a link, see what people think.
BAh
Posted: Sun Feb 18, 2007 4:11 pm
by Killer Wolf
Right, more probs : why isn't my escort command working? my ship's set up as a sunskimmer. i have route2sunskim AI and i've seen her there a few times, but i've set her up w/ four escort ships, and none appear. i copied the Anaconda set up, nothing. i set the ships to "mamba-escort" - nothing. i took the ship bits out, as per the Boa shipdata, nothing. where's my escorts gone? :-(
i should add, nothing untoward in stderr (except a couple times it says 0 sunskimmer added, when there is).
Ta!
Posted: Sun Feb 18, 2007 5:11 pm
by Griff
Hi KW
I'm not trying to push my work on anybody, but if you have a look at the santa.oxp (the v2 one with the reindeers) that's a very simple oxp that just adds a ship and some escorts who appear in a system and fly to the planet.
Hmm, If you're not seeing escorts it might be because you need to add setUpEscorts as a command in your mainships AI script (i think you can do a setupEscorts in the mainships shipdata.plist data too, not sure of the syntax though.).
eg, for santa to get his escorts, i've got the following
Code: Select all
GLOBAL = {
ENTER = (setUpEscorts);
EXIT = ();
ATTACKED = (broadcastDistressMessage, "setStateTo: ATTACK_SHIP");
UPDATE = (setCourseToPlanet, performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = (landOnPlanet);
};
Oh, as a curious note, whilst trying to write the santa.oxp, i had the setupEscorts command in somewhere like the "attacked" = section of the AI, this meant that when you fired on a lone santa, his escorts magically appeard around you and started blasting - i always thought that might be a cool thing to do intentionally, almost like a pirate trap - you spot a lone ship, badly damaged..then when you get close loads of pirates appear out of nowhere!
Posted: Mon Feb 19, 2007 8:10 am
by Killer Wolf
Cheers Griff.
re adding to AI, i'm just using the standard sunskim thing, i have no experience yet of any AI/script stuff, so if anything i'd probbly have to find the way of putting it in shipdata.
that's one of the things confusing me when i try doing stuff like this tho, i look over existing stuff and there doesn't seem to be much consistency to get a hold of. eg : the Anaconda plist has ESCORTS and also ESCORT_SHIPS defining (IIRC) cobramk1. But, Boa doesn't have the ESCORT_SHIPS bit, so i originally thought that that would mean it would pick some at random - like my unexpected GalCop Vampire escorts i mentioned in another post. Adding to that confusion is that some of the fighters don't appear to have ESCORT in their Roles - so i don't knoe if that affects stuf, as there are also specific things in the Oolite shipdata plist like the Mamba_escort, which led me to think there'd be Asp_escort, Krait_escort etc...until i found there wasn't! :-D
having a bit skeg at wiki inbetween typing this, it looks like the AI bit is the way to go, so i might just nick the sunskim trader bit, add setupescorts and cross my paws :-)
actually might be a good way to go, as i don't want my ships to dock (if that's actually in sunskim stuff) cos they're so big.
right, that's my project for this lunchtime!
BTW, i love that idea of hidden escorts, might have to try and come up w/ a plot for an OXP around that - Predator ships seem to be able to cloak for a long time, eg ;-)
Posted: Mon Feb 19, 2007 10:52 am
by Griff
Roberto has an old thread here
https://bb.oolite.space/viewtopic.php?t=2366
in which one of the topics is getting escorts working, Arexack_Heretic posts the following as an example of the setupEscorts command version that goes into the Shipdata.plist rather than it's AI:-
Code: Select all
<key>setup_actions</key>
<array>
<string>setUpEscorts</string>
</array>
yeah, it is all a bit confusing, i had a scan through the shipdata.plist and i think you're on the right track,
eg, if you put this in your ships entry in the shipdata.plist file
Code: Select all
<key>escorts</key>
<integer>2</integer>
<key>escort-ship</key>
<string>cobramk1</string>
it would always appear with 2 Cobra Mk1's escorting it - note if you want a specific ship to appear, use it's name and not the role you've given it - by name i mean the first <key> in it's entry oin the shipdata.plist file.
if you just put:-
Code: Select all
<key>escorts</key>
<integer>2</integer>
then oolite should pick two random escorts from all the ships with the role escort
Posted: Mon Feb 19, 2007 1:06 pm
by Killer Wolf
Thanks Griff, i'll play w/ that when i get home tonight.
re that setup thing, i just had a lush thought - virus ships!! imagine : define SHIP A as having an escort. now define SHIP B, that has as it's escort a SHIP B : would the game create SHIP A, add the SHIP B escort, which it sees needs a SHIP B escort, so it adds one, which also needs an escort SHIP B..... :-D
might be fun!
Nuts >:-/
Posted: Mon Feb 19, 2007 8:48 pm
by Killer Wolf
Well, that SetUpEscorts seemed to work....kinda....
put it in, hyped, went to the sun and there was my ship in the distance. got up to her, lo and behold were four Asp escorts. Get in there. i thought...
decided to playtest a bit more, jumped to Ensoreus, heading to the planet i saw another - they're pretty damn big - and WFI'd up to her. no escorts. :-/
next time around, was one heading for Ararus - 3 escorts, 2 nearby, one had been off wandering and was coming back.
now, i know the ships tend to do their own thing so i'm wondering if this is a natural course of events and i can release the OXP, or does it sound like there's a glitch somewhere? one thing that i did wonder about is that Asps are given pirateAI, so i was thinking this might cornflake w/ the escort role?? i doubt it, given other ships like the Cobra MkI also has pirate AI, but i'm just covering bases. it's a bit annoying, this randomness, cos i need the escorts there to fit in w/ the whole ship story : they're big lumbering unarmed craft and need the escorts for protection, so if they're only gonna appear sporadically it's going to be a bit silly
having gone back to that thread you mentioned Griff, i have considered just now that maybe my roles are affecting things. i had"trader sunskim-trader", and when i changed it to cop roles (i find it easier to get my ships to appear - launch and shoot a buoy
) they didn't have escorts either.
damn, this is frustrating! i wish you could add a test thingy to the playtest version to flash up "created xxxx + xxxx escorts" just so i'd know whether the thing was working or not :-/
Re: Nuts >:-/
Posted: Mon Feb 19, 2007 9:05 pm
by Dr. Nil
Killer Wolf wrote:i wish you could add a test thingy to the playtest version to flash up "created xxxx + xxxx escorts" just so i'd know whether the thing was working or not :-/
Try using a name like kwspecescort for the role (role for the escort ship and escort ship role in the escorted ship's entry). Then you can take an AI dump as soon as you entera system to see if they're added and how many there are. AI dump is made to the stderr.txt by pressing '0' (zero) while the game is paused.