Page 7 of 7

Re: Split: Assassins

Posted: Sat Aug 09, 2014 1:14 pm
by cim
player.roleWeights

Here's an example

Code: Select all

["trader", "trader", "player-unknown", "hunter", "trader", "trader", "player-unknown", "trader-courier+"]
There's not a universal assumed role - each ship picks its own at random from the list when it's spawned (or copies its group leader's, if possible).
Neelix wrote:
I'm curious what it takes to change the assumed role?
Very broadly, actions in accordance with a role will (sometimes) replace one of the entries in the role list. (This will sometimes replace an entry with itself, of course) Travelling to systems you haven't recently visited is likely to set one of the entries back to "player-unknown".

So firing on an asteroid - with a mining laser - will set one of those values to "miner". Keep doing it enough, and other NPCs will start treating you as a miner.

OXPs can both define their own roles (and should usually add them to some of the categories in role-categories.plist if they do) and declare OXP-related actions to be consistent with either their own role or a core role.

Re: Split: Assassins

Posted: Sat Aug 09, 2014 1:32 pm
by spara
cim wrote:
player.roleWeights

Here's an example

Code: Select all

["trader", "trader", "player-unknown", "hunter", "trader", "trader", "player-unknown", "trader-courier+"]
There's not a universal assumed role - each ship picks its own at random from the list when it's spawned (or copies its group leader's, if possible).
Cool. Is it possible to set the role from a script?

Re: Split: Assassins

Posted: Sat Aug 09, 2014 1:37 pm
by Neelix
cim wrote:
There's not a universal assumed role - each ship picks its own at random from the list when it's spawned (or copies its group leader's, if possible).
So is there any mechanism for an NPC to change it's view of your assumed role as it interacts with or observes the player?

- Neelix

Re: Split: Assassins

Posted: Sat Aug 09, 2014 1:46 pm
by cim
player.setPlayerRole to set.
Neelix wrote:
So is there any mechanism for an NPC to change it's view of your assumed role as it interacts with or observes the player?
It's stored in the "playerRole" property of the JS AI controller, which is public and writable.

I've not needed to yet - there are other mechanisms for the NPC to handle the player unexpectedly opening fire on it - but it might be useful for more subtle actions.

Re: Split: Assassins

Posted: Sat Aug 09, 2014 1:53 pm
by spara
cim wrote:
Sorry for being a bit slow here. I thought this sets an entry in the array of player roles, not the assumed role of the player. Have I misunderstood something?
cim wrote:
Neelix wrote:
So is there any mechanism for an NPC to change it's view of your assumed role as it interacts with or observes the player?
It's stored in the "playerRole" property of the JS AI controller, which is public and writable.
This sounds interesting. Have to dig deeper.

Re: Split: Assassins

Posted: Sat Aug 09, 2014 7:00 pm
by Switeck
Not everyone that has an opinion on the subject posts on the right thread, but I feel this is noteworthy to add to the discussion:
https://bb.oolite.space/viewtopic.php?f= ... 50#p225555