[SCR] Follow me / Remember homebase + wingman (v8)

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

User avatar
Locksley
Posts: 371
Joined: Fri, 18. Mar 05, 16:26
x3tc

Post by Locksley » Sun, 19. Apr 09, 20:06

Thank you Gazz, much apriciated.

Spikend
Posts: 58
Joined: Tue, 30. Dec 08, 14:16
x3tc

Post by Spikend » Mon, 20. Apr 09, 14:01

Thank you! :D

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 20. Apr 09, 19:33

Version 8 released.

If a player-flown fighter docks with a carrier, the auto supply feature of X3 does not work so ammo and missiles are not restocked. (This is an X3 issue, not a Gazz issue)
It always works if you use this script.


Just took another 2 lines of script so why not? =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

DJSfinx
Posts: 69
Joined: Sun, 25. Jan 09, 23:18
x3tc

Post by DJSfinx » Wed, 29. Apr 09, 23:21

Neat little script, thanks alot! :D

Spikend
Posts: 58
Joined: Tue, 30. Dec 08, 14:16
x3tc

Post by Spikend » Sun, 14. Jun 09, 17:35

Thanks Gazz!

crimson522
Posts: 36
Joined: Thu, 28. May 09, 23:07
x4

Post by crimson522 » Sat, 20. Jun 09, 16:04

can this script be used with the Anarkis Defense System by serial kicked?

valerria
Posts: 30
Joined: Sun, 18. Sep 11, 02:07
x4

Post by valerria » Mon, 10. Oct 11, 21:23

Great little script, but unfortunately the remember home base function no longer works as of 3.x.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 11. Oct 11, 12:14

AFAIK, TC 3.0 didn't change the script language or the homebase property in any way.

It should work.

It might just take a little time to record the homebase setting of all your ships before it can work.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

wga
Posts: 34
Joined: Thu, 19. Feb 09, 15:04

Post by wga » Sun, 29. Jan 12, 03:38

How about the situation, From carrier jump to a fighter which is one of a wing, since the wing may have order, if player want to do something on that fighter, he need to remove that fighter from wing. Unless he want to set on that fighter and watch what it doing.

I have a carrier with about 10 fighters in a wing, after 'finish' big ships, I'd like to enter one fighter to kill the small ships, and the same time order the wing to protect me or attack my target. Then ... I need to remove the fighter from the wing. And now only have 9 fighters in a wing, one left for me to jump in.

Maybe this can be a switch for temporary let the fighter leave the wing, and when player go another ship, the fighter re join back the wing.

dblade
Posts: 151
Joined: Fri, 20. Jan 12, 05:13
x3tc

Post by dblade » Sun, 12. Feb 12, 22:29

Just tried this mod out and like it.

Found the AL settings under Options->Gameplay->Artificial Life Settings


@wga I've dealt w/that too in that if fighter is part of a wing and you take control of it, but then give wing commands you will be forced into autopilot continuously.

What is interesting is that in the way Gazz described things in the OP is that it sounds like the game might have used to delete the wingman status. I haven't seen that happen (as of 3.0 anyway). Now I'm wondering if maybe a remove from wing call could be added so it's gone while we are in control and then wing status gets restored by the mod (as normal) when leaving the ship :)

EDIT: I misunderstood. The mod is maintaining the wingman for player setting for which, I just learned, ties in the Shift-6 and Shift-7 hotkeys.

EDIT2: Given the amount of wing commands I was able to add the changes need to save the wing name off and disband/restore wing membership accordingly. Did not worry about Formation leader as I typically do wing setups of all one ship type and then have that wing protect a ship on patrol (not part of the wing, but treated as the leader)

Figge04
Posts: 55
Joined: Wed, 18. Dec 13, 16:59
x4

Post by Figge04 » Thu, 2. Jan 14, 12:46

Thanks for this, was getting very annoying. wasnt sure if it was me or the game :)

onslow77
Posts: 3
Joined: Tue, 31. Oct 17, 20:59

Post by onslow77 » Tue, 31. Oct 17, 21:28

Hello!

I have X3AP with XRM installed and am wondering if I shall put the contents from the "scripts" and "t" folder,

in:

.../X3 Terran Conflict/scripts
.../X3 Terran Conflict/t

or:

.../X3 Terran Conflict/addon/scripts
.../X3 Terran Conflict/addon/t

Regards
Martin

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24965
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Tue, 31. Oct 17, 23:01

Files for X3AP always go into the "addon" directory.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Daemonjax
Posts: 95
Joined: Tue, 27. May 14, 01:54
x4

Re: [SCR] Follow me / Remember homebase + wingman (v8)

Post by Daemonjax » Tue, 23. Apr 19, 22:02

This is the 2nd most essential mod I use (Bounce being 1st place), so I just wanted to say thanks for such a great mod!

I made some modifications to it...
1) Fixed a bug in there...

Code: Select all

Assign.Old.Homebase:
gosub AddBounce:      <-- Bounce support
* $Home = $Ship-> get homebase     <-- this is wrong
$Home = $Playership.Old-> get homebase     <-- this is what it should be
$Home.Old = $Playership.Old-> get local variable: name=$VarName.Homebase
if not $Home-> exists
if $Home.Old-> exists
$Playership.Old-> set homebase to $Home.Old
end
end

$Is.Wingman = $Playership.Old-> get local variable: name=$VarName.Wingman
$Playership.Old-> set as player wingman: $Is.Wingman

gosub AddOldShipBackToWing:    <-- Wing support

endsub

2) Added support for Wings (when you switch into a ship that's in a Wing, you're fighting the autopilot constantly... hated that, so I fixed with some minor code additions to your mod).

Code: Select all


...
*   Player CHANGED SHIPS,  old and new ship exist
gosub Assign.Old.Homebase:
gosub MarkAndRemoveNewShipFromWing:     <--- Wing support
gosub Assign.Target:
...

MarkAndRemoveNewShipFromWing:
$Ship.new.is.in.wing = [PLAYERSHIP]-> get flight wing
[PLAYERSHIP]-> set local variable: name=$VarName.flightWing value=$Ship.new.is.in.wing

do if $Ship.new.is.in.wing
[PLAYERSHIP]-> remove from flight wing

endsub

AddOldShipBackToWing:
$Is.inWing = $Playership.Old-> get local variable: name=$VarName.flightWing

do if $Is.inWing
$Playership.Old-> add to flight wing: wing=$Is.inWing

endsub
3) Added support for Bounce (so when you switch ships, Bounce is re-added to your old ship automatically).

Code: Select all

AddBounce:
* adds bounce to old ship when player changes ships, undocks from carrier, or ejects
if get global variable: name=$Key.LitQB.Bounce.OnOff
skip if $Playership.Old-> is script 'Lib.Cmd.Bounce.Check' on stack of task=323
$Playership.Old-> begin task 323 with script 'Lib.Cmd.Bounce.Check' and priority 10: arg1=null arg2=null arg3=null arg4=null arg5=null
end

endsub
4) Doubled the wait time in the ship scan loop, and decreased the fake modulo check from 25 iterations to 20 -- because I don't really care if it takes an extra second every 5 minutes.
5) Removed the 1 ms wait before the ship scan loop -- I don't see why it's needed and couldn't a 1 ms wait cause unnecessary context switching? It hasn't done any real work at that point yet. Probably doesn't matter either way tbh.

Post Reply

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