[Investigation] Can't shoot missiles / guns firing on their own - modded games

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

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

w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans » Mon, 16. Mar 15, 19:34

UniTrader wrote:---> if yes: how did you do that?
That would be very interesting if someone managed to do that. Would also help narrowing down cause.

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Mon, 16. Mar 15, 19:51

I've just found what I did this afternooon.

Code: Select all

<start_script name="'fight.defend.capital'" object="player.primaryship.controlentity"/>
Can't shoot, missiles fire automatically, gun fires if I turn the camera toward the target, and can't deactivate autopilot once activated it seems.

I guess adding a check in that script and returning might fix the issue.

I also noticed that upon uninstallation Automated Emergency Jump might start 'player.default' on 'player.primaryship.controlentity' (wasn't intentional of course). But it does absolutely nothing apparently, and it's been like that since a few months already.

HunZolka
Posts: 108
Joined: Fri, 5. Jun 09, 08:29
x4

Auto firing weapons - bug?

Post by HunZolka » Tue, 17. Mar 15, 18:12

Hi, I'm having a bit of a problem with my weapons.
During fighting (not sure if automatically, or because of pressing some keys) the AI takes over the handling of the Skunk's weapons. I can no longer fire manually, the ship just picks a target and fires on it when I turn the ship toward that target.

As for which target to shoot, the ship ignores my target of choice.

The ship also fires missiles automatically.

When this takeover happens, I can't fire the weapons until I leave the zone, it seems.

I haven't been able to figure out for sure what triggers it, and what turns it off.

Anyone knows what this is, or how to disable it? It completely ruins the fighting aspect of the game.

<This thread merged from Tech Sp. Alan Phipps>

HunZolka
Posts: 108
Joined: Fri, 5. Jun 09, 08:29
x4

Post by HunZolka » Tue, 17. Mar 15, 18:28

I just ran into the very same issue, with a similarly modded game. Reading this
<start_script name="'fight.defend.capital'" object="player.primaryship.controlentity"/>

post, I just remembered that the problem first appeared when I got into a fight with my Taranis aiding me.

Where is this script call?

BTW my mod list, all from Steam Workshop:

Automated Emergency Jump
Boarding Plus
Buy Trade Subscription
Capital Ship Bridge
ISE Balanced Edition
Long Range Scanner Update
Mission Computer
More Crew
Out of My Way, Glitches!
Show Balance
Show Me Your Faction, Please
Show Skills
Station Announcements
Yet Another Trader v1.2

Edit:
Ah I checked the files and get it now, it was indeed a logical issue in the Automated Emergency Jump's code.

It wasn't obvious to me what exactly the comment before mine meant...

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Tue, 17. Mar 15, 21:46

HunZolka wrote:Edit:
Ah I checked the files and get it now, it was indeed a logical issue in the Automated Emergency Jump's code.

It wasn't obvious to me what exactly the comment before mine meant...
The code I copied doesn't come from AEJ, it's just some test I did a few days ago.

AEJ does indeed start a script on "player.primaryship.controlentity" after an uninstallation or some updates, but a different one ("player.default"). This is because I assumed the player ship to not have a controlentity. However, it doesn't seem to cause any trouble (I will certainly fix that for the next version though).

Here's the only part of the code where I deal with "fight.defend.capital":

Code: Select all

<find_ship name="$ships" multiple="true" recursive="true" space="player.galaxy"/>
<do_all exact="$ships.count" counter="$i">
  <do_if value="$ships.{$i}.controlentity != null">
    <do_if value="$ships.{$i}.isjobship">
      <!-- job ship, destroy it and let it respawn naturally -->
      <!-- couldn't find any way to resume their scripts properly -->
      <destroy_object object="$ships.{$i}"/>
      <continue/>
    </do_if>
    <do_elseif value="$ships.{$i}.owner == faction.player">
      <do_if value="$ships.{$i}.commander != null and $ships.{$i}.commander != player.primaryship">
        <!-- player owned ship with a non-player commander, start a script chosen by AssignToCommander -->
        <signal_cue_instantly cue="RestartSubordinateScript" param="$ships.{$i}.controlentity"/>
        <signal_objects object="$ships.{$i}.controlentity" param="'AEJ_RestartSubordinateScript'"/>
      </do_if>
      <do_else>
        <!-- player owned ship without commander or with player commander -->
        <start_script object="$ships.{$i}.controlentity" name="'player.default'"/>
      </do_else>
    </do_elseif>
    <do_else>
      <!-- some stuff might be done here -->
      <continue/>
    </do_else>
  </do_if>
  <!-- currently only done for player owned ships since other ships are simply removed from the universe -->
  <do_if value="$ships.{$i}.defencenpc != null">
    <do_if value="$ships.{$i}.isjobship or ($ships.{$i}.owner == faction.player)">
      <start_script object="$ships.{$i}.defencenpc" name="'fight.defend.capital'"/>
      <!-- let's remove those values here for now, as 'AEJ.jump' might not (not a bug) -->
      <remove_value name="$ships.{$i}.defencenpc.$AEJ_dps"/>
      <remove_value name="$ships.{$i}.defencenpc.$AEJ_health"/>
      <remove_value name="$ships.{$i}.defencenpc.$AEJ_timestamp"/>
    </do_if>
  </do_if>
</do_all>
If for some reason a defence officer is added to the player ship by another mod (I don't even know if that's possible), an uninstallation or update of AEJ might cause that issue though.

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Tue, 17. Mar 15, 22:26

Here's a potential and non-tested fix.

It simply return if the ship of the entity that runs the script is the player ship. No sure if those returns are well placed or if it's even enough, but it's worth a try.

http://s000.tinyupload.com/index.php?fi ... 9760010679 (edit: does not work)

Load, trigger a fight, wait a few seconds, save, remove.

If it works please put it in the original post :p
Last edited by bm01 on Wed, 18. Mar 15, 11:53, edited 4 times in total.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Tue, 17. Mar 15, 22:30

bm01 wrote:If for some reason a defence officer is added to the player ship by another mod (I don't even know if that's possible), an uninstallation or update of AEJ might cause that issue though.
the Skunk Turret Mod creates one because he is necesary for the Turret to work. Thats why i asked for this Mod.
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 ;)

