[SCRIPT][AP][TC] Advanced Fight Scripts - v. 3.1, 19.01.2014

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 » Sun, 19. Jan 14, 10:46

Update! V. 3.1:
Added:
- "Reset to defaults" Button to menu

Bugfixes:
- Fixed settings reverting to default every startup

Yeah, that was a pretty dumb mistake ;)

Guest

Post by Guest » Sun, 19. Jan 14, 11:17

... R those scripts compatible with Xtended 2.2 ??

Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 » Sun, 19. Jan 14, 11:37

JonfersonSDD wrote:... R those scripts compatible with Xtended 2.2 ??
I am not sure. There should be no incompatibility per se. You would have to look through Xtended's script folder and see if the mod overwrites any of the vanilla scripts that I use too.

If it doesn't, my scripts should work.

User avatar
Torpor
Posts: 692
Joined: Thu, 24. Jan 08, 14:45
x4

Post by Torpor » Sun, 19. Jan 14, 17:35

loaded 3.1 but atm i cant test. my tships is in havy modding process and for a few days perfectly imbalanced ;D

will give u feedback after modding ;D
Wir sind ***Modified***. Ergeben Sie sich.
Wir werden ihre technologischen und kulturellen Aspekte den unseren hinzufügen.
Widerstand ist zwecklos.

please excuse my bad english. no native speaker, but german forum is dying ;P

Argon Destroyer
Posts: 86
Joined: Wed, 11. Jan 06, 20:32
x3tc

Post by Argon Destroyer » Sun, 19. Jan 14, 18:02

Hi! Can you make please .spk packages? They are much better in installing :D
I like Running!

User avatar
Torpor
Posts: 692
Joined: Thu, 24. Jan 08, 14:45
x4

Post by Torpor » Sun, 19. Jan 14, 18:04

Argon Destroyer wrote:Hi! Can you make please .spk packages? They are much better in installing :D
get a spk creator and do it yourself^^
Wir sind ***Modified***. Ergeben Sie sich.
Wir werden ihre technologischen und kulturellen Aspekte den unseren hinzufügen.
Widerstand ist zwecklos.

please excuse my bad english. no native speaker, but german forum is dying ;P

Argon Destroyer
Posts: 86
Joined: Wed, 11. Jan 06, 20:32
x3tc

Post by Argon Destroyer » Sun, 19. Jan 14, 18:11

Every day i recreate packages, delete all, then install AF, MS(Gazz),AF comp.patch. Updates are good, but so often) At least version that i could package without and install without necessary to delete 3 packages and reinstall them. But thats just wishlist) Keep good work!
I like Running!

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 19. Jan 14, 19:31

Argon Destroyer wrote:spk packages? They are much better in installing
Archives install exactly the same way as .spk's. Use the "Install Archive" button in Plugin Manager.
  • Fine Print Department: Of course, the archive must be packaged in standard format with t and scripts folders, as required.

Cronos988
Posts: 691
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 » Fri, 7. Feb 14, 08:01

So, after I took a bit of a break from scripting, are there any bug reports for v. 3.1? How is the script running for everyone?

Viliae
Posts: 140
Joined: Tue, 12. Apr 11, 22:12
x3tc

Post by Viliae » Fri, 7. Feb 14, 11:00

Hello

Wonderful work as always. I saw you did something to beam weapons - now they work as they should be (maybe not so efficient like in player hands - constant beam - but still... A.K.A. wonderful laser show :D).
I have found, probably, a bug, but I can't confirm it - because my XRM game became so instable that I need to erase it completely. This bug I saw only in XRM - capital ships was ramming at each other - not all and not everywhere but only in fights 1vs1, or during attack on station and only in pretty much empty sectors like Segaris, Avarice, Vali (sector added by vukicas Lost Colony.

Ohh almost forgot: I'm using script on all ships with Capital AI "On".

User avatar
MegaJohnny
Posts: 2195
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny » Sat, 15. Mar 14, 01:59

This is an amazing mod! I had a try of it a while ago, and I was totally surprised by how much more scary even the smallest ships are. It's really interesting how a new AI can throw all the combat balancing into question.

Anyway, that was before the new year, and I've decided to start another playthrough and this is going to be one of my must-have mods - I'll let you know if anything goes wrong with 3.1.

builder680
Posts: 1315
Joined: Mon, 14. Feb 11, 03:58
x4

Post by builder680 » Sun, 16. Mar 14, 09:21

Several strange things I've noticed while running this script are included here.
_____________________________________________________________

1. AFS (Advanced Fight Scripts) causes the guns in my turrets to "disappear" graphically every second or so for a very short time. Think thousandth of a second, like a blink, repeatedly every second or so. The result is constantly flashing guns. This occurs whether there are enemies in sector or not. Looking in "g" (default weapon loadout key), it doesn't appear to be actually removing my guns during that short time, but it's such a fast "flash" that it's possible they are being removed and re-installed, and it's just undetectable on that screen. I can't tell. I went to a backup save (and backup scripts folder) from an hour or so before I installed AFS, and the issue does not exist.

