this.ship.remove() bugs, triggers death actions.. SVN 2317
Moderators: winston, another_commander, Getafix
this.ship.remove() bugs, triggers death actions.. SVN 2317
bug ?,
Logically I would assume that ship.remove() should not trigger death actions, only ship.explode() should do that.
I just wrote a convenience OXP that removes the bugs from Interstellar space
upon entering it.
And upon entering the system I'm greeted with 2-3 thargoid curses.
this is for svn 2317...
Either that or i Would suggest a ship.vanish() function once the feature freeze is lifted..
Logically I would assume that ship.remove() should not trigger death actions, only ship.explode() should do that.
I just wrote a convenience OXP that removes the bugs from Interstellar space
upon entering it.
And upon entering the system I'm greeted with 2-3 thargoid curses.
this is for svn 2317...
Either that or i Would suggest a ship.vanish() function once the feature freeze is lifted..
Bounty Scanner
Number 935
Number 935
I thought .remove() always triggered death actions (but you can get around it in js using the parameters of the function to tell the difference).
IIRC the only difference between vanish and explode was the explosion (or lack thereof)?
Editted to add - this post by A_C has some more details, from when .remove() was implemented.
IIRC the only difference between vanish and explode was the explosion (or lack thereof)?
Editted to add - this post by A_C has some more details, from when .remove() was implemented.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Frame, you could also do:
All the death actions - including the legacy ones - shouldn't be triggered anymore.
Cheers,
Kaks
Code: Select all
ship.script.shipDied=function(){};
ship.remove();
Cheers,
Kaks
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
For parameters see here.Thargoid wrote:I thought .remove() always triggered death actions (but you can get around it in js using the parameters of the function to tell the difference).
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Thanks again ..
Man I hate being language blind sometimes, I think I spend 30 mins chasing some illusive bug that wouldn't let me move ships around
I had written ship.positon instead of position little small typo,
, but thats just me in a nutshell
Man I hate being language blind sometimes, I think I spend 30 mins chasing some illusive bug that wouldn't let me move ships around
I had written ship.positon instead of position little small typo,
, but thats just me in a nutshell
Bounty Scanner
Number 935
Number 935
Still, your original point makes sense! What if you want to remove all ships that haven't got a specific role, and one of those adds to a player's bounty in either its death actions or in this.shipDied()?
The relentless wheel of progress marches on...
After 1.73, ship.remove() will have an extra option: if you call ship.remove(true) the ship will vanish without triggering any of its death actions.
However, .remove() ( and .remove(false) ) will still perform the ship's death actions.
The relentless wheel of progress marches on...
After 1.73, ship.remove() will have an extra option: if you call ship.remove(true) the ship will vanish without triggering any of its death actions.
However, .remove() ( and .remove(false) ) will still perform the ship's death actions.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
And I was relying on death_actions to remove my timers and other stuff!! We than need another way for triggering cleanup code.Kaks wrote:The relentless wheel of progress marches on...
After 1.73, ship.remove() will have an extra option: if you call ship.remove(true) the ship will vanish without triggering any of its death actions.
That will fail now also when any other NPC kills that ship or that ship crashed into an asteroid. When it proper checks who killed it, nothing will happen.and one of those adds to a player's bounty in either its death actions or in this.shipDied()?
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Well, normal remove()s wouldn't cause any problems, but if another oxp does a remove(true), then we'd have a difficult to track problem. The error messages would come from your oxp, but another oxp would have caused the errors in the first place. In that case, we'd have to have a warning in the log whenever a remove(true) override is used.Eric Walch wrote:And I was relying on death_actions to remove my timers and other stuff!! We than need another way for triggering cleanup code.
True, and I probably used the wrong example. But what if another oxp remove()s a random hit contract for whatever reason?Eric Walch wrote:That will fail now also when any other NPC kills that ship or that ship crashed into an asteroid. When it proper checks who killed it, nothing will happen.
Hmm, more thinking required!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
For 1.74, I intend to add both an all-purpose "ship being removed" handler, and a way for timers to automatically stop when their ships die.
E-mail: [email protected]
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
With any code you will have conflict of interest. But random hits for example is checking who killed it. If it just would be removed, it does nothing.Kaks wrote:True, and I probably used the wrong example. But what if another oxp remove()s a random hit contract for whatever reason?Eric Walch wrote:That will fail now also when any other NPC kills that ship or that ship crashed into an asteroid. When it proper checks who killed it, nothing will happen.
Hmm, more thinking required!
I think andom hits sets a variable that an NPC has killed the ship. But that is still better that searching for hours for an non existing ship because it could not react on its disappearance.
Problem would be legacy death_actions as they cant check who killed it and may just spawn some debris on death.
Last edited by Eric Walch on Sun Aug 30, 2009 1:14 pm, edited 1 time in total.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Something along the lines of a this.isRemoved event to be triggered when the ship is remove()d, with or without death actions?
That alone would solve quite a few timers problems!
That alone would solve quite a few timers problems!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Something like that. But why would an oxp remove things from others! (Sounds like a super weapon) In buoy repair I also remove things but that is always my own stuff and that I can control myself.Kaks wrote:Something along the lines of a this.isRemoved event to be triggered when the ship is remove()d, with or without death actions?
That alone would solve quite a few timers problems!
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Very good question! And it is a super weapon, one that has been there - largely unused - for quite a long time. In other words, the main problem is that - in theory at least - all oxps can add/remove everything from all others!Eric Walch wrote:But why would an oxp remove things from others!
All the problems we used to have with mission screens were totally unintentional, but they couldn't be fixed until the new methods and events were in place.
Similarly, some oxps death actions might have totally unintended consequences if unintentionally remove()d by another oxp, or it could be even worse if they're removed without death actions. We do need a way to deal with both possibilities, at least that's what it looks like.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Oh, I can imagine that this is helpful to free some ressources, or to protect mission ships in early missions. And then removing Uber-ships is a nice option. The next LH has such a mechanism (limits police and hunters if mission is active) and the OXPShipRegulator has already used it - even if it was a special case for Vista users at that time.Kaks wrote:Very good question! And it is a super weapon, one that has been there - largely unused - for quite a long time. In other words, the main problem is that - in theory at least - all oxps can add/remove everything from all others!Eric Walch wrote:But why would an oxp remove things from others!