[SCRIPT] Weapons Changer v2.50 [Updated 15/07/07]
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
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.
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.
Can anyone else confirm my observation?Bunny wrote:Hmm, tech support might be interested to hear this.
Thanks for reporting this .
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.
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.
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.
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.
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.
@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.
-
- Posts: 644
- Joined: Tue, 24. Aug 04, 11:41
-
- Posts: 644
- Joined: Tue, 24. Aug 04, 11:41
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)
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
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
-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
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.
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.
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?
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?
The feature list looks pretty damn good now. Have yet to try it, though. =)
Your data is saved in local variables so you could restart the target ship's WC mainscript after changing the mode.
This would not be a performance issue because this would be on direct player order only.
Especially useful for OOS ships, this would eliminate the 12s wait before the data is actually entered into the variables.
Well, and it's another way to avoid User Error reports. =)
Just an idea here...Bunny wrote:75ms - Playership
3s - In sector ship
12s - Out of sector ship
Your data is saved in local variables so you could restart the target ship's WC mainscript after changing the mode.
This would not be a performance issue because this would be on direct player order only.
Especially useful for OOS ships, this would eliminate the 12s wait before the data is actually entered into the variables.
Well, and it's another way to avoid User Error reports. =)
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
WC's interface is pretty smooth now but programming the weapon setups for every single ship is still... work.
I wrote a hack for personal use that
-installs weapons,
-programms this loadout by calling the WC script with proper argument,
-uninstalls weapons.
-repeat for every configuration I want for this ship class.
This way all the programming is done for me since all my ships have the same weapons anyway.
The Broadcast feature sets the mode for all ships in sector, right?
Some kind of "Copy THIS loadout" would eliminate the tediousness but there is no ideal way of doing it.
Ideally, the ship would copy the complete setup from a ship of identical type.
This is not easy, though, because there is no way for a ship to fetch it's own ship type. Can only query the object class which is way too general.
1.)
The only "proper" way (that I can see) is to build an array with every shiptype and make it available as global.
Then a ship can test against every existing shiptype and has then a chance to test other ships in sector against this shiptype.
If WC is running on a matching ship, the complete setup is loaded from that ship.
Sounds nifty to me because I could buy 10 new ships and only need one ship with an existing setup.
the others can "learn" from it and fall in. =)
The only issue would be that all shiptypes need to be entered into the setup and this would hurt compatibility with mods that have more ships.
2.)
The compatible but far less accurate way would be to query all ships of matching Object Class in the same environment.
Kind of a "broadcast Setup" feature.
That would be far simpler to write because all player ships in sector can be queried as an array and so can environment + WC Running.
Actually copying the setups would be easy enough.
Clone array, write local var to target... finished.
10 new ships (say, of object class M3) in a sector could completely be configured with one command this way. (and WC started for them =)
I wrote a hack for personal use that
-installs weapons,
-programms this loadout by calling the WC script with proper argument,
-uninstalls weapons.
-repeat for every configuration I want for this ship class.
This way all the programming is done for me since all my ships have the same weapons anyway.
The Broadcast feature sets the mode for all ships in sector, right?
Some kind of "Copy THIS loadout" would eliminate the tediousness but there is no ideal way of doing it.
Ideally, the ship would copy the complete setup from a ship of identical type.
This is not easy, though, because there is no way for a ship to fetch it's own ship type. Can only query the object class which is way too general.
1.)
The only "proper" way (that I can see) is to build an array with every shiptype and make it available as global.
Then a ship can test against every existing shiptype and has then a chance to test other ships in sector against this shiptype.
If WC is running on a matching ship, the complete setup is loaded from that ship.
Sounds nifty to me because I could buy 10 new ships and only need one ship with an existing setup.
the others can "learn" from it and fall in. =)
The only issue would be that all shiptypes need to be entered into the setup and this would hurt compatibility with mods that have more ships.
2.)
The compatible but far less accurate way would be to query all ships of matching Object Class in the same environment.
Kind of a "broadcast Setup" feature.
That would be far simpler to write because all player ships in sector can be queried as an array and so can environment + WC Running.
Actually copying the setups would be easy enough.
Clone array, write local var to target... finished.
10 new ships (say, of object class M3) in a sector could completely be configured with one command this way. (and WC started for them =)
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Not yet and as I said, I got a quick and dirty hack to do the job.Bunny wrote:Are you programming large numbers of fighters?.
Programming the setup for every single M3 is tedious and I don't like tasks like that. =)
For now I have a small fleet with Elephant and a couple captured LX and so far I don't see the point in getting more or heavier ships.
For clearing a Xenon sector I can use an LX or Hyperion and that's about the biggest fight you could find in X3.
When my income has grown so far that I can't spend the Cr any more it's time to retire and restart again since there is no game any more. =P
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.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.