Halloween Witch OXP (was: NPC ship attack using missiles)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Halloween Witch OXP (was: NPC ship attack using missiles)

Post by Griff »

Halloween Witches, V1.5.2:
https://drive.google.com/file/d/15n5SsV ... sp=sharing
Adds a squad of 3 witches near the witchpoint beacon on October the 31st
Thanks to Eric & CommonSenseOTB for their fantastic scripting and Smivs for bugfixing the non appearing pumpkins issue

Image


Original post:
Does anyone know if there's an OXP ship somewhere that only attacks using missiles? I need something like this for a halloween witch oxp, i don't want to give her lasers, i'd rather she just attacked using an unlimited supply of custom missiles shaped like pumpkins


I've got all the objects appearing in game but i'm missing something - she just won't fire any missiles - even if i prod her a few times with a pulse laser :)

WIP version of the oxp here:
http://www.box.net/shared/lmy8yne6dp3ov9z4shlx
Note: this oxp has a script that spawns two of the witches outside the station whenever you launch
Last edited by Griff on Sat Oct 30, 2021 11:44 am, edited 6 times in total.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Smivs »

Griff wrote:
unlimited supply of custom missiles shaped like pumpkins
:shock:
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Fatleaf
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 1988
Joined: Tue Jun 08, 2010 5:11 am
Location: In analysis mode on Phaelon
Contact:

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Fatleaf »

The Smivs MkI Hardheaded Missile :P
Find out about the early influences of Fatleaf here. Also his OXP's!
Holds the Ooniversal record for "Thread Necromancy"
User avatar
Gimi
---- E L I T E ----
---- E L I T E ----
Posts: 2073
Joined: Tue Aug 29, 2006 5:02 pm
Location: Norway

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Gimi »

:shock: :D :lol: 8)

Can't wait for whatever you have in stock for X-mas, Valentines, Easter and so on.
"A brilliant game of blasting and trading... Truly a mega-game... The game of a lifetime."
(Gold Medal Award, Zzap!64 May 1985).
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Smivs »

Incoming!

Image

Missiles need an equipment key in their 'roles'.
In the witches shipdata, make the

Code: Select all

missile_role = "EQ_griff_pumpkin_missile";
and the pumpkins' shipdata also needs the 'EQ_' , so

Code: Select all

roles = "EQ_griff_pumpkin_missile";
Last edited by Smivs on Mon Oct 24, 2011 5:13 pm, edited 1 time in total.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Thargoid »

The AI command fireMissile (with a suitable target set first), or indeed the equivalent function (with brackets) in JS, is your friend (or black cat) here...
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Killer Wolf »

Back in 1984, i wonder if Bell and Braben ever foresaw something like this in the future of Elite... :-D

Griff, if you use your flickery engine power script, could you paint up the pumpkins to make it looke like they had a candle inside like a jack o'lantern? might look a bit Horsemanish if you see some of them swooping towards you.
oooh - be even better if they explode into pulp when you ECM them :-D

edit
Black cats - sounds familiar. haha, geddit?
anyways - how come you need a script thing to do this? if you design a ship w/ no main gun how come it won't use the weapons it does have, instead? just curious...
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Griff »

Thanks Guys! I've got the pumpkins working now - i think i'll give her a small, weak plasma turret as a main weapon, and she can fire off her pumpkins whenever the mood takes her, plasma bolts look a bit like magic spells, well sort of...
@K_W - she did use her missiles, but seemingly only after you shot at her a bit - i've got the flickery engine effect added in as a glow map on the pumpkin face, i think i'll have a bit of an experiment with wobbling the scale using a vertex shader, see if i can get them squash & stretching like the bouncing pumpkin character in 'Cauldron 2' on the C64.
edit: actually, K_W that's a great idea, maybe if you ECM them they can burst into 4 smaller faster mini-pumpkins

actually, does anyone know if it's possible to modify the players hud on the fly, so that if they get hit by a pumpkin their screen gets obscured by a splat of pumpkin goo?
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Eric Walch »

Thargoid wrote:
The AI command fireMissile (with a suitable target set first), or indeed the equivalent function (with brackets) in JS, is your friend (or black cat) here...
As thargoids says you must explicit fire the missiles in your script, or oolite will decide for you. However just using the AI command fireMissile might give unwanted results for you as oolite will use random missiles in 10% of the cases.

To get full controll define in shipdata:

Code: Select all

