[Mod] Populate Player Stations v1.0.1 (update 4th Aug '14)

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Ok :)

Settings > Controls > Space (in game)

Almost at the bottom there are keybinds marked 'Expert Options Use With Caution'

Bind "Command Line" to an unused key. I use [ on uk keyboard.

back in game, and in space press [ or whatever, type REFRESHMD and ENTER. The game will hitch for a few seconds while it reloads all the /md folder scripts and modded md scripts. Change sector to trigger a refresh of the npcs on player stations. You should see that some are now useable, though the majority still have the default convo bug. Not ideal obviously, but at least a few will be useful until I work out wth is up with it.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
NZ-Wanderer
Posts: 1627
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer »

Ok, did all that, went back to my tech factory and tried talking to some npc's.
out of about 10 I could do stuff with 4.. :)
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth

NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

Getting this problem too.

I noticed that whenever I leave the sector and go back, the list is supposed to refresh but it seems that the number keeps increasing. The first time I got npcs on my station there were like 45. The next time there were 90 or so, then 98. I am wondering if it is not refreshing all of the npcs and some are staying and the ones that stay don't work or something. Or when it gets to a certain number (over some kind of limit) they don't all work. I don't know. maybe if all npcs were removed for sure and then reset, the issue wouldn't happen? Just throwing something out there.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Still working on this one. I haven't been seeing much of the issues on my own saves but mine are station light. Tanoosh's save with 22d play time and a lot of stations and I do see it, so I'm using that one to test ideas. My ISP is playing silly buggers again, hopefully back tonight but it took a few days last time :|

Any suggestions are welcomed as I am stuck on the point that simply generating too many at once (ie game load) is somehow breaking things. This is where i want a proper dev environment with debugging etc ;) Hey ho we work with what we have.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain »

Maybe have a limit on how many npcs spawned?
Strigil
Posts: 10
Joined: Sun, 1. Dec 13, 22:18
x4

Post by Strigil »

One of my intentions with this mod was to set a percentage of spawned npcs. Not very granular but something like 40% traders, 40% ship crew, 20% station crew. I also wanted to have the amount of people added to the station be dependent on how successful the station itself was, with success being determined by the amount of wares the station had stocked or maybe the rate of production (maybe both?).
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Still at a bit of a loss with this bug. Is anyone using this mod without issues concerning default convo on the npcs (ie surrender etc)? With a single station I see no bug at all.

Gonna do a test game with some stations, adding one retesting until i find if or not the bug starts around X player stations in game...
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
Revenat342
Posts: 167
Joined: Mon, 8. Mar 10, 04:30
x3tc

Post by Revenat342 »

I'm getting the "Surrender!" dialogue with all the NPCs on my stations, unfortunately. I unsubbed from the mod in the workshop but this didn't remove the bugged NPCs :/
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

@Yorrick

not really sure if it helps you (justz glanced over the wwhole Topic) but Station Interiors are created & removed on demand as i found out when Adding Faction Logos there - maybe it works when the NPCs are initially created as intended, but somehow bugs out when the Interior is removed and created again and the NPCs are freshly distributed there (and aditionally maybe reset to the default Scripts, too? )
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 ;)
Revenant342
Posts: 225
Joined: Thu, 21. Nov 13, 03:22
x4

Post by Revenant342 »

If it helps, the mod was working fine earlier. No idea what changed.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

UniTrader wrote:@Yorrick