t-square
Posts: 2
Joined: Sat, 21. Sep 13, 00:00
x4

Post by t-square » Tue, 17. Mar 15, 23:50

Just want to add that it's the emergency auto-jump mod that's causing it for me. I don't know, however, if it's interfering w/ the base game or other mods:

Show Skills
TAF!
Awesome Jumpdrive SFX
Station Announcements
More Crew

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Tue, 17. Mar 15, 23:58

To be more accurate it's a combination of mods.
Also, please read the previous posts and try the fix.

HunZolka
Posts: 108
Joined: Fri, 5. Jun 09, 08:29
x4

Post by HunZolka » Wed, 18. Mar 15, 09:39

http://s000.tinyupload.com/index.php?fi ... 9760010679

Eset: access to page denied, on the list of harmful websites

wtf?

BTW I haven't checked out the fix, but for now disabling the AEJ seems to have fixed the issue.
By logic issue in the code I was just guessing, 'cause I barely understand these codes, just thinking that an automated defence script is called to control the player ship when it is attacked.

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Wed, 18. Mar 15, 10:41

There's no way that removing AEJ would fix this. At best it fixed it by making your save somewhat incompatible with your game. This is why I ask people to use the uninstall function, even though that function is quite aggressive.


Anyway I have some info.

I edited the save in the first post and tried a few things, there's indeed somekind of defence officer that runs "fight.defend.capital", but removing it doesn't solve anything (actually it's not a defence officer, "player.primaryship.defendnpc" returns null, but whatever).

However, there's also a control entity that runs "move.patrol". Killing it solves the issue the OP has. Stopping its running script works too (I actually have no idea how to kill it and I'm not sure if I should).

AEJ might have started "player.default" on the control entity of the playership, but I tested again and this doesn't cause any issue. I have no idea where that "move.patrol" comes from, but I can fairly assume that AEJ doesn't have anything to do with it.

Here's a working fix: http://s000.tinyupload.com/index.php?fi ... 3838832821
It might not clean up everything like it should, but it seems enough.

Edit after 5 days: Funny enough, that fix hasn't be downloaded even once. Clearly didn't worth the time I've spent trying to figure out what was going on and attempting to fix something my mod didn't even cause. Nice waste of time.

HunZolka
Posts: 108
Joined: Fri, 5. Jun 09, 08:29
x4

Post by HunZolka » Fri, 20. Mar 15, 20:06

Hey, sorry I didn't update, but I didn't want to write anything until I had some idea of how the game actually behaves with the various mods installed, plus there were other circumstances, too.

