How is subentity scripts supposed to work ?

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

How is subentity scripts supposed to work ?

Post by Frame »

sub-entity scripts: I cant get them work in 1.84.

they dont respond to

Code: Select all

this.shipDied = function() 

Code: Select all

this.shipSpawned = function()
Bounty Scanner
Number 935
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: How is subentity scripts supposed to work ?

Post by phkb »

Not sure about the spawning one, but instead of shipDied, have you tried entityDestroyed or shipRemoved?
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: How is subentity scripts supposed to work ?

Post by Frame »

phkb wrote: Tue Oct 10, 2017 4:50 am
Not sure about the spawning one, but instead of shipDied, have you tried entityDestroyed or shipRemoved?
Thanks. entityDestroyed works.

I just discovered this on the wiki in regard to shipSpawned "Note that this is not called for subentities - if subentities need specific set up running, this must be called from the main ship's handler."

I missed it when i last read it.

Thanks anyway. :)

I'm redoing some Turret code with articulated turrets with a base and a barrel rotating like the gunhouses and barrels on ships. My old approach was a main ship script, but having a script pr Turret would be an easier approach.
Bounty Scanner
Number 935
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: How is subentity scripts supposed to work ?

Post by Frame »

I used aiStarted instead. just for the record.
Bounty Scanner
Number 935
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: How is subentity scripts supposed to work ?

Post by Diziet Sma »

Frame wrote: Tue Oct 10, 2017 8:11 am
I'm redoing some Turret code with articulated turrets with a base and a barrel rotating like the gunhouses and barrels on ships.

I like this concept!
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Post Reply