[SCRIPT] Weapons Changer v2.50 [Updated 15/07/07]

The place to discuss scripting and game modifications for X³: Reunion.

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

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

Post by Gazz » Fri, 20. Apr 07, 15:02

Squelch wrote:I just cycled through my weapon sets a couple of times to confirm they were set as wanted. Suddenly without any apparent reason it started ignoring input.
Are you positive the SCRIPT did not work or did you just not hear the AUDIO from it while the weapons were switched ok?

Losing audio is nothing new but not related to this script.
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.

Teladidrone
Posts: 644
Joined: Tue, 24. Aug 04, 11:41
x3tc

Post by Teladidrone » Fri, 20. Apr 07, 22:18

What Gazz said... additional hotkeys wont disturb anybody so no need for 2 versions.
Just add them to the mainstream please ;)

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Sat, 21. Apr 07, 14:54

Gazz wrote:
Squelch wrote:I just cycled through my weapon sets a couple of times to confirm they were set as wanted. Suddenly without any apparent reason it started ignoring input.
Are you positive the SCRIPT did not work or did you just not hear the AUDIO from it while the weapons were switched ok?

Losing audio is nothing new but not related to this script.
Yes I am sure.

The audio feedback comes through as though it has confirmed the change when I use the menu. But, no change is made to the weapon config. Trying the hotkey gives no feedback or weapon change.

I've looked at the ship in debug mode, and the script is idling in mode 7 with the configs still intact. I don't see any variables change when pressing the hotkey, or going through the combat menu. I can only assume that the script has got itself into an unspecified state, but why this happens I can't fathom, nor recreate with any certainty.

As i said, it now seems completely random. I originaly thought it was because I'd left the ship and then re-docked. The only workaround is to uninstall, then restart the whole thing. It is most odd.

I concur that we don't need two versions. We can choose to either assign a hotkey or not. You could even have a cycle key as it is now, and hotkeys to cofig 1,2,3 as well.

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Sat, 21. Apr 07, 16:22

Okay, one version.

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Sat, 21. Apr 07, 16:39

Thanks Bunny. This really is a very useful script when it's working (95% of the time)

Oh! Welcome back btw :)

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Sun, 22. Apr 07, 13:37

I wonder if the problem is a script conflict?.

The next version will search and run in a free slot rather than be tied to 323.

It is good to get some scripting time at last (Now getting my head around the suggestions by Gazz).

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Sun, 22. Apr 07, 15:56

I think I've found the reason for it getting stuck.

I have been working on a script of my own, and was using the debugger to track it's progress. It's fine when debugging another ship, but when used on playership, with weapon sets, it borks Weapon Changer. Turning off debugger afterward still leaves it in a zombie state, so a reload of a save prior to debugging is needed. This seems to be the case whether or not I have my script loaded, so it appears it's not a conflict.

You may have created the first anti-debug script :)

My apologies if it's caused you too much distraction.

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Sun, 22. Apr 07, 18:36

Hmm, tech support might be interested to hear this.

Thanks for reporting this :thumb_up: .

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Tue, 24. Apr 07, 13:50

Bunny wrote:Hmm, tech support might be interested to hear this.

Thanks for reporting this :thumb_up: .
Can anyone else confirm my observation?

I am now confident that running debug on Player Ship while Weapon Changer is active will cause Weapon Changer to cease responding to input after a while. It still has a random element (effects do not appear imediately) and could still be specific to my setup.

I will be making a fresh install of 2.0.0.2 in the near future, so will install Weapon Changer only, and enable SE to test my theory and to rule out any conflicts with other community made scripts.

It is worth pointing out that this should not affect anyone who does not have SE activated, and is not running debug.

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Thu, 26. Apr 07, 10:56

Here is the current status of the script upgrade:

1. Weapons configurations are now contained in local variable arrays. This means they are remembered if the script is restarted.

2. Fourth OOS weapons configuration array (D) added. This is automatically selected when the ship is OOS.

3. All three weapon configurations can be programmed, selected and reprogrammed all by using a single hotkey.

4. Three more hotkeys added to allow quick configuration selection.

5. Option to terminate script and erase local weapons configuration variable arrays added.

6. All ships will automatically swap between weapon configurations A and D as they move between OOS and IS.


