Page 2 of 3

Re: OK... I [i]have[/i] to talk about this...

Posted: Thu Oct 30, 2008 12:33 am
by nijineko
Simon B wrote:
I was in hyperdrive trying avoid the spacelanes when I was attracted by laser flashes - there's usually a bounty taking out pirates so in I go.

...snippity...

In the end I had managed to splat three small ships, crippled a big one, and got out with my hide and insurance intact. The ship performed so well I made a note to reduce maneuverability a tad... blockade runners are supposed to be about speed.


i don't suppose you thought to take any screenshots? i do understand that you were quite busy at the time. ^^

Posted: Thu Oct 30, 2008 2:01 am
by Simon B
LittleBear wrote:
Have you given your test ship the role "player" in the entry for the player-ship version in shipdata?
Yep.

Code: Select all

		<key>name</key>
		<string>Cobra M4-D</string>
		<key>roles</key>
		<string>player</string>
Just to be on the safe side - I should try it out with a canon ship.
You must also make a kill NOT cloaked.
Yep - not cloaked.

On the second attempt I found myself following another hunter right to the target system... I thought: "that's clever" - blew him away first.
Could you check it in a standard ship, as I haven't had anyone report that fault and it was working for my commander in a Chopped Cobra, so could be somthing with the test ship you are flying. :?
Sounds ike the next step - stay tuned.

Posted: Thu Oct 30, 2008 3:18 am
by Simon B
Confirmed - tried it in a cobra mk3, and the kill did not get assigned to me.

That's a shame, I was hoping it was some sort of feature where other hunters would steal the kills of the newcomers - eventually one would have to find them and settle the score.

Posted: Thu Oct 30, 2008 8:57 am
by LittleBear
That's stange. I'm being credited with the kills on my system. Could you try the 1.3 version? What ship is the victim flying, so I can check I haven't messed up a script. (Each ship has a different script, so I could be one bad script thats causing this.)

It is a stort of feature that other hunters can steal a kill. Whats meant to happen is the JS script records who was the last ship to hit the victim with a laser or missile before he died. If the answer is "player" its credited as a player kill. If any other role its an NPC. I'm really stuck by this as nobody else has hit this and I can't reproduce it either! This is the JS. It's working for me at any rate! :-

Code: Select all

/*
this.name = "oolite-random-hits-mark2";
this.author = "LittleBear";
this.copyright = "September 2008 - But do what you like with it in your OXPs!";
this.description	= "Tests who destroyed a RandomHits OXP Victim Ship and how they did it. The main script acts on the setting of variables."
this.version = "2.0";
*/

this.shipSpawned = function ()
{
	if(this.ship.shipDisplayName == this.ship.shipDescription)
        this.ship.shipDisplayName = expandDescription("[random_hits_main_name]") // Show the Victim's name on the ID Computer when targeted.
	  delete this.shipSpawned;
}

this.shipBeingAttacked = function(whom)
{
    if(whom == player)
    {
      missionVariables.random_hits_whoshot = "PLAYER_ATTACK" // Shooter was the player not using an e-bomb, q-mine or cloak. The variable remains undefined if the player e-bombs, q-mines or kills the victim whilst cloaked as thisBeingAttacked does not get run. The main script then awards the player the credit for the kill, but fines him for dishonerable conduct!
    }
    else
    {
     missionVariables.random_hits_whoshot = "NPC_ATTACK" // Shooter was NPC ship. Every time the victim is hit, the variable is reset. Once he's dead the variable is not longer reset. So the last ship to hit him was also the killer!
    }
}

