Employee experience
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
Employee experience
Is a mod out there that gives employees experience over time (or for e.g. kills)?
If not, here is my idea:
As a first shot, I'd give an employee one more star on each skill after a certain time has passed. The "countdown" starts with his first assignment. The more stars he has, the longer the interval.
Capping the XP gain at 4 stars. The fifth star would have to be gained by seminars.
What do you think of the idea?
How could this be achieved (what files have to be modded, how complex will it be...)?
If not, here is my idea:
As a first shot, I'd give an employee one more star on each skill after a certain time has passed. The "countdown" starts with his first assignment. The more stars he has, the longer the interval.
Capping the XP gain at 4 stars. The fifth star would have to be gained by seminars.
What do you think of the idea?
How could this be achieved (what files have to be modded, how complex will it be...)?
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
hi oliver,
i've been wanting this as well, but haven't yet figured out how to go about it. if it helps, the boarding script does this for adding marine officer experience:
see md\boarding.xml to see how the variables are calculated. was hoping that there would be an event that could be used if a ship is destroyed by a player-owned ship, but there doesn't appear to be one. it could be possible to hook code like that above into the relevant activity scripts: fighting, trading, and so on, and have progress to certain skills increment when relevant activities are done. shouldn't be too hard to do it that way, but maintenance and maintaining compatibility will be a lot of work since you'll have snippets in a lot of the ai scripts.
might be possible to do it via md too, but i have no idea how that could be done.
maybe a generic increment exp function in a library, then have snippets in the various ai scripts just call that generic function?
i've been wanting this as well, but haven't yet figured out how to go about it. if it helps, the boarding script does this for adding marine officer experience:
Code: Select all
<do_if value="$commander.skill.boarding lt 5">
<set_value name="$addedexperience" min="1" max="5" />
<set_value name="$expneededforlvl" exact="$commander.neededexperience"/>
<add_experience_progress entity="$commander" exact="$addedexperience" />
<do_if value="$commander.experienceprogress" min="$expneededforlvl" comment="Make next level-up more difficult to reach">
<add_skill entity="$commander" type="boarding" exact="1" />
<set_value name="stat.max_boarding_skill" exact="$commander.skill.boarding" comment="highest value is stored" />
<set_experience_progress entity="$commander" exact="$commander.experienceprogress % $expneededforlvl" />
</do_if>
</do_if>
might be possible to do it via md too, but i have no idea how that could be done.
maybe a generic increment exp function in a library, then have snippets in the various ai scripts just call that generic function?
-
- Posts: 585
- Joined: Thu, 26. Feb 04, 00:08
-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
Thanks for the suggestions. I'll take a look at the relevant scripts and the mt station logistics asap.
Time seems to be no option then. Is there a count for distance flown by npcs (this would work for ship crews at least)? Seems like counting certain actions (# trades completed) might work though.
Maybe I will do an experimant on only one character class first to get into the topic.
Time seems to be no option then. Is there a count for distance flown by npcs (this would work for ship crews at least)? Seems like counting certain actions (# trades completed) might work though.
Maybe I will do an experimant on only one character class first to get into the topic.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
For time, using player.age might work.
Something like:
Never tried that, though. And I don't know where that could be best hooked into.
edit: maybe coupled with a <find ... /> of some sort followed by something like the code above in a <do_all ... /> loop.
edit 2: in an md script with checkinterval="1800s" ?
Something like:
Code: Select all
<do_if value="not $leveluptime?">
<set_value name="$leveluptime" exact="player.age + 3600s"/>
</do_if>
<do_if value="player.age ge $leveluptime and this.ship.pilot.skill.navigation le 5">
<do_if value="this.ship.pilot.skill.navigation lt 5">
<add_skill entity="this.ship.pilot" type="navigation" exact="1"/>
<remove_value name="$leveluptime"/>
</do_if>
<do_else>
<show_notification caption="'Hey Boss!'" details="'I wanna be trained. Cant get any better without training.'.[]" queued="false" priority="1"/>
<remove_value name="$leveluptime"/>
</do_else>
</do_if>
edit: maybe coupled with a <find ... /> of some sort followed by something like the code above in a <do_all ... /> loop.
edit 2: in an md script with checkinterval="1800s" ?
-
- Posts: 2774
- Joined: Tue, 29. Oct 13, 21:59
Some trivial additions to the ai scripts to count jumps + zone change events maybe for building navigation skill. I much prefer the idea of employees slowly building their skills like marine officers do than some arbitrary bribery scheme.
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
-
- Posts: 2963
- Joined: Tue, 18. Nov 14, 16:23
-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
This looks pretty good to me.
Personally I'd prefer the MD version but i have concerns regarding the game performance if i check all my npcs every 1800s.
Can anyone confirm or discard my concerns?
Going with events seems a nice way to do this. However, i'm not sure if one can do this for all skills/npcs in a similar way.
Implementation and maintainance would be much easier if it works similar for all npcs/skills.
Personally I'd prefer the MD version but i have concerns regarding the game performance if i check all my npcs every 1800s.
Can anyone confirm or discard my concerns?
w.evans wrote:For time, using player.age might work.
Something like:Never tried that, though. And I don't know where that could be best hooked into.Code: Select all
<do_if value="not $leveluptime?"> <set_value name="$leveluptime" exact="player.age + 3600s"/> </do_if> <do_if value="player.age ge $leveluptime and this.ship.pilot.skill.navigation le 5"> <do_if value="this.ship.pilot.skill.navigation lt 5"> <add_skill entity="this.ship.pilot" type="navigation" exact="1"/> <remove_value name="$leveluptime"/> </do_if> <do_else> <show_notification caption="'Hey Boss!'" details="'I wanna be trained. Cant get any better without training.'.[]" queued="false" priority="1"/> <remove_value name="$leveluptime"/> </do_else> </do_if>
edit: maybe coupled with a <find ... /> of some sort followed by something like the code above in a <do_all ... /> loop.
edit 2: in an md script with checkinterval="1800s" ?
Going with events seems a nice way to do this. However, i'm not sure if one can do this for all skills/npcs in a similar way.
Implementation and maintainance would be much easier if it works similar for all npcs/skills.
YorrickVander wrote:Some trivial additions to the ai scripts to count jumps + zone change events maybe for building navigation skill. I much prefer the idea of employees slowly building their skills like marine officers do than some arbitrary bribery scheme.
-
- Posts: 236
- Joined: Mon, 29. Dec 03, 15:22
I had engineers gaining levels for a while in an old mod of the engineer.ai script.
it would be pretty easy to do something for all of them as a library script but you would have to add lines to a lot of scripts to make it work.
for the engineering one i did, I gave the engineer 1 point of progress for each item repaired and like 5 points for restoring something but i think i was giving it too much because it took no time at all for them to reach lvl 5.
I did tie it into the boarding experience attribute that all NPC have (it is only displayed on marine officers but all have it). and then checked if they passed a certain value and if so I would up their level.
maybe you can add the lines to give the various NPC some experience for doing things but you can only use that to track 1 skill for improvement. Captains that use like 3 skills would need to have either have 1 skill improved, or work out some way to improve one skill at a time (or make it randomly improve one of the skills each time).
I have not put a lot of thought into that last idea (improving all three skills but picking only one of the three to improve) but i am pretty sure it is possible to do.
it would be pretty easy to do something for all of them as a library script but you would have to add lines to a lot of scripts to make it work.
for the engineering one i did, I gave the engineer 1 point of progress for each item repaired and like 5 points for restoring something but i think i was giving it too much because it took no time at all for them to reach lvl 5.
I did tie it into the boarding experience attribute that all NPC have (it is only displayed on marine officers but all have it). and then checked if they passed a certain value and if so I would up their level.
maybe you can add the lines to give the various NPC some experience for doing things but you can only use that to track 1 skill for improvement. Captains that use like 3 skills would need to have either have 1 skill improved, or work out some way to improve one skill at a time (or make it randomly improve one of the skills each time).
I have not put a lot of thought into that last idea (improving all three skills but picking only one of the three to improve) but i am pretty sure it is possible to do.
-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
Sounds great! where can i find your script? Maybe i can figure out a generic way based on your work.lubatomy wrote:I had engineers gaining levels for a while in an old mod of the engineer.ai script.
it would be pretty easy to do something for all of them as a library script but you would have to add lines to a lot of scripts to make it work.
for the engineering one i did, I gave the engineer 1 point of progress for each item repaired and like 5 points for restoring something but i think i was giving it too much because it took no time at all for them to reach lvl 5.
I did tie it into the boarding experience attribute that all NPC have (it is only displayed on marine officers but all have it). and then checked if they passed a certain value and if so I would up their level.
maybe you can add the lines to give the various NPC some experience for doing things but you can only use that to track 1 skill for improvement. Captains that use like 3 skills would need to have either have 1 skill improved, or work out some way to improve one skill at a time (or make it randomly improve one of the skills each time).
I have not put a lot of thought into that last idea (improving all three skills but picking only one of the three to improve) but i am pretty sure it is possible to do.
-
- Posts: 236
- Joined: Mon, 29. Dec 03, 15:22
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
if you use events only and dont check values regulary you shouldnt worry about performance for that purpose, because events work like interrupts - only problem is to find fitting events thenoliverjanda wrote:This looks pretty good to me.
Personally I'd prefer the MD version but i have concerns regarding the game performance if i check all my npcs every 1800s.
Can anyone confirm or discard my concerns?

depending on the NPC type also diffrent events are necesary - for the Engineer lubatomys approach is probably the best by directly integrating it into the Code of the Engineer aiscript since there are no repair related events i think, for a DO i think using a <handler /> with <event_object_killed_object object="this.defensible" /> is better since the related code is executed every time the Ship/Station has destroyed something (and i think you can even still get what was destroyed)
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help

-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
Using events or using check intervalls are different approaches. One is complicated and does not hit the performance, the other is simple and probably generic but might hit the performance.
My concerns are based on the econd approach.
I took a quick look at the aiscripts yesterday and (for me) it looks like a mess. I expected an ai_script for each character type...
So I might either to the event-based approach for the enineer or do the intervall approach for all npcs for my first version.
Is there a list oy all my employees somewhere?
Where could I do an intervall check (can i make my own md script)?
My concerns are based on the econd approach.
I took a quick look at the aiscripts yesterday and (for me) it looks like a mess. I expected an ai_script for each character type...
So I might either to the event-based approach for the enineer or do the intervall approach for all npcs for my first version.
Is there a list oy all my employees somewhere?
Where could I do an intervall check (can i make my own md script)?
UniTrader wrote:if you use events only and dont check values regulary you shouldnt worry about performance for that purpose, because events work like interrupts - only problem is to find fitting events thenoliverjanda wrote:This looks pretty good to me.
Personally I'd prefer the MD version but i have concerns regarding the game performance if i check all my npcs every 1800s.
Can anyone confirm or discard my concerns?
depending on the NPC type also diffrent events are necesary - for the Engineer lubatomys approach is probably the best by directly integrating it into the Code of the Engineer aiscript since there are no repair related events i think, for a DO i think using a <handler /> with <event_object_killed_object object="this.defensible" /> is better since the related code is executed every time the Ship/Station has destroyed something (and i think you can even still get what was destroyed)
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
i doubt there is a generic one-size-fits-all-approach for this except you use time as the only factor for promotions.
Also your "the other is simple and probably generic but might hit the performance." may also be far off - you cannt get what kind of Object has been destroyed by an DO of even if he his/destroyed something with polling (at least there is no certain way i know of), thats what the events are for
and no ai-Scripts are more like Actions the NPCs execute, for exampla there is a move.undock which is called from all movement scripts before any other action to make sure the Ship is currently in a valid State for further movement (in free space, not docked or parked)
and since you asked about MD: this one is completely event-driven - you can use it for polling, but thats more complicated than using it as intended. and yes, you can of course make your own
and with this you can get a list with all currently working Player NPC (there may be easier and shorter methods, just writing here what i know works for sure):
and another hint: dont focus too much on using either MD or AIscripts, just use whats better suited for a certain purpose - if necesary there is always a possibility to pass events and values between them 
Also your "the other is simple and probably generic but might hit the performance." may also be far off - you cannt get what kind of Object has been destroyed by an DO of even if he his/destroyed something with polling (at least there is no certain way i know of), thats what the events are for

and no ai-Scripts are more like Actions the NPCs execute, for exampla there is a move.undock which is called from all movement scripts before any other action to make sure the Ship is currently in a valid State for further movement (in free space, not docked or parked)
and since you asked about MD: this one is completely event-driven - you can use it for polling, but thats more complicated than using it as intended. and yes, you can of course make your own

and with this you can get a list with all currently working Player NPC (there may be easier and shorter methods, just writing here what i know works for sure):
Code: Select all
<create_list name="$NPCs" />
<find_object name="$PlayerObjects" multiple="true" owner="faction.player" space="player.galaxy"/>
<do_all exact="$PlayerObjects.count" counter="$i">
<find_object_component name="$tmp" owner="faction.player" object="$PlayerObjects.{$i}" controlentity="true" />
<do_all exact="$tmp" counter="$j" >
<append_to_list list="$NPCs" exact="$tmp.{$j}" />
</do_all>
</do_all>

if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help

-
- Posts: 309
- Joined: Sun, 14. Feb 10, 17:47
@UniTrader
Thanks again!
I actually meant using time as the only aspect for the simple version.
I'll probably go with that approach as a start. It's my first mod from scratch after all.
Better aproaches (e.g. for engineer) might be added later.
The performance concers orginate from the simple approach:
if its Promotiontime -> createNPCList -> go throught list and update one radom skill that is lower than 4
I hope i can get started in the weekend (my time is pretty short atm)
Thanks again!
I actually meant using time as the only aspect for the simple version.
I'll probably go with that approach as a start. It's my first mod from scratch after all.

Better aproaches (e.g. for engineer) might be added later.
The performance concers orginate from the simple approach:
if its Promotiontime -> createNPCList -> go throught list and update one radom skill that is lower than 4
I hope i can get started in the weekend (my time is pretty short atm)