Vectorial1024 / v1024_civilian_fleets

Create civilian fleets to help manage your traders and miners.
https://www.nexusmods.com/x4foundations/mods/335
MIT License
18 stars 10 forks source link

Enforce initial renaming for fresh civilian fleets #25

Closed Vectorial1024 closed 4 years ago

Vectorial1024 commented 4 years ago

Rename the fleet afterwards if you wish to. Ignores the "no-rename" configurable option.

Slow and steady as we enhance this mod.

Vectorial1024 commented 4 years ago

We have a problem here; the mod will endlessly print "Syncing fleet name from Galactic Signal with leader" even though supposedly, no one signaled the cue.

Vectorial1024 commented 4 years ago

Unexpectedly, I found that the values of the Characteristic Symbols were somehow set to 1, which renders the event filtering ineffective.

Vectorial1024 commented 4 years ago

Currently, whenever the Galaxy is signaled to sync fleet orders, the Galaxy is somehow also signaled to update fleet name, which is unintended and unexpected.

Vectorial1024 commented 4 years ago

Unfortunately, I am unable to detect when a new fleet is created at MD level. Even when I insert code at the very top of order.assign.commander, the expression $commander.subordinates.count still returns 1.

We could go deeper into Lua territory, or we could drop this. Seeing that this long investigation yielded something interesting, I'd rather extract the more interesting part, and then drop this.

Vectorial1024 commented 4 years ago

All useful information from here are extracted. Closing this.

Vectorial1024 commented 4 years ago

As we investigate whether this feature is feasible, we learned more about <event_object_signaled/>.

If param is not specified, then whenever object is signaled, the cue is fired. Apparently by supplying param, the game is able to filter signals such that only when the object is signaled with matching param will the cue be triggered.

Still, it doesn't hurt to even check it more carefully with <check_value value="event.param == ..." />, to make sure param really is the parameter we are looking for.