this.shipDied = function(whom)
{

	    if(whom == player)
	    if(missionVariables.random_hits_whoshot == "NPC_ATTACK") // Player has finished off a Mark attacked by an NPC with an e-bomb.
	{
		missionVariables.random_hits_status = "KILLED" // Record the fact that the Victim's ship has been destroyed.
		missionVariables.random_hits_whoshot = null // Reset the attack variable to treat this as a dishonerable player kill.
		return;
	}

	    if(whom == player)
	    if(missionVariables.random_hits_whoshot == null) // Player has e-bombed the Victim's Ship.
	{
		missionVariables.random_hits_status = "KILLED" // Record the fact that the Victim's ship has been destroyed.
		return;
	}


	    if(whom == player) //If the killer was the player...
	    if(missionVariables.random_hits_whoshot == "PLAYER_ATTACK") //... And he didn't use an e-bomb ... 
	    if(Math.random() < 0.35) // Chance of Victim making it to his pod.
	{
		missionVariables.random_hits_status = "PODED" // Victim made it to his Pod! Set the variable to reflect that the player still needs to kill or scoop the Pod!
		this.ship.spawn("random_hits_pod1", 1); // Spawn a Pod. Any shooting or scooping of the Pod is handled by the Pod's own Script.
		return;

	}

	    if(whom == player) //If the killer was the player and no pod was launched ...
	    if(missionVariables.random_hits_whoshot == "PLAYER_ATTACK") //... And he didn't use an e-bomb ... 
	    if(Math.random() < 0.20) // Chance of Victim dropping a q-mine.
	{	
		this.ship.spawn("RANDOM_HITS_MINE", 1); // Spawn a Q-Mine which taunts the player before exploding! Nasty!
		missionVariables.random_hits_status = "KILLED" // Record the fact that the Victim's ship has been destroyed.
		return;
	}
	    if(whom == player) //If the killer was the player and neither a pod nor q-mine was launched ...
	    if(missionVariables.random_hits_whoshot == "PLAYER_ATTACK") //... And he didn't use an e-bomb ...
	{	
		missionVariables.random_hits_status = "KILLED" // Record the fact that the Victim's ship has been destroyed.
	   	return;	
	}
	    if(missionVariables.random_hits_whoshot == "NPC_ATTACK") // If an NPC fired the fatal shot ...
	{	
		missionVariables.random_hits_status = "KILLED" // Record the fact that the Victim's ship has been destroyed.
	   	return;	
	}

	else // Deals with any other situation where cause of death was neither the player nor an NPC Laser. EG: Victim did somthing silly like crashing, burnt up near the Sun or some other odd death!
	{	
		missionVariables.random_hits_status = "KILLED" // Record the fact that the Ship has died!
		missionVariables.random_hits_whoshot = "ACCIDENT" // Any non-player / non-NPC caused death is an accident.
	}
 
	
}
If you are getting a message like "Captain Brown has been eliminated by a competing killer for hire." then the variable is at NPC_ATATCK for some reason. This should only be the case of an NPC fired the fatal shot.

Posted: Thu Oct 30, 2008 7:39 pm
by Simon B
Oh yeah - it's much more likely to be something I've done than something in random hits.

I've seen this now with three different targets and two PCs.
But it's only me.

I think I'll have to set a jameson up with something I absolutely have not fiddled in the slightest - afaik I've only changed the cobra3 model - and go. I'll add oldships so I get those models and use an iguana. I take it this is known to work with the oldships oxp?

There is a possibility that there is a conflict with another oxp or another oxp needed which has gone unnoticed. With my <irony>copious experience and skill</irony> I have not seen it.

Posted: Thu Oct 30, 2008 7:46 pm
by LittleBear
:lol: . Trouble is I can't think of anything that you could have done with your ship (or to your commander for that matter) that would cause this! To be doubley safe, could you delete Random Hits completeley and install V1.3 rather than doing an overwrite? BTW when you meet victims are they sending you comms messages? In their AI they look for a ship with the role player and then send that ship a Comms message. If they're not, it would indicate that you are not being regarded as the player for some reason. For some reason although the RH script seems to be run, either Random Hits or Oolite itself is treating you as an NPC rather than the player! :shock: Really can't figure out why it's doing that.

EDIT :- Could you also check your save file and post what the value the random hits variables are reading?

EDIT AGAIN : Are you on Oolite 1.71.2? I know RH won't work properly on a lower version and I haven't tested it on the 1.72 test release of Oolite.

Posted: Fri Oct 31, 2008 1:14 am
by Simon B
LittleBear wrote:
:lol: . Trouble is I can't think of anything that you could have done with your ship (or to your commander for that matter) that would cause this! To be doubley safe, could you delete Random Hits completeley and install V1.3 rather than doing an overwrite? BTW when you meet victims are they sending you comms messages?
Yes they are. I usually get the comms before I have a scan lock.

