Random Hits OXP
Moderators: winston, another_commander
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
Just to let players know: Random hits works on 1.70, but will not work on the test 1.71 version. This is due to two Java Commands being renamed. It would be a quick search and replace to change them to the new names, but if I did this then it woudn't work on 1.70! When 1.71 becomes officall I'll put up a 1.2 version of Random Hits with the new names. In the meantime, you must use 1.70 of Oolite to play Random Hits.
Random Hits uses the "thisBeingAttacked" command to test who (player or NPC) was the last ship to attack the victim before his death (ie who fired the fatal shot). On 1.71 this command is changed to "thisShipAttacked". As a result if you play on 1.71 although the victim will be there, the OXP will not recognise that you killed him.
Random Hits uses the "thisBeingAttacked" command to test who (player or NPC) was the last ship to attack the victim before his death (ie who fired the fatal shot). On 1.71 this command is changed to "thisShipAttacked". As a result if you play on 1.71 although the victim will be there, the OXP will not recognise that you killed him.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
Have you tried replacing:
with
This should make that part of the code compatible with both 1.70 & 1.71!
Code: Select all
this.beingAttacked = function(whom)
Code: Select all
this.shipAttacked = this.beingAttacked = function(whom)
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:
In point of fact, this.beingAttacked will work in 1.71 (but will generate a log warning). The new name is this.shipBeingAttacked.
E-mail: [email protected]
- Commander Mysenses
- Deadly
- Posts: 214
- Joined: Sat Mar 08, 2008 9:30 am
- Location: Devon, a backward little planet scourged by evil weather
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
RL has been pretty bad, so no time ATM. Probabley get it out week after next though.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
I am having a problem the mark jumped systems and I followed and destroyed the target ship I then get told that he has escaped in a pod and to destroy the pod but I cant find any pods
Here is the error message from the shell window..
**** WARNING in AI randomhitsmark2aAI.plist in state JUMP_OUT: the AI method scr iptActionOnTarget: is deprecated and should not be used. It is slow and has unpr edictable side effects. The recommended alternative is to use sendScriptMessage: to call a function in a ship's JavaScript ship script instead. scriptActionOnTa rget: should not be used at all from scripts. An alternative is safeScriptAction OnTarget:, which is similar to scriptActionOnTarget: but has less side effects.
2008-04-26 20:40:57.474 oolite[6477] [script.javaScript.warning.206]: ----- Java Script warning: system.legacy_spawn() is deprecated (and never worked), use Ship .spawn() instead.
Here is the error message from the shell window..
**** WARNING in AI randomhitsmark2aAI.plist in state JUMP_OUT: the AI method scr iptActionOnTarget: is deprecated and should not be used. It is slow and has unpr edictable side effects. The recommended alternative is to use sendScriptMessage: to call a function in a ship's JavaScript ship script instead. scriptActionOnTa rget: should not be used at all from scripts. An alternative is safeScriptAction OnTarget:, which is similar to scriptActionOnTarget: but has less side effects.
2008-04-26 20:40:57.474 oolite[6477] [script.javaScript.warning.206]: ----- Java Script warning: system.legacy_spawn() is deprecated (and never worked), use Ship .spawn() instead.
Escape pods
Same problem here, I can complete the missions so long as the targetBTBC wrote:I am having a problem the mark jumped systems and I followed and destroyed the target ship I then get told that he has escaped in a pod and to destroy the pod but I cant find any pods
Here is the error message from the shell window..
**** WARNING in AI randomhitsmark2aAI.plist in state JUMP_OUT: the AI method scr iptActionOnTarget: is deprecated and should not be used. It is slow and has unpr edictable side effects. The recommended alternative is to use sendScriptMessage: to call a function in a ship's JavaScript ship script instead. scriptActionOnTa rget: should not be used at all from scripts. An alternative is safeScriptAction OnTarget:, which is similar to scriptActionOnTarget: but has less side effects.
2008-04-26 20:40:57.474 oolite[6477] [script.javaScript.warning.206]: ----- Java Script warning: system.legacy_spawn() is deprecated (and never worked), use Ship .spawn() instead.
does not bail out in an escape pod. If he does bail, thats an automatic
failure for that mission..
- Commander Mysenses
- Deadly
- Posts: 214
- Joined: Sat Mar 08, 2008 9:30 am
- Location: Devon, a backward little planet scourged by evil weather
Re: Escape pods
What version of Oolite are you running?WillASM wrote:Same problem here, I can complete the missions so long as the target does not bail out in an escape pod. If he does bail, thats an automatic failure for that mission..
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
Yeah. This is because the name of the command which lauches the pod (and a couple of others too) have been changed between 1.70 and 1.71. I need to do a new version of Random Hits to make it work properly with V1.71 of Oolite. Basically, it just needs me to go through my Java Scripts and AIs :- (Open up, Serach and replace - test!) to change the names. The OXP has a lot of varitey to it though, so it means me getting round to doing this with over 100 AIs and Scripts! It will be done when I have some time (probabley next week) and I'll then upload a 1.2 of Random Hits (for Oolite 1.71 onwards). For the moment the V1.1 of Random Hits runs bug-free with Oolite 1.70, but won't work properly with 1.71.
EDIT:-
Done So Far:-
1) Changed the AIs which use scriptActionOnTarget to safeScriptActionOnTarget.
2) Commented out the Description of all Java Script files (this solves the problem of the second pod spawned in the same game session not following its script).
EDIT:-
Done So Far:-
1) Changed the AIs which use scriptActionOnTarget to safeScriptActionOnTarget.
2) Commented out the Description of all Java Script files (this solves the problem of the second pod spawned in the same game session not following its script).
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
Changed all the problem commands on the version on my machine:-
system.legacy_spawn ==>> this.ship.spawn
this.beingAttacked ==>> this.shipBeingAttacked
scriptActionOnTarget ==>> safeScriptActionOnTarget
This should work to make the next version of Random Hits work on V1.71 onwards of Oolite. Need to do some playtesting before uploading though.
system.legacy_spawn ==>> this.ship.spawn
this.beingAttacked ==>> this.shipBeingAttacked
scriptActionOnTarget ==>> safeScriptActionOnTarget
This should work to make the next version of Random Hits work on V1.71 onwards of Oolite. Need to do some playtesting before uploading though.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
- LittleBear
- ---- E L I T E ----
- Posts: 2882
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
UPDATE TO VERSION 1.2.
Version 1.2 of Random Hits is now on the Wiki (follow the link on my signature to download).
Please Note version 1.2 of Random Hits now requires version 1.71 (or higher) of Oolite. It will not run properly on a lower version (including 1.70). This new version takes account of several command name charges between Version 1.70 and Version 1.71 of Oolite. It will now run properly on Version V1.71 and higher. Changes :-
- All instances of “system.legacy_spawn” changed to “this.ship.spawn”.
- All instances of “this.beingAttacked” changed to “this.shipBeingAttacked”.
- All instances of “scriptActionOnTarget” changed to “safeScriptActionOnTarget”.
- Descriptions commented out from Java Scripts.
- Space Bars now have Station Scan Class (i.e. they show as green on the scanner).
- Couple of tweaks to the AIs.
- A few more typos, grammar errors and spelling mistakes fixed.
I've tested it on both 1.71 and 1.71.1 and seems to be working as intended. You MUST use this version if playing on 1.71 onwards as the old (1.1 Version) of Random Hits will not work on Version 1.71 of Oolite. Please note that the new V1.2 Version of Random Hits REQUIRES Version 1.71 of Oolite or higher.
I've also edited the first post on this thread to reflect the Update.
If you do hit a problem with the game not recognising a kill or a pod not appearing, could you post the TYPE of ship (Python, Cobra III etc) where this happened?
Version 1.2 of Random Hits is now on the Wiki (follow the link on my signature to download).
Please Note version 1.2 of Random Hits now requires version 1.71 (or higher) of Oolite. It will not run properly on a lower version (including 1.70). This new version takes account of several command name charges between Version 1.70 and Version 1.71 of Oolite. It will now run properly on Version V1.71 and higher. Changes :-
- All instances of “system.legacy_spawn” changed to “this.ship.spawn”.
- All instances of “this.beingAttacked” changed to “this.shipBeingAttacked”.
- All instances of “scriptActionOnTarget” changed to “safeScriptActionOnTarget”.
- Descriptions commented out from Java Scripts.
- Space Bars now have Station Scan Class (i.e. they show as green on the scanner).
- Couple of tweaks to the AIs.
- A few more typos, grammar errors and spelling mistakes fixed.
I've tested it on both 1.71 and 1.71.1 and seems to be working as intended. You MUST use this version if playing on 1.71 onwards as the old (1.1 Version) of Random Hits will not work on Version 1.71 of Oolite. Please note that the new V1.2 Version of Random Hits REQUIRES Version 1.71 of Oolite or higher.
I've also edited the first post on this thread to reflect the Update.
If you do hit a problem with the game not recognising a kill or a pod not appearing, could you post the TYPE of ship (Python, Cobra III etc) where this happened?
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
Works like a charm after 3 missions, the pods are showing up now after they bail. Thank you Very much for the quick update LittleBear.
By the way, very addictive oxp, having a great time chasing these guys down, thanks again.. As a side note, Finally reached *Deadly*
status today on the last mission, only about 3800 more to go
By the way, very addictive oxp, having a great time chasing these guys down, thanks again.. As a side note, Finally reached *Deadly*
status today on the last mission, only about 3800 more to go
I have a problem with v1.2:
There is no visible docking bay on the space bars.
From one side I can see a large arched "door" but "My God! It's full of stars!"
If I fly through it nothing happens but then in my rear screen I see a solid wall.
There are no relevant error messages on the debug screen.
Suggestion and workarounds are welcome.
There is no visible docking bay on the space bars.
From one side I can see a large arched "door" but "My God! It's full of stars!"
If I fly through it nothing happens but then in my rear screen I see a solid wall.
There are no relevant error messages on the debug screen.
Suggestion and workarounds are welcome.