Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: ARSPR on May 25, 2006, 10:13:43 am

Title: Suggestion for new feature: Auto equalize shields
Post by: ARSPR on May 25, 2006, 10:13:43 am
Well, when I play FS2 and I am in heavy fight (mainly dogfighting), I am continously pressing Equalize Shield to repair the damaged cuadrants of it. And of course if it is really weak I transfer enery from lasers.

But the equalizing action is just an automatic one without thinking or watching if it is really needed. If I'm in heavy combat I equalize all the time. So, at least for me, this action is just a waste of one joystick button.

So it would be nice to have an Auto-Equalize Shield function so I could free this joystick binding. From just a player point of view, (not a coder one), I can see three ways of adding this function:

1. (The worst one). Coding a launcher flag so if you want auto-equalize function it would be always enabled. Logically, this one would interfere with desired asymetric shield distributions, (set through cursor keys), because this new function will erase these distributions. (But, guy, it is up to you using it or not).

2. (I think the good one). Coding a new action Toggle Auto-Equalize Shield on/off. In this way you could switch on/off this feature within play. So if you want to set a special shield configuration, just toggle it off.

3. (The perfect one). Coding 2 and displaying it in HUD in the same way auto-targeting or auto-speed matching do now.


The way this function should work would be: Just after every enemy hit, equalize shields. In this way it won't change the amount of damage each hit does to yourself (or if it damages your hull or not).

I think this feature should be quite easy to code and it could be pretty useful. (Now I only need a bored coder with free time, without friends, girl/boyfriend, husband/wife, sons/daughters, no books to read and no movies to watch  ;)).
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Colonol Dekker on May 25, 2006, 10:18:04 am
Use Q key to toggle a loop containing the Equalise code/function?
I'll leave it to you codey guys...
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Col. Fishguts on May 25, 2006, 10:37:37 am
Auto shield equalizing would render the 4 quadrants useless. You would live longer, but that would take away an integral gameplay feature.

Smart shields (http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-smart_shields) are a better way to handle this, IMO.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: ARSPR on May 25, 2006, 11:49:13 am
Auto shield equalizing would render the 4 quadrants useless. You would live longer, but that would take away an integral gameplay feature.

Smart shields (http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-smart_shields) are a better way to handle this, IMO.

Yes, as I've said it can make these quadrants useless. But while dogfighting, I actually do make quadrants useless by continuous and automatic use of Equalize Shields, (you never know where you are going to be hit so it has no point making any quadrant stronger), while wasting a joystick button. I would prefer my PC doing it for myself and freeing this binding for any other and more interesting action.

OTOH, in any of the ways I have thought about this feature, it would be fully optional. So nobody would be forced to use it if he/she doesn't want to. And more over, even in multiplayer, you couldn't notice if an opponent is using the auto-equalizing feature or just pressing equalizing action as mad (as I do now).

Smart-shields just works for slowly repair holes in your shields. But in heavy dogfighting you need fast repairs (so your friends are equalize and laser->shields).
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: CaptJosh on May 25, 2006, 04:17:37 pm
What about just flying better so that you get hit less? *runs*
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Mars on May 25, 2006, 05:03:43 pm
I personally think it's a good idea, but might inhibit the player from learning how to properly manage shields.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: karajorma on May 25, 2006, 05:53:32 pm
It would also get in the way those times you do need to manage shield manually. You'd have to find the keys to turn this off and then do things manually.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Goober5000 on May 25, 2006, 06:12:27 pm
I think this feature should be quite easy to code and it could be pretty useful.

Fair warning: Any feature request thread that includes "I think this would be easy to code" usually gets placed on the top of the "make sure not to add this feature" list.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: ARSPR on May 26, 2006, 01:17:16 am
I think this feature should be quite easy to code and it could be pretty useful.

Fair warning: Any feature request thread that includes "I think this would be easy to code" usually gets placed on the top of the "make sure not to add this feature" list.

You're fully right. I don't know about coding so probably, after looking in the code, it will result in a PITA to do ... (Specially if it's a feature the "possible" coder doesn't like or consider it worthless ...)

As always, you're fully free to do whatever you want, and no-one can complain about it.  :yes:
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Wanderer on May 26, 2006, 04:55:01 am
Scripting.tbl....
Code: [Select]
#Global Hooks

$Simulation:

[

for i = 1,mn.getNumShips() do
   shields = (mn.getShipByIndex(i).Shields[1] + mn.getShipByIndex(i).Shields[2] + mn.getShipByIndex(i).Shields[3] + mn.getShipByIndex(i).Shields[4]) / 4
   mn.getShipByIndex(i).Shields[1] = shields
   mn.getShipByIndex(i).Shields[2] = shields
   mn.getShipByIndex(i).Shields[3] = shields
   mn.getShipByIndex(i).Shields[4] = shields
end
   
]

#End

Its easy to implement it for all ships (as above) though its a bit harder to specify just invidual ships and then generating triggers for it..
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: WMCoolmon on May 26, 2006, 08:57:44 pm
It would be slightly more efficient to do it like so:
Code: [Select]
#Global Hooks

$Simulation:

