[SCRIPT]-(31-08-09)-Weapon Select Extension v2.00

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

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

[SCRIPT]-(31-08-09)-Weapon Select Extension v2.00

Post by WindsOfBoreas » Fri, 16. Jan 09, 21:05

Weapon Select Extension

Download

FileFront Downloads
Changelog
  • Version 2.00
  • Complete Re-write

    Version 1.00
  • Project Start
What this Does...

There are six (6) hotkeys added:
  • WSE: Fire Missile 01
  • WSE: Fire Missile 02
  • WSE: Fire Missile 03
  • WSE: Fire Missile 04
  • WSE: Menu
    • This hotkey has multi-press functionality.
  • WSE: Quick-Profile
    • This hotkey has multi-press functionality.
WSE also adds one command to the Combat Commands section:
  • WSE: Switch Profile - Slot 355
There are configurable options to this plugin:
  • Change Multi-Press Delay Timer - Select this option to change the delay of the multi-press. The minimum is two hundred (200) milliseconds and four hundred (400) milliseconds. The default is two hundred and fifty (250) milliseconds.
  • Weapon Select Extension Lite - Only allows for the creation of Global and Personal Ship Profiles.
  • No Weapon Selected Empties Gun - If you do not select a weapon while creating a profile, the gun will be emptied when switching profiles. There is also a Empty Gun gun option in the create profile list. Leave this on False to keep the current weapon installed.
  • No Weapon in Hold Empties Gun - If you do not have enough of the weapons you listed in the profile in the ship's hold, the guns that should install the laser will be emptied. Leave this on False to keep the current weapon installed.
The Weapon Select Extension (WSE) allows the player to create weapon profiles designated to specific categories.

The categories are:
  1. Global - Create a profile that any ship can use via the WSE: Switch Profile combat command.
  2. Playership - Create a profile that is specific to the playership. When selected, only the playership will have the weapons switched if present.
  3. Class - Create a profile specific to a ship class. Set the Sector Only option to False to switch the weapons of all ships of this class outside of the current sector.
  4. Ship Type - Create a profile specific to a ship type. Set the Sector Only option to False to switch the weapons of all ships of this ship type outside of the current sector.
As well, the Weapon Select Extension (WSE) adds four Missile Quick-Fire slots. With these, you may assign four different missiles to be fired from a hotkey.

How to Use...
  • Creating a Profile
  1. To use the Weapon Select Extension (WSE), press the Menu hotkey.
  2. Select one of the four Create Profile... options. This is only two if you have WSE Lite enabled.
  3. Assign a name to the profile by selecting the Name option.
  4. If you are doing a Ship Class or Ship Type profile, assign a respective value to the Target option.
  5. If you are doing a Ship Class or Ship Type profile, select whether you want the profile to only affect the sector the player is currently in or the entire universe by selecting the Sector Only option.
  6. Below these options are all of the turrets on the ship (only the Playership profile will match how many turrets and guns actually exist). You can assign each of these slots individually or select the Set All Guns option.
  • Switching Profiles via Menu
  1. Open the menu with the Menu key.
  2. To select a Global or Playership Profile, simply scroll down the menu. For a Ship Class or Ship Type Profile, select the options Ship Class Profiles or Ship Type Profiles then select one of the profiles.
  3. This screen gives you three options: Switch Profile, Edit Profile, Delete Profile. Select Switch and you are done.
  • Switching Profiles via Quick-Profile Key
  1. Open the menu with the Menu key. Then select the Multi-Press Menu option.
  2. This screen shows a list of your ten Quick-Profile Stacks each with ten Quick-Profiles. Your first option is a menu to activate a certain Stack. The rest are Quick-Profiles you can assign. Select one of the open Slots.
  3. If you had a profile already assigned to this Slot, you would see three options: Assign Slot..., Move Slot..., and Remove Slot.... Since the slot you chose does not have anything assigned, you will just have the Assign Slot option. Choose it.
  4. In Version 2.00, I have only allowed Global Profiles to be set to Quick-Profiles so you will see a list of Global Profiles on this screen. Select one to assign it to the slot. If there had been something already assigned to this slot, you would have been asked to confirm overwriting the slot.
  5. Note which Stack you have just assigned the profile to then activate it via the first option or you can also activate a stack by pressing the Menu key the corresponding stack number plus one (so if it was Stack 01, press the key two times).
  6. Now press the Quick-Profile key the amount of times for that slot.
  • Using the Combat Command
  1. Open up the command console for any ship whose weapons you wish to change.
  2. Open the Combat Commands section and select the command WSE: Switch Profile.
  3. This is a list of all Global Profiles. Select one of the profiles to switch the weapons of the ship.
  • Setting Quick-Fire Missiles
  1. In order to set-up the four Quick-Fire Missile slots, you must first open the main menu with the Menu key.
  2. Then select the option Missile Quick-Fire Menu.
  3. Select one of the four slots on this next screen to take you to a list of missiles.
  4. Select a missile and it will be assigned to the chosen slot.
  5. The hotkey which corresponds to the missile slot will now fire that missile at an enemy. You must have a target and ammo before it will fire.