I've used Smart Turrets for a couple weeks, and I noticed you have one of the smart scripts in your package. When using AFS, gun flashing only appears to happen when using a SMART setting on the turret. Vanilla commands don't make the guns flash periodically. I did get it to stop flashing my turret guns by replacing your included smart script with the one from the actual smart package, and then re-issuing the SMART turret command to my turrets. I'm just not sure if you have made important changes to that file... so I went ahead and put your copy back in my scripts folder (and got the issue again).
_____________________________________________________________

2. On my HUD, I noticed little (neutral) "navigational beacon" or "mine" icons periodically flashing into and out of existence on top of an enemy frigate while one of my destroyers was shooting at it. I was watching from a different ship. The HUD icons stopped appearing/disappearing after the target was destroyed. The HUD icons appear to be tied to whatever my friendly ship is targeting/shooting at the time, as the next targets for my destroyer all had the same thing. I use a HUD mod, if that's relevant. It's jc hud.
_____________________________________________________________

3. From a different ship, I was watching my destroyer do some work (see above). While attacking an enemy and moving at 0 m/s, (AFS cap ship AI on), the m/s information in the target box disappeared. Straight up gone. Poof. No speed info, not even a 0/ms reading. Like the ship became a station. I didn't check enemy ships for this, but they might do it too. Normally, such as when a ship has a "None" command, the speed for that ship just says 0 m/s. But when using this script the speed indicator completely disappears at 0 m/s. The speedometer reappears with the correct speed reading when the ship begins to move again.
_____________________________________________________________

4. I coaxed a Xenon L (M3) away by itself to watch its behavior in combat. I'm in an M7 Astraeus from XRM. Basic attack run from the fighter. My beams outrange its fighter weaponry... so when I get a hit or two in, the L breaks off and runs away before it can do much damage. So far, so good. It's just one little fighter all by itself, and it's trying to do what it can within the confines of the script. Cool beans.

However, one of the times it ran away, it went out a good 18-20km and turned back around and came back. The entire way back, it fired its weapons every second or two, as if it were checking range or was unaware that it can't hit me with fighter lasers from 18km.

There are no other ships around for it to be firing at. I'm stationary. There are no missiles. It's shooting directly at me. I'm just way too far out of range for it to do any good. Then the L goes back to dancing in and out of range, attempting to do some damage while not dying (which is fine, that's what it should do). Although at some point it should probably give up, that's probably too much thinking to ask of a computer. :P
_____________________________________________________________

Ok... all that said, and I think I'm still going to use this script. I love that fighters are relevant, at least in numbers, as they should be. Thank you, Cronos, for your hard work on this. Hopefully the above can get a look, though.

Larxyz
Posts: 262
Joined: Tue, 16. Nov 04, 08:46
x3tc

Post by Larxyz » Sun, 16. Mar 14, 21:13

Cronos988 wrote:So, after I took a bit of a break from scripting, are there any bug reports for v. 3.1? How is the script running for everyone?
Hias, awesome script!
however sad to report that it every now and then freezes the game for me. from what i can tell its happens when in heavy combat with meny ships against the player. Might have todo with when the player changes ships, cannot confirm this as a cause.
I'm guessing it has something todo with firing a missile at the player...
thats all i can think of anyway.
anyone else noticed this?

User avatar
hourheroyes
Posts: 346
Joined: Mon, 9. Apr 12, 05:14
x4

Post by hourheroyes » Mon, 17. Mar 14, 01:56

2. On my HUD, I noticed little (neutral) "navigational beacon" or "mine" icons periodically flashing into and out of existence on top of an enemy frigate while one of my destroyers was shooting at it. I was watching from a different ship. The HUD icons stopped appearing/disappearing after the target was destroyed. The HUD icons appear to be tied to whatever my friendly ship is targeting/shooting at the time, as the next targets for my destroyer all had the same thing. I use a HUD mod, if that's relevant. It's jc hud.
I can confirm this one, I get it as well.

builder680
Posts: 1315
Joined: Mon, 14. Feb 11, 03:58
x4

Post by builder680 » Mon, 17. Mar 14, 04:03