[

for i = 1,mn.getNumShips() do
   ship = mn.getShipByIndex(i)
   shields = (ship.Shields[1] + ship.Shields[2] + ship.Shields[3] + ship.Shields[4]) / 4
   ship.Shields[1] = shields
   ship.Shields[2] = shields
   ship.Shields[3] = shields
   ship.Shields[4] = shields
end
   
]

#End

This saves the time required to index the ships array (getShipByIndex). Relatively speaking, that function is fairly slow due to the way ships are stored. Also, you can never depend on one index being the same ship across frames, and between different hooks, because dead/departed ships are removed from the list.

Was the documentation unclear on that?
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Wanderer on May 27, 2006, 12:26:19 am
Not really... but using getShipByIndex that was the easiest way of implementing global shield auto equalizing.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: WMCoolmon on May 27, 2006, 02:04:12 am
Oh, yeah, it's exactly what should be used in this case...I'm just curious if there was a specific reason that you used the function call rather than a variable...ie if the documentation sounded, to you, like you should use the function call every time, rather than setting the result to a variable.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Wanderer on May 27, 2006, 02:22:36 am
I just thought of making the example as streamlined as possible... nothing else.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Fade Rathnik on May 27, 2006, 05:21:06 pm
It could be set up to auto equalize when the hull takes damage. That way when the ship gets hit on the hull it plugs the hole for you and letting only one or two bolts thru and buying you more time to dodge.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Mars on May 27, 2006, 08:41:35 pm
No, that's getting too close to doing things for the player.
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: ARSPR on May 28, 2006, 01:52:38 am
No, that's getting too close to doing things for the player.

Yes, I agree with you.

I have suggested Auto-equalize because the original game HAS an equalize function which you can be constantly using (as I do). If there wasn't this function it would be completly tricky. (I even think that smart shields is a bit tricky ...)
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: wolf421 on May 28, 2006, 03:31:20 pm
 :wtf: I'm new in this forum so pot shots or missels yet...lol
I've been playing FS 1&2 for years, and never thought about the equalize shields button until I downloaded the open verison over at scp website. Now with the updated code and all I actually have to use it. I'm not the best player out here on the web but why not just setup your desk and place your keyboard within reach and hit the keys you need to when needed.  Thats what I've done for years and I have a real nice joystick with 6 buttons and  a 8 position hat on it but still I use the keyboard for alot of function keys that I can't bind to my joystick.
Heck try playing (the orginal descent on keyboard without a joystick)  and see how fast you learn to use the keys without looking...lol
 :yes: I would love to have a auto function toggle to equalize shields, but hey I can deal with it the way it is... :D 
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: ARSPR on May 28, 2006, 04:12:54 pm
:wtf: I'm new in this forum so pot shots or missels yet...lol
I've been playing FS 1&2 for years, and never thought about the equalize shields button until I downloaded the open verison over at scp website. Now with the updated code and all I actually have to use it. I'm not the best player out here on the web but why not just setup your desk and place your keyboard within reach and hit the keys you need to when needed.  Thats what I've done for years and I have a real nice joystick with 6 buttons and  a 8 position hat on it but still I use the keyboard for alot of function keys that I can't bind to my joystick.
Heck try playing (the orginal descent on keyboard without a joystick)  and see how fast you learn to use the keys without looking...lol
 :yes: I would love to have a auto function toggle to equalize shields, but hey I can deal with it the way it is... :D 

Oh please, let finish this tradition of saying "Your function isn`t needed at all", "If you play in easy mode or you are a very expert pilot, you don't need that", "I've played without it during centuries so why do we need it now?", "I do like equalizing shields with cursor keys", "I do like destroying Q key by constant pressing" and so on.

I do know you can go without this function cos we ARE without it now, so I know there are 3 million ways of living without it. I was just suggesting a FULLY OPTIONAL feature that can be useful to SOME people or even myself alone (not pretending to EVERYONE) and more over it doesn't break any backwards compatibility.

I don't know coding, so if someone inside SCP crew is bored and wants to code it, I'll be happy. If no-one does it, I'll be happy too.

(Not wanting to be rude even if it seems  ;) ...)
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Flipside on May 28, 2006, 04:15:51 pm
Heh, well, it seems to me that if it does get implemented, then the best bet would be to assign it to ALT-Q, much as ALT T is auto target and ALT M is auto match speed :)
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: ARSPR on May 28, 2006, 04:18:30 pm
Heh, well, it seems to me that if it does get implemented, then the best bet would be to assign it to ALT-Q, much as ALT T is auto target and ALT M is auto match speed :)

If it is coded as a new action you will be able to bind it to anything you want (look for Backslash beta builds and his multitargeting enhacements).
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: CaptJosh on May 28, 2006, 09:01:19 pm
:wtf: I'm new in this forum so pot shots or missels yet...lol


New huh? Let me be the first, I hope...
*fires the BFGreen*
:welcome:
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Apathy on May 31, 2006, 05:09:49 pm
I happen to agree with wolf421 a bit, it would make it a bit too easy for the player - so I rekon there should be some minor side affect to using the auto equalise, like it takes a second to act, dunno just an idea. *runs*
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: wolf on June 01, 2006, 01:58:13 pm
Let's remove auto-target and auto-match-speed then. These things also make game easier and for sure are "doing things for the player".
Title: Re: Suggestion for new feature: Auto equalize shields
Post by: Mars on June 01, 2006, 03:46:21 pm
No they aren't, both of them are downright annoying.