max_missiles = 1;
missiles = 0;
that way the ship will be initialized without any missiles. Than in the AI fire a missile with:

Code: Select all

"sendScriptMessage: $fireMissile"
Than in the ship script of your ship (you have to add one) add the lines:

Code: Select all

this.$fireMissile = function ()
{
    this.ship.awardEquipment("EQ_griff_pumpkin_missile");
    this.ship.fireMissile();
}
That will guarantee that only this missile is loaded and than immediately fired. So your bay is empty again and oolites internal code will never be able to fire one unexpected. This code will supply an unlimited amount of missiles as you requested. When you want a limit, just add a counter in above function like:

Code: Select all

this.missiles = 6;

this.$fireMissile = function ()
{
    if (this.missiles > 0)
    {
        this.ship.awardEquipment("EQ_griff_pumpkin_missile");
        this.ship.fireMissile();
        this.missiles--;
    }
}
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: OXP Help - NPC ship that attacks only using missiles?

Post by CommonSenseOTB »

Griff wrote:
Thanks Guys! I've got the pumpkins working now - i think i'll give her a small, weak plasma turret as a main weapon, and she can fire off her pumpkins whenever the mood takes her, plasma bolts look a bit like magic spells, well sort of...
@K_W - she did use her missiles, but seemingly only after you shot at her a bit - i've got the flickery engine effect added in as a glow map on the pumpkin face, i think i'll have a bit of an experiment with wobbling the scale using a vertex shader, see if i can get them squash & stretching like the bouncing pumpkin character in 'Cauldron 2' on the C64.
edit: actually, K_W that's a great idea, maybe if you ECM them they can burst into 4 smaller faster mini-pumpkins

actually, does anyone know if it's possible to modify the players hud on the fly, so that if they get hit by a pumpkin their screen gets obscured by a splat of pumpkin goo?
Very cool Griff! :lol:

Have you got a picture of the pumpkin goo as it looks like smeared on the viewscreen? I could probably make a script that checks which missile hit you, stores which hud you had, switches to a hud with just the goo on it, and using a timer replaces back the previous hud. Would be fun to try and get it to work over the next couple of days. Maybe find a splat sound for it too! :D
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: OXP Help - NPC ship that attacks only using missiles?

Post by DaddyHoggy »

Griff wrote:
Thanks Guys! I've got the pumpkins working now - i think i'll give her a small, weak plasma turret as a main weapon, and she can fire off her pumpkins whenever the mood takes her, plasma bolts look a bit like magic spells, well sort of...
@K_W - she did use her missiles, but seemingly only after you shot at her a bit - i've got the flickery engine effect added in as a glow map on the pumpkin face, i think i'll have a bit of an experiment with wobbling the scale using a vertex shader, see if i can get them squash & stretching like the bouncing pumpkin character in 'Cauldron 2' on the C64.
edit: actually, K_W that's a great idea, maybe if you ECM them they can burst into 4 smaller faster mini-pumpkins

actually, does anyone know if it's possible to modify the players hud on the fly, so that if they get hit by a pumpkin their screen gets obscured by a splat of pumpkin goo?
Give her a wand and have the plasma spurt from the tip of the wand....

BTW, just wanted to say - wonderful Griff, really wonderful (or given the celebration more accurately - Terrific)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Re: OXP Help - NPC ship that attacks only using missiles?

Post by JazHaz »

OMG and I thought April was 6 months away :lol:
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Svengali »

Hehehe - cool OXP and nice model/texture work, Griff!
Griff wrote:
actually, does anyone know if it's possible to modify the players hud on the fly, so that if they get hit by a pumpkin their screen gets obscured by a splat of pumpkin goo?
Two possibly ways, I'd think. Either the way CSOTB has suggested or via shader (like the hyperjump in BGS or the overlays in Vector). CSOTBs way will work for all users, so it's probably the better option here.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: OXP Help - NPC ship that attacks only using missiles?

Post by CommonSenseOTB »

Griff, I've got something that might work. When you have a version for test where the missiles work the way you want them to, then I will attach a script to the pumpkin missile and have a test. You will have to provide a png of the pumpkin goo however for me to install as my test will simply use a test picture only. :D
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Re: OXP Help - NPC ship that attacks only using missiles?

Post by Killer Wolf »

"she can fire off her pumpkins whenever the mood takes her"
"have the plasma spurt from the tip of the wand"

;-)
Post Reply