A few things are still to be added and the testing is in progress.
So almost done.

@Squelch - If time allows I will try the script with the SE debug option activated. Usually, I never use this feature but debug by sending the output to logs instead.

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Thu, 26. Apr 07, 12:27

That looks like a pretty fine upgrade list. I look forward to testing it. Would it be possible to have a config that is reverted to upon leaving ship in a similar way to OOS/IS (config A for instance). It's probably a bit late to request but worth a shot.
@Squelch - If time allows I will try the script with the SE debug option activated. Usually, I never use this feature but debug by sending the output to logs instead.

I would normally but I was trying to capture stock script events and wanted to avoid editing signed scripts to output debug info and therefore potentialy introduce new errors. It seems the hangup only occurs under unusual circumstances. The workaround is to either ignore WC refusing input, or use it on a ship where WC is not running. It isn't relevent to the script I'm developing.

Teladidrone
Posts: 644
Joined: Tue, 24. Aug 04, 11:41
x3tc

Post by Teladidrone » Thu, 26. Apr 07, 17:43

Woot!
Gimme, gimme, gimme... the hotkeys! *g*

Oh and just a little thing - I really like detailed sound/voice feedback from scripts...
Let the computer voice say "Weapon systems Alpha/Beta/Gamma/Delta ready" when changing the loadout IS using a hotkey ;)

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Fri, 27. Apr 07, 09:40

Is such long audio confirmation in a dogfight a good idea?.
At the moment it just says the letter of the selected weapons loadout.

Teladidrone
Posts: 644
Joined: Tue, 24. Aug 04, 11:41
x3tc

Post by Teladidrone » Fri, 27. Apr 07, 15:00

Yeah I know... but only "A" is a little... well... short.
At least let it say "A ready" ;)

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

Post by Gazz » Fri, 27. Apr 07, 17:52

Some (like me) certainly prefer the shortest possible speech so the current "A" suits me just fine. =)

I don't know what your plan is but if the old "enter the number" way still exists, it's no big deal to add a toggle for verbose speech with a number input of 40 or whatever.

The verbose style could also play sample 969 (or something similiar mechanical sounding) and say the weapon config letter afterwards.
(samples do not halt the script like speech does - a wait is required)
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.

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Sun, 29. Apr 07, 13:40

Progress update:

-Ship name now indicates the selected weapons configuration (Not for player ship) - added & tested

- Ship remembers the selected weapons configuration when the player enters the ship. These weapons are restored when the player leaves the ship again - added & tested

- Audio sample 969 plays when player hotkey swaps the weapons - added & tested

Okay, I just need to move the player log messages to the t page and double check with the testing.

So expect version 2.0 to be posted in the next couple of days.

Cheers

Bunny

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Sun, 29. Apr 07, 13:55

Excellent news!

I'm looking forward to this.

I was just thinking of a modification to mobile mining to use weapon changer. In fact any other job type script. That is, in the case of a miner, arm defensive weapons while traveling between locations, and then arming with mobile mining platform when clearing asteriods. The triggers for this being fired from the job script that checks for the existance of WC on that ship. Possible?

With the new memory of player/ai configurations, there are many possiblities that will enhance the experience.

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Mon, 30. Apr 07, 17:01

After 3 months of life getting in the way....Weapons Changer Version 2.00 has arrived.

@Squelch
:S I'd really like to keep weapons changer and the mobile miner separate. Both are rather complex beasts to modify.

Squelch
Posts: 252
Joined: Sat, 15. May 04, 11:03
x2

Post by Squelch » Mon, 30. Apr 07, 17:52

Wow that was quick!

I look forward to testing this tonight.

The mobile miner modification was me thinking out loud. I appreciate how complex the scripts are, and anything that might break them should be avoided. If I may, I'd like to call WC with parameters from my scripts as I don't want to have to replicate your excellent work. Do have any objections?

Bunny
Posts: 2014
Joined: Mon, 1. Dec 03, 19:44
x3ap

Post by Bunny » Mon, 30. Apr 07, 18:05

No problem, all your script would need to do to control the weapons changer is call hww.bunny.setstate with the required mode number.

Now let's see if I got all of the bugs out of this thing :)

Post Reply

Return to “X³: Reunion - Scripts and Modding”