Known Errors and Issues...

Errors
  • After updating a profile, you will have to reassign it within the Multi-Press Menu. This is currently being worked on.
Issues
  • When creating a Ship Type Profile, all turrets show up as if they were there on that ship. This is, of course, not so and is merely an annoyance. I will fix this by spawning a ship of this type to sector null then returning its turret array.
  • When creating any profile, the weapons available may not be compatible with the ship or ship type. I will limit this too in the next version.

Enjoy,
The North Wind
Last edited by WindsOfBoreas on Sun, 16. Oct 11, 00:40, edited 10 times in total.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 15:11

Post by kelmen » Sat, 17. Jan 09, 15:01

Is this something like an extension over Weapons Quickswap
http://forum.egosoft.com/viewtopic.php?t=219454

, or different thingy?

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Sat, 17. Jan 09, 18:47

It's like Weapons Quickswap in that it allows you to change your weapons quickly. However, the similarities basically end there.

Weapons Quickswap, though being well written to do what it was supposed to do, has three major flaws.
  1. Very limited; you can only create three weapon profiles.
  2. Variables do not save with savegame; you must recreate your profiles every time that you load the game.
  3. Too many hotkeys; Weapons Quickswap creates six hotkeys for just the profiles.
Weapon Select Extension, however, does not have these limitations.
  1. Not limited; you can create an unlimited number of profiles that can be accessed by the menu and you can assign twenty-four of those profiles to a multi-press in the config menu.
  2. The variables are saved with your savegame; no matter how many times you load your game, your profiles will still be there. The only way they disappear is if you delete them personally.
  3. The profiles are all controlled by one hotkey, the Menu hotkey.
In the versions to come, as well, there will be the abilities to make profiles by class, ship type, globally, or specific playership.

And on that, you need not worry about updates erasing the profiles that you have made. Version 1.00 merely has the menu coding for class, ship type, and global commented out; the updates will only enable these again.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 15:11

Post by kelmen » Sun, 18. Jan 09, 07:52

Sounds great! In fact, the limitation of Quickswap you mentioned is exactly what I encountered.

Ok, will be your lab test rat. dling now...

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Sun, 18. Jan 09, 08:08

