Random Hits small prob

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

Moderators: winston, another_commander

Post Reply
User avatar
Massively Locked
Dangerous
Dangerous
Posts: 84
Joined: Tue Nov 20, 2012 12:20 pm

Random Hits small prob

Post by Massively Locked »

Hi-

I recently had a bit of strangeness with Random Hits as you can see below. I did a quick search for RH bugs but didn't see anything similar. Has anyone else experienced this?

Image

Fortunately, it's not a big deal, not a game breaker.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Random Hits small prob

Post by Eric Walch »

It could because of one of my latest 'improvements' in the last version. I did notice it bugs under certain conditions and fixed it a few weeks back, but never came to updating it. When you can confirm you use the latest version, I'll update my fixed version and hope it is the same bug.

But as far as I remember, that bug should only become visible when using trunk builds, were the commander is offered a new bar visit through the new F4 screen. (I did not correctly set all strings back).

EDIT: better looking at your screen, I see it is a fulfilment message. That is not part of the bug I mend.
User avatar
Massively Locked
Dangerous
Dangerous
Posts: 84
Joined: Tue Nov 20, 2012 12:20 pm

Re: Random Hits small prob

Post by Massively Locked »

Thanks for the reply, Eric. I'm on 1.76.1 and v1.4.16 of RH.

If it helps, this bug popped up as follows: I fought with my mark; he got away, and I lost him. I pulled into the main station to fuel up. There I received a nasty-gram from my employers about letting my target slip away. I launched and found him again after a short time. It was here I first saw that his target ID was messed up ("mission_random_hits_store_mark_first_name"... etc.)

Like I said- not a big deal. I've completed 2 other hits since without a problem.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Random Hits small prob

Post by Eric Walch »

Massively Locked wrote:
If it helps, this bug popped up as follows: I fought with my mark; he got away, and I lost him. I pulled into the main station to fuel up. There I received a nasty-gram from my employers about letting my target slip away. I launched and found him again after a short time. It was here I first saw that his target ID was messed up ("mission_random_hits_store_mark_first_name"... etc.)
Thanks for the specific explanation. I think this bug might have been in all RH versions, including the legacy version. I think the code never anticipated that you did find the pod after you docked and got the message that you let the target escape. Currently all variables are cleared on that message, while the pod is still drifting through space.

I must, OR remove that pod on that message, OR not clear the variables immediately. :? At least it will be a rare bug. :wink:
DGill
---- E L I T E ----
---- E L I T E ----
Posts: 292
Joined: Thu Jan 01, 2009 9:45 am

Re: Random Hits small prob

Post by DGill »

While testing out oolite-trunk-1.77.0.5577-dev.win32 I noticed the following in the log file:

09:03:37.198 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.4.16): Unknown expansion key [mission_random_hits_striketime] in string.
09:03:37.198 [script.javaScript.warning.ooliteDefined]: ../AddOns/RandomHits1.4.16.oxp/Scripts/oolite-randomHits.js, line 1227.
09:03:37.198 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.4.16): Unbalanced ] in string.
09:03:37.198 [script.javaScript.warning.ooliteDefined]: ../AddOns/RandomHits1.4.16.oxp/Scripts/oolite-randomHits.js, line 1227.
09:03:37.198 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.4.16): Unknown expansion key [mission_random_hits_timer] in string.
09:03:37.198 [script.javaScript.warning.ooliteDefined]: ../AddOns/RandomHits1.4.16.oxp/Scripts/oolite-randomHits.js, line 1227.
09:03:37.198 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.4.16): Unbalanced ] in string.
09:03:37.198 [script.javaScript.warning.ooliteDefined]: ../AddOns/RandomHits1.4.16.oxp/Scripts/oolite-randomHits.js, line 1227.
09:03:37.198 [Random_Hits]: (Hatred : 0. Events Timer : 2. Dockings : 1. Events Number : 0. Special Mission Timer : 2. Revenge Status : KILLED. Time to Strike : [mission_random_hits_striketime]. Revenge Jumps Made : [mission_random_hits_timer]. Special Mission : WAITING. Master Timer : 2. Dice Roll : 97)

