[Solved]MH2GoldCTG : Forced weapons position :
-
Letylove49
- Masterful
- Posts: 506
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
[Solved]MH2GoldCTG : Forced weapons position :
Hello everyone, does anyone know how to choose the location of each weapon on a server, so it forces every weapons in the location we decide for our MonsterHuntCTG, for example force the sniper to be forced in "center" So it would be choosing the location of the weapons that we want, whether it is right, center or left.
Last edited by Letylove49 on Tue Feb 24, 2026 2:10 pm, edited 3 times in total.
-
DsL444
- Novice
- Posts: 21
- Joined: Tue Sep 12, 2023 5:21 pm
- Location: Germany
-
Barbie
- Godlike
- Posts: 3318
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: weapons position :
Code: Select all
if (FindActorByName('SniperRifle0', A, 'SniperRifle')) A.SetLocation(vect(1, 2, 3));"If Origin not in center it be not in center." --Buggie
-
HeadHuntiing
- Novice
- Posts: 7
- Joined: Sat May 03, 2025 11:39 am
- Personal rank: CTG Founder/MHA HEAD
- Location: France
Re: weapons position :
normally I don't have time to take care of what LetyLove need to because I work on a lot of things, but at the level of the positioning of the weapons I have been taking care of it since yesterday a little, with the little free time i have, I know how to do it, I edit the settings of the weapon, I know how to do it but I will need do more tests, but I asked LetyLove to do this post because maybe there exist a mutator etc, (I STILL SEND YOU THE CODE JUST IN CASE) : PlayerViewOffset=(X=0.000000,Y=0.000000,Z=-1.700000)
function SetHand(float Hand)
{
Mesh = mesh'Botpack.Rifle2m';
MultiSkins[0] = Texture'MH2GoldCTGv3.Rifle.AA';
MultiSkins[1] = Texture'MH2GoldCTGv3.Rifle.SR';
MultiSkins[3] = Texture'MH2GoldCTGv3.Rifle.Rifle2d';
PlayerViewOffset = vect(0.0, 0.0, -1.7);
}
function SetHand(float Hand)
{
Mesh = mesh'Botpack.Rifle2m';
MultiSkins[0] = Texture'MH2GoldCTGv3.Rifle.AA';
MultiSkins[1] = Texture'MH2GoldCTGv3.Rifle.SR';
MultiSkins[3] = Texture'MH2GoldCTGv3.Rifle.Rifle2d';
PlayerViewOffset = vect(0.0, 0.0, -1.7);
}
-
Letylove49
- Masterful
- Posts: 506
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: weapons position :
Barbie wrote: ↑Sun Sep 07, 2025 9:06 amCode: Select all
if (FindActorByName('SniperRifle0', A, 'SniperRifle')) A.SetLocation(vect(1, 2, 3));
we must add this function into the MH2 or the weapon ?
-
Barbie
- Godlike
- Posts: 3318
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: weapons position :
I think I misunderstood your question - you want to force a player having the weapon on left, right or center and NOT moving weapons in a map?
"If Origin not in center it be not in center." --Buggie
-
Letylove49
- Masterful
- Posts: 506
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: weapons position :
Yes we want to force the weapon on the center,
-
HeadHuntiing
- Novice
- Posts: 7
- Joined: Sat May 03, 2025 11:39 am
- Personal rank: CTG Founder/MHA HEAD
- Location: France
Re: weapons position :
What he's saying is that we need to force the MH2Rifle to be displayed in the center, ignoring the players' weaponhand UT settings. We know it's possible, but we were mainly asking in case a mutator or something else already existed, instead of me doing a lots of testing, because I'm currently looking into it, but at the same time, I don't necessarily have the time because I'm always working on dozens of projects at the same time.
In any case, it's forcing the sniper to be played in the center.
In any case, it's forcing the sniper to be played in the center.
-
Letylove49
- Masterful
- Posts: 506
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Force weapons position on MH
i get bad function definition, what is wrong ?
// Force position of weapons (forced on center and ignore client settings.)
Function Force weapon postion (Weaponclass, Vect)
if (FindActorByName('MH2Rifle', A, 'MH2Rifle')) A.SetLocation(vect(2));
-
Letylove49
- Masterful
- Posts: 506
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
-
lafoxxx
- Average
- Posts: 56
- Joined: Sun Jun 01, 2025 7:31 pm
- Personal rank: UNUSED
Re: weapons position :
Hi I have slightly different question but will ask here in order not to duplicate threads.
So, I use keybinding to set "handedness" to -1 or 1, but it only applies after I open Preferences.
But for some weapons its muzzleflash moves left to right as I push the buttons -- but not the model (also -- unless I open Preferences).
Sniper rifle reacts to button presses, it gets "tilted" slightly -- but still not changes its position (you guessed it -- unless I open Preferences).
What shall I apply to "append" the new position without opening Preferences?
So, I use keybinding to set "handedness" to -1 or 1, but it only applies after I open Preferences.
But for some weapons its muzzleflash moves left to right as I push the buttons -- but not the model (also -- unless I open Preferences).
Sniper rifle reacts to button presses, it gets "tilted" slightly -- but still not changes its position (you guessed it -- unless I open Preferences).
What shall I apply to "append" the new position without opening Preferences?
-
Letylove49
- Masterful
- Posts: 506
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MH2GoldCTG : Forced weapons position :
i have try this function but i got type mismatch in = , what is wrong ?
i wisch to know if this is correct :
exec Function bool setHand(string Handname)
{
Local byte Hand;
Local bool SetHand;
if(Hand!=0)
LeftName=Hand=0;
if(Hand!=1)
CenterName= Hand=1;
if(Hand!=2)
RightName= Hand=2;
if(Hand!=3)
HiddenName= Hand =3;
}
i wisch to know if this is correct :
if(UseAltSniper)
if(Hand!=1)
exec other.ConsoleCommand("sethand center" );
GiveWeapon(Other,class'MH2Rifle');
else
GiveWeapon(Other,class'Botpack.SniperRifle');
if(Hand!=1)
exec other.ConsoleCommand("sethand center" );
-
Barbie
- Godlike
- Posts: 3318
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: MH2GoldCTG : Forced weapons position :
Assuming LeftName is if type bool you should use
Apart from that the code looks
LeftName = Hand == 0;Apart from that the code looks
"If Origin not in center it be not in center." --Buggie
-
Letylove49
- Masterful
- Posts: 506
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MH2GoldCTG : Forced weapons position :
ok i will try that too.
i have try this and that i can compile but that doesnt work.
exec Function bool setHand( byte Hand)
{
//Change value to new value
if(Hand!=0)
Hand = 0;
if(Hand!=1)
Hand = 1;
if(Hand!=2)
Hand = 2;
if(Hand!=3)
Hand = 3;
}
-
Barbie
- Godlike
- Posts: 3318
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: MH2GoldCTG : Forced weapons position :
That code does nothing except burning some CPU cycles. It has no return value and the function parameter is not by reference, so changes of it do only remain within function scope. Also at end of functionLetylove49 wrote: ↑Sat Jan 24, 2026 2:37 pm i have try this and that i can compile but that doesnt work.
Code: Select all
exec Function bool setHand( byte Hand) { //Change value to new value if(Hand!=0) Hand = 0; if(Hand!=1) Hand = 1; if(Hand!=2) Hand = 2; if(Hand!=3) Hand = 3; }
Hand has always the value 3.It is a good habit to write a short comment at the function header: What should that code do, what is the range of function's return value and what range the parameters may have.
"If Origin not in center it be not in center." --Buggie