kelmen: Great, thank you for testing it out. Please give me any feedback that you can so I can optimize this part ( it'll translate to the other three parts ).

______________


I originally designed this to also allow missiles to be changed with profiles by having a Full (Front Turret, Auxiliary Turrets, and Missile), Front-Missile, Turret-Missile, and Missile profiles.

Unfortunately, the X3TC scripting environment does not allow one to change missiles. This was part of the reason why I created the missile quick-fire keys. If they make command to do this in the future, then I will update WSE to include the missile profiles (merely removing the comments on the code). I will also leave the quick-fire keys.

As well, I will be updating the missile quick-fire portion soon to take into account missile fire rates. As it is currently, you can fire a hundred missiles in quick succession; not what I had intended, but oh well.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 15:11

Post by kelmen » Sun, 18. Jan 09, 11:31

Ok, here's my tested-run feedback (based on my need and pref):

I practically don't use missles, probably until I got my 1st missle/boating ship only then I may need that.

The good thing using Weapon Quickswap is, its allow "quick" swap of the weapon.
Using this, I need to call up your menu selection, then click player profile, then click on the setup I want.
Its very inconvenient during combat. Say I have 1 set for full-range+dmg setup, then I wanna swap to another to deal with small-fighters, or for pre-boarding shield crippler. Its very inconvenient, to click through 3 menus to get the weapon setup, compare using "quickswap", just the hotkey and I'm good to continue bang-bang in-fight

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Sun, 18. Jan 09, 16:45

I actually use missiles all the time...I generally fly an LX or Nova and in the entire time spent actually playing the game (as opposed to scripting), I've barely fired a shot. Gone through a fortune's worth of missiles though.

Anyway...

_______________


That's where the multi-presses come in.

Go to the configuration menu before combat and put the profile to a multi-press. When you need to access that profile quickly, double, triple, quadruple-tap the Menu key.

Currently, I have my double-press set to Front: Mass Driver (eight MD's); triple-press is six Plasma Burst Generators and two Mass Drivers; and quadruple-press is set to eight repair lasers.

But don't think that it's limited to just three profiles. You can set up twenty-four multi-press profiles under the configuration menu.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Mon, 19. Jan 09, 21:58

Has anyone else tested this so far?
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 15:11

Post by kelmen » Tue, 20. Jan 09, 14:13

ok, with this multi-press, its worked as I expected now.
Great!

Will test how it go, if I chg ship. As I chg ship from M7 -> M3 (faster) frequently

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Tue, 27. Jan 09, 15:21

Ok, I'm going to try updating this within the next few days (depending on when I am able to get my English paper done) to include the extra functionality that I described.

First, however, I need to know how this is working for people. This version, though stable, was just a prototype for the full thing, so I need some feedback on it if I am to implement the rest of the things.

So please, tell me if you have had any problems with Weapon Select Extension. Tell me if you have any suggestions for extra functionality. Remember that you all are the consumers of these plugins; it's your job to tell us what you want.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Sun, 1. Feb 09, 02:56

Sounds like a really good idea. I'm game for a go.

If you can get the other two parts working as well, especially for all shipclasses in playerfleet, this is going to be the premier XTC weaponswitcher script.

Since I positively loathe micro-management, with a "equip all ships of this type like xxx" script and your WSE script my entire fighter and corvette force will be a breeze to manage.

Question: If I understand yr intentions about how the playerfleet portion of WSE will play out...if, for example, I'm hammering a Q with a wing of identical M3's using IonDisruptors, just before target's shields go down, I could have all of them switch to IRE's, to avoid frying the target's weapons while I send in my marines?? And then switch back to IonD's if the target's shields rise too quickly?

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Sun, 1. Feb 09, 05:00

I am actually working on all of the parts as I speak. To be sure that it will work the way that I want it to, I'm rewriting the entire plugin from the ground up.

Yes, your assumption on WSE's functionality is correct. If the ships have the weapons that you choose in the profile, their guns will switch to those weapons. If they don't have the weapons, the guns will all empty. (I'll probably make this into a configuration option). If they have say six out of eight guns, then six guns will have weapons and two will be emptied.

To further the functionality, I am actually thinking of adding a "Wing Profile" and adding a configuration option per profile to only switch the "Class" and "Ship Type" profiles in-sector or across the universe.

I expect to be done sometime this week or next weekend (it all depends on my classes this week).
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Tue, 3. Feb 09, 22:15

Unfortunately, I'm not going to be able to try out WSE for a week or so, as I've got work to do back in X3R-land, as part of our effort to get the DDRS mod (56 new ships & the (original) PHQ) ported to TC.

With that timing, I should be just in time for the full WSE suite.
Keep it comin' dude!

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 15:11

Post by kelmen » Tue, 17. Feb 09, 13:04

I think I hit up a bug here.

Noted: I run CMOD3 5.1

running M7 Panther ship, which got no main guns

I setup 2 profiles for this ship, when activated any 1 of these profiles, I noticed only the top 4 weapons in my front turret is toggled.

Is this a limitation over turret weapons?

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Tue, 17. Feb 09, 13:37

Heh, I was going to write something like this (one day.....)



Just a suggestion (this is what I was going to do, although I'm probably not going to do it any more as this seems like a pretty solid script)

Make pressing a key cycle through all the .. ?loadouts? (sorry I don't know what you call them for your scripts)
And use Gazz's double click (multiple click) manager, such that on a double click it opens the menu.

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Tue, 17. Feb 09, 14:53

Kelmen:

This sounds like it could be one of two things.
  1. The ship that you're in doesn't have all of the required weapons to switch to (for the slots that cannot be switched, it should empty them...which will be a config option in the new version).
  2. The profile was made for a ship with only four guns in that turret.
If that's not it, then...I'm not really sure what's happening there. If you wait about a week or so, the new version will be out (though I'm going to start it in a beta stage due to all of the changes).
_______________________
Just because someone's made a script doesn't necessarily mean that you shouldn't make one; it's always good to give the community choice.

I call them both "profiles" and "loadouts".

That's an interesting way of doing it, though it would only work for how the script is now (only supporting one ship's profiles).

This past week, I've gone back and completely redone the entire set of scripts to add the Class, Playership (Specific Ships), and Ship Type profiles into it. Unfortunately, it also means that everyone's profiles that they have now won't be compatible with the next version.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

kelmen
Posts: 308
Joined: Tue, 9. Dec 08, 15:11

Post by kelmen » Wed, 18. Feb 09, 14:03

WindsOfBoreas wrote: This sounds like it could be one of two things.
  1. The ship that you're in doesn't have all of the required weapons to switch to (for the slots that cannot be switched, it should empty them...which will be a config option in the new version).
  2. The profile was made for a ship with only four guns in that turret.
If that's not it, then...I'm not really sure what's happening there. If you wait about a week or so, the new version will be out (though I'm going to start it in a beta stage due to all of the changes).
1. No, I have all the weapon in stock. after triggering the cmd, those missing weapons are left in my cargo, I still manually assign them over

I believe this only happen only on ship with no main guns, as I have no problem with Centaur and Heavy Nemesis.

Well, though I noticed another pattern, but I awared its not your script, just fyi.

As I'm running MARS, which kind of auto manage (select) the turret weapon, by default it tends to pick 1 weapon for each turret side, even though that side has more than 1 slot, and I got all the weapons to fit in.

But that's no problem, MARS will auto fill up avail slots in combat.
Though something certain weapons I mean for front main gun is -taken- up MARS assigned over at turret, but if I keep repeat 1 or 2 more times to call up the weapon profiles sets, I will get back the setup I'm desired at front main set.

So far my attention is on main guns, only now flying Panther which has no such main gun set and noticed this max-4-weapons assignment, dunno maybe its due to conflict of MARS or not.
Though I leave MARS to self manage them.

***

Suggestion:
How about setting up another hotkey for the multi-press?

in my own mind, I created 3 weapon profiles. When I wanna call up my 1st setup, kind of should click a hot-key 1 time, but due to current scripting using same key for both multi-press and normal menu, I have to click twice for this.
I have to spend some time to overcome this confusion at initial stage

wondering if you can make it another hotkey for the multi-press, it may help making more friendly for new user

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Wed, 18. Feb 09, 22:49

kelmen wrote:Suggestion:
How about setting up another hotkey for the multi-press?
That's an interesting idea. I might just do that, though I'd still need to find a use for the menu hotkey as just having it call a menu is a waste of a hotkey.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

User avatar
Jaga_Telesin
Posts: 435
Joined: Sat, 16. Sep 06, 22:48
x4

Post by Jaga_Telesin » Thu, 19. Feb 09, 01:59

kelmen wrote:I think I hit up a bug here.

Noted: I run CMOD3 5.1

running M7 Panther ship, which got no main guns

I setup 2 profiles for this ship, when activated any 1 of these profiles, I noticed only the top 4 weapons in my front turret is toggled.

Is this a limitation over turret weapons?
Note: I can confirm this bug - just came out to report it and noticed this post. Front turrets (perhaps others) only honor the first four slots - all others are emptied.

WindsOfBoreas
Posts: 283
Joined: Sun, 3. Aug 08, 20:30

Post by WindsOfBoreas » Thu, 19. Feb 09, 03:39

Hmm, ok.

Just to ask, are you sure that the weapons that it calls for are not already installed in another turret?

Are you also running MARS?

___________________________________

On a somewhat different note...
I will ask that for the next stage (the next version), that people give a list of plugins/mods installed when an error arises. If it's a problem with a profile, list what's in the profile.

To help with this, I will add a log file to WSE that you can export the plugin's information to. Hopefully, however, there won't be many problems that would need such attention.
"Humanity has the stars in its future, and that future is too important to be lost under the burden of juvenile folly and ignorant superstition." - Isaac Asimov

Post Reply

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