Warning about Fuel tank oxp in 1.71

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Warning about Fuel tank oxp in 1.71

Post by Ark »

I just want to mention a warning about fuel tank oxp in oolite 1.71

Code: Select all

WARNING in AI fueltankAI.plist in state ADD_FUEL: the AI method scriptActionOnTarget: is deprecated and should not be used. It is slow and has unpredictable side effects. The recommended alternative is to use sendScriptMessage: to call a function in a ship's JavaScript ship script instead. scriptActionOnTarget: should not be used at all from scripts. An alternative is safeScriptActionOnTarget:, which is similar to scriptActionOnTarget: but has less side effects.
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

Thanks - I hadn't seen the note about v1.71, and wasn't really expecting things to be deprecated. Anyway, I've make use of scriptActionOnTarget as an AI method quite a bit in various OXPs mainly because there isn't (or wasn't) a better way of achieving the necessary results, and though they are sometimes a little slow I've always found them to be reliable. The script actions I've used are all pretty self-contained though, things like becomeUncontrolledThargon or becomeExplosion, so using the saveScriptActionOnTarget instead rather than re-engineering everything should work OK.

I've been waiting for v1.70 to stabilise before trying to bring my OXPs into line so I'll aim to get on to this now v1.71 is out.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

BTW: It's safeScriptActionOnTarget, not saveScriptActionOnTarget as erroneously listed in the wiki.
Post Reply