EDIT :- Could you also check your save file and post what the value the random hits variables are reading?
[/quote]

Code: Select all

    <key>mission_variables</key>
    <dict>
	<key>Random_Hits</key>
	<string>Rub out Sergeant Weston flying an antique Adder at Rabedira.</string>
	<key>mission_escape_pod_yes</key>
	<string>YES</string>
	<key>mission_random_hits_mark_galaxy</key>
	<string>0</string>
	<key>mission_random_hits_planetnumber</key>
	<string>6</string>
	<key>mission_random_hits_playername</key>
	<string>Eionik</string>
	<key>mission_random_hits_playertitle</key>
	<string>Outsider</string>
	<key>mission_random_hits_score</key>
	<string>0</string>
	<key>mission_random_hits_shipname</key>
	<string>Arachnid "Katipo"</string>
	<key>mission_random_hits_status</key>
	<string>RUNNING</string>
	<key>mission_random_hits_store_assassination_board_address1</key>
	<string>Personal Link :</string>
	<key>mission_random_hits_store_assassination_board_address2</key>
	<string>office.ugk.universe</string>
	<key>mission_random_hits_store_assassination_board_job_name</key>
	<string>obliteration</string>
	<key>mission_random_hits_store_assassination_board_part1</key>
	<string>Nullifier urgently sought to end this vagabond&apos;s life.</string>
	<key>mission_random_hits_store_assassination_board_part2</key>
	<string>and warlike office junior at Salient Enterprises</string>
	<key>mission_random_hits_store_assassination_board_part3</key>
	<string>The shameful rascal, flying</string>
	<key>mission_random_hits_store_assassination_board_part4</key>
	<string>is no longer required in the</string>
	<key>mission_random_hits_store_assassination_board_part5</key>
	<string>The reasonable fee of</string>
	<key>mission_random_hits_store_assassination_board_part6</key>
	<string>will be paid upon</string>
	<key>mission_random_hits_store_assassination_board_part7</key>
	<string>falling prey to terminally unhealthy circumstances.</string>
	<key>mission_random_hits_store_assassination_board_poster_name</key>
	<string>Neilplus</string>
	<key>mission_random_hits_store_assassination_board_poster_system</key>
	<string>Esgeer</string>
	<key>mission_random_hits_store_assassination_board_poster_title</key>
	<string>Yogi</string>
	<key>mission_random_hits_store_assassination_board_subject</key>
	<string>Termination with Extreme Prejudice.</string>
	<key>mission_random_hits_store_mark_fee</key>
	<string>550</string>
	<key>mission_random_hits_store_mark_first_name</key>
	<string>Sergeant</string>
	<key>mission_random_hits_store_mark_gender</key>
	<string>his</string>
	<key>mission_random_hits_store_mark_nick_name</key>
	<string>&apos;Number Cruncher&apos;</string>
	<key>mission_random_hits_store_mark_race_part1</key>
	<string>a nerdy iridescent</string>
	<key>mission_random_hits_store_mark_race_part2</key>
	<string>actor</string>
	<key>mission_random_hits_store_mark_second_name</key>
	<string>Weston</string>
	<key>mission_random_hits_store_mark_ship</key>
	<string>Adder</string>
	<key>mission_random_hits_store_mark_ship_description</key>
	<string>an antique</string>
	<key>mission_random_hits_store_mark_system</key>
	<string>Rabedira</string>
	<key>mission_random_hits_store_showship</key>
	<string>random_hits_mark_adder</string>
	<key>mission_random_hits_store_skill</key>
	<string>1</string>
	<key>mission_trumbles</key>
	<string>NOT_NOW</string>
    </dict>

Hmm... according to this, it's still running. I'll go finish it off then look again.

EDIT AGAIN : Are you on Oolite 1.71.2? I know RH won't work properly on a lower version and I haven't tested it on the 1.72 test release of Oolite.
Ah... I seem to have 1.72 here ...