Line 1227 has :

log(this.name, expandDescription("(Hatred : [mission_random_hits_criminal_hate_score]. Events Timer : [mission_random_hits_events_timer]. Dockings : [mission_random_hits_dockings_number]. Events Number : [mission_random_hits_events_number]. Special Mission Timer : [mission_random_hits_special_mission_timer]. Revenge Status : [mission_random_hits_revenge]. Time to Strike : [mission_random_hits_striketime]. Revenge Jumps Made : [mission_random_hits_timer]. Special Mission : [mission_random_hits_special_mission]. Master Timer : [mission_random_hits_events_timer]. Dice Roll : [mission_random_hits_events_dice])"));

My save file has values for the above keys except for the [mission_random_hits_striketime] & [mission_random_hits_timer] mentioned in the log.
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: Random Hits small prob

Post by UK_Eliter »

I can't see how old the previous post is (it seems to display only the day and month, not year) but I've got similar problems. Here are entries from my latest log (and I've noticed similar entries before).

Code: Select all

03:17:01.023 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.7): Unknown expansion key [mission_random_hits_striketime] in string.
03:17:01.023 [script.javaScript.stackTrace]:  0 (oolite-randomHits.js:1228) <anonymous function>
03:17:01.023 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.023 [script.javaScript.stackTrace]:     rank: undefined
03:17:01.023 [script.javaScript.stackTrace]:     hate: undefined
03:17:01.023 [script.javaScript.stackTrace]:  1 (oolite-randomHits.js:322) <anonymous function>
03:17:01.023 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.023 [script.javaScript.stackTrace]:     i: undefined
03:17:01.023 [script.javaScript.stackTrace]:     bossCount: undefined
03:17:01.023 [script.javaScript.stackTrace]:     pos: undefined
03:17:01.024 [script.javaScript.stackTrace]:     message: undefined
03:17:01.024 [script.javaScript.stackTrace]:     page: undefined
03:17:01.024 [script.javaScript.stackTrace]:  2 (oolite-randomHits.js:169) <anonymous function>
03:17:01.024 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.024 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.7): Unbalanced ] in string.
03:17:01.024 [script.javaScript.stackTrace]:  0 (oolite-randomHits.js:1228) <anonymous function>
03:17:01.024 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.024 [script.javaScript.stackTrace]:     rank: undefined
03:17:01.024 [script.javaScript.stackTrace]:     hate: undefined
03:17:01.024 [script.javaScript.stackTrace]:  1 (oolite-randomHits.js:322) <anonymous function>
03:17:01.024 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.024 [script.javaScript.stackTrace]:     i: undefined
03:17:01.024 [script.javaScript.stackTrace]:     bossCount: undefined
03:17:01.024 [script.javaScript.stackTrace]:     pos: undefined
03:17:01.024 [script.javaScript.stackTrace]:     message: undefined
03:17:01.024 [script.javaScript.stackTrace]:     page: undefined
03:17:01.024 [script.javaScript.stackTrace]:  2 (oolite-randomHits.js:169) <anonymous function>
03:17:01.024 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.024 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.7): Unknown expansion key [mission_random_hits_timer] in string.
03:17:01.024 [script.javaScript.stackTrace]:  0 (oolite-randomHits.js:1228) <anonymous function>
03:17:01.024 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.024 [script.javaScript.stackTrace]:     rank: undefined
03:17:01.024 [script.javaScript.stackTrace]:     hate: undefined
03:17:01.024 [script.javaScript.stackTrace]:  1 (oolite-randomHits.js:322) <anonymous function>
03:17:01.024 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.024 [script.javaScript.stackTrace]:     i: undefined
03:17:01.024 [script.javaScript.stackTrace]:     bossCount: undefined
03:17:01.024 [script.javaScript.stackTrace]:     pos: undefined
03:17:01.024 [script.javaScript.stackTrace]:     message: undefined
03:17:01.024 [script.javaScript.stackTrace]:     page: undefined
03:17:01.024 [script.javaScript.stackTrace]:  2 (oolite-randomHits.js:169) <anonymous function>
03:17:01.025 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.025 [script.javaScript.warning.ooliteDefined]: ----- JavaScript warning (Random_Hits 1.7): Unbalanced ] in string.
03:17:01.025 [script.javaScript.stackTrace]:  0 (oolite-randomHits.js:1228) <anonymous function>
03:17:01.025 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.025 [script.javaScript.stackTrace]:     rank: undefined
03:17:01.025 [script.javaScript.stackTrace]:     hate: undefined
03:17:01.025 [script.javaScript.stackTrace]:  1 (oolite-randomHits.js:322) <anonymous function>
03:17:01.025 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.025 [script.javaScript.stackTrace]:     i: undefined
03:17:01.025 [script.javaScript.stackTrace]:     bossCount: undefined
03:17:01.025 [script.javaScript.stackTrace]:     pos: undefined
03:17:01.025 [script.javaScript.stackTrace]:     message: undefined
03:17:01.025 [script.javaScript.stackTrace]:     page: undefined
03:17:01.025 [script.javaScript.stackTrace]:  2 (oolite-randomHits.js:169) <anonymous function>
03:17:01.025 [script.javaScript.stackTrace]:     this: [Script "Random_Hits" version 1.7]
03:17:01.025 [Random_Hits]: (Hatred : 0. Events Timer : 2. Dockings : 1. Events Number : 0. Special Mission Timer : 2. Revenge Status : KILLED. Time to Strike : [mission_random_hits_striketime]. Revenge Jumps Made : [mission_random_hits_timer]. Special Mission : WAITING. Master Timer : 2. Dice Roll : 20)
I notice no problems in the game, except perhaps a slowdown when I get very close to a Seedy Spacebar, but something's clearly not right.

