-
Posts
129 -
Joined
-
Last visited
Content Type
Profiles
Downloads
Forums
Store
Support
DOWNLOADS EXTRA
Services
Everything posted by iLakSkiL
-
@aimacak Odd... Help me quick with a couple questions so I can test it and see: - What are your stack sizes for mlrs missiles on your server? - What are you setting the number of rockets to be fired? Is that an odd number? - Are they placing an odd number of rockets into the MLRS that is less than the maximum it will shoot? (i.e. placing 35 in when max to shoot is 48) The odd number shouldn't matter since, if the ammo left is greater than 12, it divides the total by 12 and returns the remainder plus one. (i.e. 35 % 12 = 11, or 37 % 12 = 1) So it will always return a number between 1-12, but never 0 or anything higher than 12, so it should never go out of the index range. So I'm kind of at a loss as to why this would happen. I'll try to do more testing with your parameters and see if I can reproduce it on my end.
-
This is the code for the MLRS entity's method of FireNextRocket, which is being reported where the error is happening. public void FireNextRocket() { float single; ServerProjectile _gravity; this.RocketAmmoCount = this.GetRocketContainer().inventory.GetAmmoAmount(2048); if (this.nextRocketIndex < 0 || this.nextRocketIndex >= this.RocketAmmoCount || base.IsBroken()) { this.EndFiring(); return; } StorageContainer rocketContainer = this.GetRocketContainer(); Vector3 _position = this.firingPoint.get_position() + (this.firingPoint.get_rotation() * this.rocketTubes[this.nextRocketIndex].firingOffset); float single1 = 1f; if (this.radiusModIndex < (int)this.radiusMods.Length) { single1 = this.radiusMods[this.radiusModIndex]; } this.radiusModIndex++; Vector2 _insideUnitCircle = (Random.get_insideUnitCircle() * (this.targetAreaRadius - this.RocketDamageRadius)) * single1; Vector3 trueHitPos = this.TrueHitPos + new Vector3(_insideUnitCircle.x, 0f, _insideUnitCircle.y); if (!base.TryFireProjectile(rocketContainer, 2048, _position, Ballistics.GetAimToTarget(this.firingPoint.get_position(), trueHitPos, this.rocketSpeed, this.vRotMax, this.rocketBaseGravity, this.minRange, out single), this.rocketOwnerRef.Get(true) as BasePlayer, 0f, 0f, out _gravity)) { this.EndFiring(); return; } _gravity.gravityModifier = single / -Physics.get_gravity().y; Interface.CallHook("OnMlrsRocketFired", this, _gravity); this.nextRocketIndex--; } I utilize the hook OnMLRSRocketFired in the plugin to change the default amount of rockets to fire. Otherwise, the MLRS will only shoot a maximum of 12 rockets regardless of how many are put in. Code is below for that private void OnMlrsRocketFired(MLRS ent, ServerProjectile serverProjectile) { if ((ent.RocketAmmoCount + rocketsFired) > _config.defsettings.rocketAmount) { ent.RocketAmmoCount = (_config.defsettings.rocketAmount - rocketsFired); } if (ent.RocketAmmoCount > 12) { ent.nextRocketIndex = (int)((ent.RocketAmmoCount % 12) + 1); rocketsFired++; return; } else { ent.nextRocketIndex = ent.RocketAmmoCount - 1; rocketsFired++; return; } } The only thing I can think of off the top of my head is that I have my math wrong in the else statement and the subtraction of 1 to the RocketAmmoCount when setting the nextRocketIndex is making it go out of bounds in certain cases, but I haven't run into this error myself while testing the plugin. Additionally, @aimacakreported an error in which "MLRS froze and tried to shoot (it was FIRING on the monitor), but for some reason it didn’t shoot, and every attempt to fire a rocket displayed a message in the console." That is odd, because assumingly, it should fire rockets, and only hang up on the last one if the nextRocketIndex reaches -1 (rocket ammo being 0 and then subtracting 1). But even then, when the ammo count is 0, the code should terminate before it doing another call of the OnMLRSRocketFired hook. If you can try to recreate the situation in which you encountered the error, that would be tremendously helpful. The config settings looked good too, so no idea as of now what caused this.
-
Changed Status from Pending to Work in Progress
-
Originally posted by @aimacak on Dec. 26, 2023 using version 1.4.0. IndexOutOfRangeException: Index was outside the bounds of the array. IndexOutOfRangeException: Index was outside the bounds of the array. at MLRS.FireNextRocket () [0x0005e] in <08999e34374f48d19390fa37537b5752>:0 at InvokeHandlerBase`1[T].DoTick () [0x00109] in <2568dd734f9b44aeb1eb636644ede180>:0 at InvokeHandlerBase`1[T].LateUpdate () [0x0000c] in <2568dd734f9b44aeb1eb636644ede180>:0
-
I re-uploaded the new file, and downloaded it, so 1.5.0 should be up now. Thanks for the heads up on that! Config looks good. I'm hoping it was maybe a one-time error. I'm going to create a support thread for your error and move the discussion over to that, and I'll try to tag you in it. Just to keep our discussion on it easier to follow.
-
Update 1.5.0 removes the StackSizeController integration. Players will be able to "overload" the MLRS, but it will only fire the number of rockets that you have set in the config. For example, if your stack sizes for ammo.rocket.mlrs is set to 1000, then players will be able to put 2,000 total rockets in the MLRS. However, if you have the MLRSDamage json config set to only fire 24 rockets, then it will shoot 24 rockets and there will be 1,976 rockets left in the MLRS container.
-
It wasn't working prior. The way the MLRS works, people are able to put up to whatever the stack size is for the ammo into the MLRS. On first moving inventory, it would stack lower, but then allow players to go over limit set in the plugin if the ammo stack sizes were larger. It was something that FP changed with how the containers worked in the MLRS. As of now, the only way to limit the maximum amount of rockets the MLRS can hold, is to limit the stack sizes of the ammo. I'm working on a fix that will allow you to set how many can be fired from the MLRS inventory, (i.e. if the stack size for ammo is set to 1,000; then the MLRS would hold 2,000; but you could say only fire 100 of the 2,000. So then there would 1,900 rockets left over in the MLRS.)
-
Changed Status from Pending to Closed Changed Fixed In to 1.4.0 Added in version 1.4.0. Thanks for the suggestion.
-
I could potentially work that in, in my latest re-write I'm working on. Im thinking a sort of special list, that's like the opposite of the blacklist. The list would apply a specific rate per listed item, globally for all, regardless of permission group. It would be way too cumbersome to make players set specific items for each specific group. I like the idea of a global list multiplier that would either override the group setting, or could multiply/divide group settings too.
- 25 comments
-
- #gathering
- #gather rates
- (and 11 more)
-
Changed Status from Pending to Work in Progress Changed Fixed In to Next Version
-
Not sure on exact issue. FacePunch likes to change things from time to time. My hope is that my newest update will fix any previous hook issues.
-
Originally, OnRandomItemAward dealt with the random chance of receiving Worms/Grubs from plants, but it appears that FP has now included seeds into that mechanic. This should be addressed in version 3.0.0
-
Changed Status from Pending to Work in Progress Changed Fixed In to Next Version
-
Changed Status from Pending to Not a Bug
-
Sorry for delay. You use it by setting the permission group names in the CustomGather.json config file. However, I am re-writing the plugin from the ground up, and the newest version 3.0.0 will use permission groups that you can assign in PermissionsManager or through console.
-
Changed Status from Pending to Work in Progress Changed Fixed In to Next Version
-
I am re-writing the plugin from the ground up. So any issues with this should be resolved in version 3.0.0 coming soon.
-
Changed Status from Pending to Closed Changed Fixed In to Next Version
-
Added in newest release (version 1.1.0)
-
Changed Status from Pending to Work in Progress
-
Changed Status from Pending to Closed Changed Fixed In to 2.1.2