Posted: Fri Oct 31, 2008 2:27 am
by Simon B
Yes - it happened again...
Here's the comms traffic:
<string>Rabedira 2084151:11:32:23</string>
<string>Adder (Marked for Death):</string>
<string> You&apos;ll wish you never accepted this killing!</string>
<string>Adder (Marked for Death):</string>
<string> Cease fire! Whatever Yogi Neilplus is paying you I&apos;ll double it!</string>
Here's the mission:

<key>mission_variables</key>
<dict>
<key>Random_Hits</key>
<string>The Society of Bounty Hunters regard you as a harmless Outsider.</string>
<key>mission_escape_pod_yes</key>
<string>YES</string>
<key>mission_random_hits_addmark</key>
<string>TRUE</string>
<key>mission_random_hits_playername</key>
<string>Eionik</string>
<key>mission_random_hits_playertitle</key>
<string>Outsider</string>
<key>mission_random_hits_score</key>
<string>0</string>
<key>mission_random_hits_shipname</key>
<string>Arachnid "Katipo"</string>
<key>mission_trumbles</key>
<string>NOT_NOW</string>
</dict>
He ejected - I shot the escape pod with an ecm hardened missile.

Now to locate v1.3

Posted: Fri Oct 31, 2008 7:55 am
by Commander McLane
Simon B wrote:
LittleBear wrote:
Are you on Oolite 1.71.2? I know RH won't work properly on a lower version and I haven't tested it on the 1.72 test release of Oolite.
Ah... I seem to have 1.72 here ...
Well, then this may well be the culprit.

Simon, there is no 1.72-release of Oolite yet. The current version is 1.71.2. What you have built yourself is the current trunk, which one day (in a different shape from what you have built yourself, because it is worked upon daily and probably by the hour) will see the light of the world under the name '1.72'.

The point is that there are some significant changes in the scripting system in the making between 1.71.2 and the trunk (see wiki and the relevant development threads here on the board for details). So it cannot be expected that any code that was scripted for 1.71.2 or lower will work in the trunk version.

Posted: Fri Oct 31, 2008 8:03 am
by LittleBear
Hmm. It could be that Oolite's "whom" function is broken on 1.72. As I don't know how to build from source I haven't tried out 1.72 yet. The OXP sets the variable with:-

Code: Select all

this.shipBeingAttacked = function(whom) 
Only in the case of the whom == player will a player kill be recognised. In any other eventuality (with the else command) its set to an NPC kill. If somthing is up with the whom function then the else bit will always get run.

Posted: Fri Oct 31, 2008 10:51 am
by Simon B
All right - do I have to hunt down through threads to locate the changes?

Posted: Fri Oct 31, 2008 11:02 am
by LittleBear
Not sure its documented (could try the Wiki). The test build is the bleeding edge. which the Devs are still fiddling with. It might be the name of a command has been changed so a script thats fine on 1.71.2 is no good on 1.72. Or it could just be a bug in the test build. A_C or A might be able to help.

Posted: Fri Oct 31, 2008 11:05 am
by Commander McLane
Simon B wrote:
All right - do I have to hunt down through threads to locate the changes?
I would rather suggest you start with the wiki-page that was created exclusively for this purpose. (Amazing, isn't it? :wink: )

By the way: Anything that is listed on the Category:Oolite_scripting index is extremely useful if you are, well, scripting. So personally I have this page opened in one browser-window all the time, for easy access to anything scripting-related. (The same goes for the Category:Oolite index, for anything generally Oolite-related.)

Posted: Fri Oct 31, 2008 1:24 pm
by JensAyton
Commander McLane wrote:
Simon, there is no 1.72-release of Oolite yet. The current version is 1.71.2. What you have built yourself is the current trunk, which one day (in a different shape from what you have built yourself, because it is worked upon daily and probably by the hour)
If only…

Posted: Sat Nov 01, 2008 12:12 am
by Simon B
Ahruman wrote:
Commander McLane wrote:
Simon, there is no 1.72-release of Oolite yet. The current version is 1.71.2. What you have built yourself is the current trunk, which one day (in a different shape from what you have built yourself, because it is worked upon daily and probably by the hour)
If only…
We-ell, if you would like it changed hourly, I can do that...

hmmm... wonder what would happen if I scooped the capsule?