not really sure if it helps you (justz glanced over the wwhole Topic) but Station Interiors are created & removed on demand as i found out when Adding Faction Logos there - maybe it works when the NPCs are initially created as intended, but somehow bugs out when the Interior is removed and created again and the NPCs are freshly distributed there (and aditionally maybe reset to the default Scripts, too? )
Using a pre 2.20 save game Tanoosh sent me, even first load into a zone with player stations can show the default dialog bug. unfortunately I dont have any old saves with a player station of my own and have never seen the bug on my own test games :( Last test changed the npc generation to zone change and player zone only but showed the same issue in older save games. I'm at a loss tbh.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
User avatar
Praefectus classis
Posts: 1505
Joined: Tue, 14. Jan 03, 22:03
x4

Post by Praefectus classis »

I've just installed this mod and I'm getting the "Surrender!" dialogue with the three options too. I started the game and save in version 1.25 and are now currently using 2.20.

I've been looking through the save file and have made a few observations with regards to NPC stations / NPC's on board and player stations / NPC's on board. I'm not sure if it helps but the bit that is missing on the mod-created NPC's is the phrase customconversation="1" in the text line at the bottom of the NPC description. Here are two examples. One is an engineer from an NPC controlled station, the second a NPC engineer from a player-controlled station with your mod:

Code: Select all

<connection connection="npcconnection">
<component class="npc" macro="character_ar_female_dv_a_macro" connection="commandroomslot" name="Alison Choi" owner="canteran" page="10104" id="[0x41a4]">
<skills>
<skill type="boarding" value="1"/>
<skill type="combat" value="1"/>
<skill type="engineering" value="4"/>
<skill type="leadership" value="3"/>
<skill type="management" value="3"/>
<skill type="morale" value="1"/>
<skill type="navigation" value="3"/>
<skill type="science" value="1"/>
</skills>
<entity type="engineer" customconversation="1"/>
<npcseed bodyparts="3094416839" bonescales="3774217265" morphtargetweights="2411239522"/>
<connections/>

<connection connection="npcconnection">
<component class="npc" macro="character_ar_female_dv_a_macro" connection="commandroomslot" name="Elizabeth Chang" owner="canteran" page="10110" id="[0x1e622]">
<skills visible="1">
<skill type="boarding" value="3"/>
<skill type="combat" value="3"/>
<skill type="engineering" value="3"/>
<skill type="leadership" value="3"/>
<skill type="management" value="2"/>
<skill type="morale" value="3"/>
<skill type="navigation" value="2"/>
<skill type="science" value="3"/>
</skills>
<entity type="engineer"/>
<npcseed bodyparts="1161448294" bonescales="3608850122" morphtargetweights="2672015440"/>
<connections/>
The station staff appear to have control="1" added to the line like this:

Code: Select all

<entity type="defencecontrol" control="1" customconversation="1"/>
I haven't refreshed any files yet but I thought the information might help you track down the problem.
Reality is an illusion created by a lack of the X-universe
My new forum My original forum
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Interesting, ty
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz »

So... I was looking at this while avoiding my own problems for a bit. I don't see any problems with the way you're spawning NPCs. It might be possible that they're timing out and their $BaseCue is getting cancelled, but they're not properly getting despawned for some reason because they're on player-owned stations?

If true, it may be why player stations weren't populated at release. It would have been a low-priority bug with everything else needing attention. Just not spawning the problematic NPCs could have been a quick and dirty fix.


Anyway... I don't ~fully~ understand every aspect of conversations and NPC handling, but it's the part of the game that I've spent the most time looking at so far and some of what I've learned may be useful here.

For non-default conversations to work properly, you basically need two things:


1) The NPC needs the custom conversation handler attribute pointed out by Prefectus

This is set in MD script with the expression set_comm_handler
or tested in logic expressions with $actor.customhandler (true/false)


2) The NPC needs to be tied to the relevant NPC_*** script with a cue devoted to managing it that gets pointed to by the actor's $BaseCue parameter.

In the save game, the cue managing the actor will look something like this within the NPC_*** script's saved data:

Code: Select all