Looking at glen.smart.turret.xml (SMART stock version, not the one included with AFS... although it's in that one too)

The Nav Beacon placement (my issue #2) is apparently a stock part of SMART turrets. It's at the very bottom. I'm not sure what SMART uses nav beacon icons for... but it seems that's not an AFS thing. The remark calls it a 'target marker.' I don't really need a 'target marker,' but maybe the script does. Perhaps it makes turrets aim center of mass instead of at the edges of targets? If so, that'd be cool and a damn good idea. Just wish it could be done without an icon on my hud flashing. I'll ask over in that thread.

Code: Select all

* ******************************************************
* Place.Target.Marker
*  Place target marker in center of ship
* ******************************************************
Place.Target.Marker:
$Victim.X = $Victim-> get x position
$Victim.Y = $Victim-> get y position
$Victim.Z = $Victim-> get z position
$Target.Marker = $Config[$Config.TargetMarker]
if not $Target.Marker-> exists
$Target.Marker = create ship: type={Argon Navigational Beacon} owner=[Neutral Race] addto=[SECTOR] x=$Victim.X y=$Victim.Y z=$Victim.Z
$Target.Marker-> ignore collisions: [TRUE]
$Config[$Config.TargetMarker] = $Target.Marker
else
skip if $Target.Marker-> has same environment as [THIS]
$Target.Marker-> put into environment [SECTOR]->
$Target.Marker-> force position: x=$Victim.X y=$Victim.Y z=$Victim.Z
end
endsub

return null
Issues 1, 3, and 4 persist.

More info while looking in X-Studio:
Stock SMART glen.smart.turret.xml has 1373 lines. The AFS altered version of glen.smart.turret.xml has 1398 lines. I can't actually read the stuff, I'm just trying to see what it is about the altered script that is making my guns flash. My guess is that it's somewhere in the 25 extra lines added by this script. That, or maybe it alters some lines as well.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Mon, 17. Mar 14, 13:14

Regarding the nav beacon, this is part of the 4.6.0 feature:
- Fire amidships at huge ships when the target is estimated to be unlikely to outrun the bullet, intended to reduce miss rates from shooting at the very nose of a long ship.

In order to fire amidships smart creates a nav beacon at the center of the target, fires the turret then removes the marker. No wait call is performed so the marker is never rendered, and the user isn't aware of it.

Code: Select all

617   | gosub Place.Target.Marker : 
618   | $rc = [THIS] -> fire lasers on target $Target.Marker using turret $TurretId 
619   | $Target.Marker -> put into environment null -> 
The reason it's showing up here is that a wait call has been introduced in the modified version, which causes the nav beacon to get rendered and if unlucky possibly moved by collision avoidance away from the center of the ship.

Code: Select all

626   |||| gosub Place.Target.Marker : 
...
634 @ |||| = wait 1 ms 
635   |||| $rc = [THIS] -> fire lasers on target $Target.Marker using turret $TurretId 
636   |||| $Target.Marker -> put into environment null -> 
I suspect the flickering issue would have a similar root cause though I haven't looked into that in detail. Smart changes weapons around all the time without intending it to be rendered, and a misplaced wait call can easily break the illusion.

builder680
Posts: 1315
Joined: Mon, 14. Feb 11, 03:58
x4

Post by builder680 » Mon, 17. Mar 14, 13:40

I see. I'm not sure, but... I think I learned something. :lol:

Is it as simple as me digging around looking for added waits in his modified version of your script, removing those lines, and seeing if it works?

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Mon, 17. Mar 14, 14:03

Yes, the way forward is to diff the 2 versions and fix any issues. To diff them one way is to load them one by one into X-studio, copy the contents out into text files (e.g. lhs.txt, rhs.txt), then run a diff tool between them. I say one by one as last time I checked it had issues with 2 files of the same name.

In any case having diffed them already I'd suggest simply removing the 3 'wait 1' calls that were added from lines 262, 634, 646.

I'd also be tempted to move the block that clears the turret's published target from line 255 into the GoneIdle subroutine, as currently it may be having an undesired effect of intermittently clearing the published target even though the turret continues to attack the same ship on the subsequent main loop iteration.
Last edited by Shimrod on Mon, 17. Mar 14, 14:17, edited 1 time in total.

builder680
Posts: 1315
Joined: Mon, 14. Feb 11, 03:58
x4

Post by builder680 » Mon, 17. Mar 14, 14:15

Shimrod wrote:In any case having diffed them already I'd suggest simply removing the 3 'wait 1' calls that were added from lines 262, 634, 646.
I did this and am testing now. Delete is easy! Guns have stopped flashing (although first, I had to clear the turret commands and re-issue them). :D

Now headed to shoot things to make sure enemies still react the way they should to my turrets shooting them.
Shimrod wrote:I'd also be tempted to move the block that clears the turret's published target into the GoneIdle subroutine, as currently it may be having an undesired effect of transiently clearing the published target even though the turret continues to shoot at the same ship.
I have no idea what this means. Hopefully things are good now, though. Your help and instruction, as always, is appreciated.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Mon, 17. Mar 14, 14:31

I have no idea what this means.
The intent of the changes is to share the turret's attack target through a local variable to the body of advanced fight script logic.

At line 255 of the original advanced fight script version, when the main Smart script loops around, this clears the published attack target, and in the inner firing loop at lines 629/639 this sets the published attack target.

The problem is that Smart only stays in the inner firing loop for a short time, then it reiterates the main loop in order to re-evaluate targets, best laser and perform anti-missile, before going back into the firing loop and shooting the primary target.

On re-entry to the inner firing loop Smart applies a wait for a duration equal to the laser refire delay, in order to preserve rate of fire between these re-iterations. The side effect would be that the published attack target will remain null for that duration, before being set again in the inner firing loop.

So I'd suggest rather than clearing the published target every iteration, to only do this in GoneIdle which the script invokes when not shooting anything.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”