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: 1474
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

How is subentity scripts supposed to work ?

Post by Frame » Mon Oct 09, 2017 11:28 pm

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
Commodore
Commodore
Posts: 2414
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: How is subentity scripts supposed to work ?

Post by phkb » Tue Oct 10, 2017 4:50 am

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: 1474
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: How is subentity scripts supposed to work ?

Post by Frame » Tue Oct 10, 2017 8:11 am

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: 1474
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: How is subentity scripts supposed to work ?

Post by Frame » Tue Oct 10, 2017 2:28 pm

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: 6310
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 » Sun Oct 22, 2017 10:08 am

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