Disabling/enabling mods, reloading the game eventually made the problem disappear, at one point when the AEJ was disabled. After that, I enabled the AEJ again, and I could play for several hours/days without the problem resurfacing, that's why I didn't check the fix you uploaded (plus, my computer's ESET Smart Security kept blocking the download page, so I thought if the game was working properly why would I press the matter).
I installed an instance of the

Captain and defence officer AI overhaul,

and the problem kept coming back again in various forms. It makes the case more confusing, that this mod wasn't even present when the issue first appeared.

Anyways, now I checked the fix, and it DID stop the problem.

An another thing came up though. Apparently the AEJ doesn't work together with the Captain and defence officer AI overhaul mod. When the latter is enabled, the ships won't execute emergency jumps. Only in one case did I see it happen, when I kept disabling/enabling these mods and test how the game works with various combinations, there was one moment when both were enabled, and in a battle my cap ship reported that it executes an emergency jump, but eventually it remained in place, and afterwards it was in an 'Undocking' state until it was destroyed.

So there is no absolute conclusion to which mod confused AEJ in the first place, and under what circumstances it is willing to work properly, but the initial problem that this thread is about seems to have disappeared by using your fix.

Edit:
Further update:
Now with Captain and defence officer AI overhaul disabled, I can see AI ships making emergency jumps, but for some reason my ships (most of the time) don't jump when the shield/health treshold is reached. When during the fight I tell them to follow me again, they first go into 'Calculating parameters', and then make the jump to another sector, or they act like they did a jump, but they actually remain in the same position, and keep reporting in again-and-again, like they just finished orders and were waiting for instructions (they are in 'Wait' stance during this)

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Fri, 20. Mar 15, 21:30

HunZolka wrote:Anyways, now I checked the fix, and it DID stop the problem.
Glad to hear that. Sorry for my impatience.
It doesn't solve the problem at the source though, I still don't know which mod or which combination of mod caused that, and it might happen again.
HunZolka wrote:An another thing came up though. Apparently the AEJ doesn't work together with the Captain and defence officer AI overhaul mod. When the latter is enabled, the ships won't execute emergency jumps. Only in one case did I see it happen, when I kept disabling/enabling these mods and test how the game works with various combinations, there was one moment when both were enabled, and in a battle my cap ship reported that it executes an emergency jump, but eventually it remained in place, and afterwards it was in an 'Undocking' state until it was destroyed.
Indeed, they weren't compatible originally, but now that AEJ no longer modifies "fight.attack.object.capital" they might be... ? I actually don't know.
HunZolka wrote:Edit:
Further update:
Now with Captain and defence officer AI overhaul disabled, I can see AI ships making emergency jumps, but for some reason my ships (most of the time) don't jump when the shield/health treshold is reached. When during the fight I tell them to follow me again, they first go into 'Calculating parameters', and then make the jump to another sector, or they act like they did a jump, but they actually remain in the same position, and keep reporting in again-and-again, like they just finished orders and were waiting for instructions (they are in 'Wait' stance during this)
I've seen this happening once, on a xenon ship, it reported like 20 times and eventually died. I don't know what's causing this yet, but that's probably just an AEJ bug. I guess the position and jump destination were reported as being the same?

maslitti
Posts: 2
Joined: Tue, 15. Aug 06, 18:39
x3

Post by maslitti » Sat, 21. Mar 15, 13:46

Hi bm01, facing the same problems like others i tried to uninstalling the emergency jump mode, but i can't save the game during the uninstall, so i downloaded the fix below: just one question: where sould i cpoy/paste the files (totally new to this things). Thank you!!!

Here's a working fix: http://s000.tinyupload.com/index.php?fi ... 3838832821

HunZolka
Posts: 108
Joined: Fri, 5. Jun 09, 08:29
x4

Post by HunZolka » Sat, 21. Mar 15, 16:23

Unpack the file's content into your
...\Steam\SteamApps\common\X Rebirth\extensions
folder, like it was a stand alone mod.

bm01
Posts: 421
Joined: Wed, 22. Jul 09, 22:31
x4

Post by bm01 » Sat, 21. Mar 15, 18:28

maslitti wrote:Hi bm01, facing the same problems like others i tried to uninstalling the emergency jump mode, but i can't save the game during the uninstall, so i downloaded the fix below: just one question: where sould i cpoy/paste the files (totally new to this things). Thank you!!!

Here's a working fix: http://s000.tinyupload.com/index.php?fi ... 3838832821
Removing all mod and using the uninstall function won't help unfortunately, only the fix can stop scripts from running on the player ship. I don't know why you weren't able to save though, but if a conversation starts before the menu is opened it might prevent you from saving.

Anyway, like HunZolka said, unpack it (if you can't, download 7zip, a pretty cool file archiver) and put the folder in your extension folder. Removing it latter is completely safe.

maslitti
Posts: 2
Joined: Tue, 15. Aug 06, 18:39
x3

Post by maslitti » Sat, 21. Mar 15, 22:01

Thank you very much,HunZolka and Bm01! i will tell you soon if i fixed this annoying issue! cheers

HunZolka
Posts: 108
Joined: Fri, 5. Jun 09, 08:29
x4

Post by HunZolka » Sun, 22. Mar 15, 12:12

You might also need to dock somewhere, save, load save again to see mod changes....

Post Reply

Return to “X Rebirth - Scripts and Modding”