Random Hits OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

Post Reply
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

space hermits often have ships launching from them so it's rare to get past one without getting locked by the ship.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

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.
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.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Have you tried replacing:

Code: Select all

this.beingAttacked = function(whom)
with

Code: Select all

this.shipAttacked = this.beingAttacked = function(whom)
This should make that part of the code compatible with both 1.70 & 1.71! ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

In point of fact, this.beingAttacked will work in 1.71 (but will generate a log warning). The new name is this.shipBeingAttacked.
User avatar
Commander Mysenses
Deadly
Deadly
Posts: 214
Joined: Sat Mar 08, 2008 9:30 am
Location: Devon, a backward little planet scourged by evil weather

Post by Commander Mysenses »

@LittleBear
Any news on v.1.2 yet?
Bit of a drag to drop back to v.1.70, to complete the hit!
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

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.
BTBC
Above Average
Above Average
Posts: 21
Joined: Sun Apr 01, 2007 10:10 pm

Post by BTBC »

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.
WillASM
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Sat Mar 15, 2008 3:47 am

Escape pods

Post by WillASM »

BTBC 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.
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..
User avatar
Commander Mysenses
Deadly
Deadly
Posts: 214
Joined: Sat Mar 08, 2008 9:30 am
Location: Devon, a backward little planet scourged by evil weather

Re: Escape pods

Post by Commander Mysenses »

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..
What version of Oolite are you running?
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

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).
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.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

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.
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.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

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?
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.
User avatar
elite
Deadly
Deadly
Posts: 128
Joined: Thu Jun 21, 2007 9:26 am

Post by elite »

Yeahhh I can play it again as I now have 1.71.1

Thanks.
WillASM
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Sat Mar 15, 2008 3:47 am

Post by WillASM »

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 :lol:
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

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.
Post Reply