I'm running Ooolite 1.77.1 (x86-64 test release) under Windows 6.2.9200,64-bit.

Cheers.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Random Hits small prob

Post by spara »

Thanks for reporting, UK_Eliter. I have a pretty good idea, what's the problem here. I guess that you have dealt succesfully with revenge and in the script "oolite-random-hits-revenge.js" the variables missionVariables.random_hits_timer and missionVariables.random_hits_striketime are nullified. Lines 54 and 55. Then those variables are called for logging purposes in the main script. Nothing fatal luckily. I'll include a fix to the next release, but if you want to fix it early, change those lines to these:
missionVariables.random_hits_timer = 0;
missionVariables.random_hits_striketime = "NOT_NOW";
It won't instantly fix the problem, but it will prevent it from happening again in the future when you have done a hit and dealt with revenge.
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: Random Hits small prob

Post by UK_Eliter »

Thanks Spara!

Is there any way, though, of stopping the problem immediately? (You say your fix, which I've implemented, will not do that.) For these days I don't actually do any 'hits'. (I feel too bad about it! I'm just not that sort of person! :) )
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: Random Hits small prob

Post by spara »

UK_Eliter wrote:
Thanks Spara!

Is there any way, though, of stopping the problem immediately? (You say your fix, which I've implemented, will not do that.) For these days I don't actually do any 'hits'. (I feel too bad about it! I'm just not that sort of person! :) )
Removing mission_random_hits_revenge key and its value from your save file should do the trick.
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1248
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: Random Hits small prob

Post by UK_Eliter »

spara wrote:
UK_Eliter wrote:
Thanks Spara!

Is there any way, though, of stopping the problem immediately? (You say your fix, which I've implemented, will not do that.) For these days I don't actually do any 'hits'. (I feel too bad about it! I'm just not that sort of person! :) )
Removing mission_random_hits_revenge key and its value from your save file should do the trick.
Thanks.
Post Reply