<cue id="18021" state="complete" time="10.0111">
<vars>
<value name="$actor" type="component" value="[0x1883a]"/>
<value name="$count" type="integer"/>
<value name="$fee" type="integer" value="98805"/>
</vars>
<cue id="18022" base="1451" state="complete" time="10.0111">
<cue id="18148" base="1452" state="complete" time="10.0111">
<vars>
<value name="$Actor" type="component" value="[0x1883a]"/>
<value name="$BaseCue" type="cue" value="18021"/>
<value name="$KillOnSectorChange" type="integer" value="1"/>
<value name="$MaxDistance" type="length" value="100000"/>
<value name="$MinDistance" type="length" value="20000"/>
<value name="$TimeoutMax" type="time" value="1200"/>
<value name="$TimeoutMin" type="time" value="600"/>
</vars>
<cue id="18205" base="5700" state="waiting"/>
<cue id="18206" base="5701" state="waiting"/>
<cue id="18207" base="5702" state="active" time="10.0111"/>
<cue id="18208" base="5703" state="waiting"/>
</cue>
</cue>
<cue id="18023" base="1455" state="waiting"/>
<cue id="18024" base="1456" state="waiting"/>
<cue id="18025" base="1457" state="waiting"/>
<cue id="18026" base="1458" state="waiting"/>
<cue id="18027" base="1459" state="waiting"/>
<cue id="18028" base="1460" state="waiting"/>
<cue id="18029" base="1461" state="waiting"/>
<cue id="18030" base="1464" state="waiting"/>
<cue id="18031" base="1465" state="waiting"/>
</cue>
Some key lines to notice:

<value name="$actor" type="component" value="[0x1883a]"/>
the value here is the NPC's ID number

<value name="$BaseCue" type="cue" value="18021"/>
the value here points up at the ID of the entire cue handling this actor, so when it gets cancelled at actor timeout the actor's connection to the NPC_*** script gets severed.


These are configured in the first few cues of the \md\NPC_***.xml files, which are all set up to be signaled automatically any time the create_platform_actor expression is used. Poking around, you'll notice they point over to md\GenericMissions.xml which handles (among other things, obviously) the despawning and cleanup of old generic NPCs when they timeout.


So.... revisiting my initial statement, I'm wondering if md.GenericMissions.PlatformActor is cancelling the $BaseCue when the NPC times out (one of it's clean-up operations), but is having trouble reliably deleting the NPC itself on player-owned stations for whatever reason?

If this is the case, then it would explain the accumulation of NPCs with bad comm handlers over time as they fail to properly despawn, and why the problem doesn't appear in fresh test stations.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

I don't think it's a time out - my current test version spawns player station npcs for only the current zone, and only on player zone change event. In 2.20+ games it works fine, in >2.10 started games it fails with the 'surrender' etc. I only have 1 save of my own started pre 2.20 so will test with that to see if I get the same results and if a workaround is possible.

EDIT : The bug is also apparent when loading a game directly into a zone with a player station in < 2.20 started games so it isn't likely to be an npc lifespan timeout.

EDIT 2 : Confirming bug is apparently only in pre 2.20 started games unless anyone can tell me differently and provide a save (if with other mods, please list them too for completeness of testing).
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
SyberSmoke
Posts: 655
Joined: Sat, 11. Feb 12, 04:03
x4

Post by SyberSmoke »

It appears you mod needs a little TLC with 3.0. NPC's will spawn, but they will not spawn in "Empty Space" zones and it appears if you pass through a empty space zone with a station it will prevent stations in other zones from spawning.

I have two stations in ES zones outside lava flow and another station in Lava Flow. The only way I can get NPC's to spawn in LF is to take a ship and jup out of LF and then back into LF. If I exit LF through a highway then come back in all stations are with out NPC's.

The stations in Empty Space are always empty.
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

Noted
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
manpapper
Posts: 61
Joined: Thu, 29. May 14, 11:51
x4

Post by manpapper »

Is this mod still working with 3.10?
User avatar
YorrickVander
Posts: 2774
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander »

If the game was started with v2.20 or later yes, to an extent. There may be issues with the new stations in empty space, yet to test.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.
manpapper
Posts: 61
Joined: Thu, 29. May 14, 11:51
x4

Post by manpapper »

I started mine with 1.00 or 1.10 i don't remember so it will not work?

Return to “X Rebirth - Scripts and Modding”