[Solved]MonsterhuntCTG : postion weapons forced :
-
Letylove49
- Masterful
- Posts: 537
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
[Solved]MonsterhuntCTG : postion weapons forced :
we would like to be able to force the position of certain weapons in MonsterhuntCTG how can I do that?
You do not have the required permissions to view the files attached to this post.
Last edited by Letylove49 on Tue Feb 24, 2026 2:13 pm, edited 2 times in total.
-
Barbie
- Godlike
- Posts: 3369
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: MonsterhuntCTG : postion weapons forced :
Move existing weapons? Maybe so:
Code: Select all
local Actor A;
if (FindActorByName('Ripper12', A, 'Ripper'))
A.SetLocation(vect(-9616, -3002, -203));
function FindActorByName()
Code: Select all
function bool FindActorByName(name ActorName, out Actor FoundActor, optional name ActorTag) {
local Actor A;
foreach AllActors(class'Actor', A, ActorTag)
if (A.Name == ActorName)
{
FoundActor = A;
return true;
}
warn(ActorName @ "not found");
return false;
}"If Origin not in center it be not in center." --Buggie
-
Letylove49
- Masterful
- Posts: 537
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MonsterhuntCTG : postion weapons forced :
Thanks Barbie,
i have the function findActor on MH2Base
and added the code on my weapons ;
but i get Missing ) in If. i don't understand why i got this error.
i have the function findActor on MH2Base
and added the code on my weapons ;
Code: Select all
function setHand(float Hand)
{
local Actor A;
if (FindActorByName('MH2Rifle', A, 'Sniperrifle'))
A.SetLocation(vect(-9616, -3002, -203));
Super.SetHand(Hand);
if ( Hand == 1 )
{
Mesh = mesh(DynamicLoadObject("Botpack.Rifle2mL", class'Mesh'));
MultiSkins[0] =Texture'MH2GoldCTGv6b.Rifle.AA';
MultiSkins[1] =Texture'MH2GoldCTGv6b.Rifle.SR';
MultiSkins[3] =Texture'MH2GoldCTGv6b.Skins.Rifle2d';
}
else
{
Mesh = mesh'Rifle2m';
MultiSkins[0] =Texture'MH2GoldCTGv6b.Rifle.AA';
MultiSkins[1] =Texture'MH2GoldCTGv6b.Rifle.SR';
MultiSkins[3] =Texture'MH2GoldCTGv6b.Rifle.Rifle2d';
}
}-
Barbie
- Godlike
- Posts: 3369
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: MonsterhuntCTG : postion weapons forced :
It looks like the function
FindActorByName(...) in line 3 of your above code snippet is not known. If you want access is from different classes, you may define the function as static."If Origin not in center it be not in center." --Buggie
-
Letylove49
- Masterful
- Posts: 537
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MonsterhuntCTG : postion weapons forced :
ok. thanks
what i must put on paramettre 3 ?
1= weapons classs in my case is MH2Rifle
but i don't know what i must put in 3.
Code: Select all
if (FindActorByName('MH2Rifle', A, 'MH2RifleHUDMutator'))1= weapons classs in my case is MH2Rifle
but i don't know what i must put in 3.
-
Barbie
- Godlike
- Posts: 3369
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: MonsterhuntCTG : postion weapons forced :
Open map in UnrealEd, select that weapon, press F4 for window "Actor Properties", and use what is given at Object>Name and Events>Tag for function FindActorByName().
But your compiling problem has nothing to do with that.
But your compiling problem has nothing to do with that.
"If Origin not in center it be not in center." --Buggie
-
Letylove49
- Masterful
- Posts: 537
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MonsterhuntCTG : postion weapons forced :
ok thanks so i have dot that on my weapon class MH2Rilfe.uc
but i don't see where ) is missing . i have 2( and 2). why i got this error ?
Code: Select all
if (FindActorByName('MH2GoldCTGv6b.MH2Rifle', A, 'None'))-
Barbie
- Godlike
- Posts: 3369
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: MonsterhuntCTG : postion weapons forced :
Maybe an example will help: in map MH-BattleCrypt.unr is a ShockRifle buried in a stair and I want to lift it up a bit with code while the map is loaded.
I open the map in UnrealEd and look at the properties of the shockrifle: When the map is loaded, the following code is executed:
I open the map in UnrealEd and look at the properties of the shockrifle: When the map is loaded, the following code is executed:
Code: Select all
if (FindActorByName('ShockRifle0', A, 'ShockRifle')) // stucks in stairway
A.SetLocation(vect(-171, 94, 680));
You do not have the required permissions to view the files attached to this post.
"If Origin not in center it be not in center." --Buggie
-
Letylove49
- Masterful
- Posts: 537
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MonsterhuntCTG : postion weapons forced :
i have open the weapoins poperty i got this:
and i have added this variable : var bool FindActorByName;
and i still get the same error.
i want to forced on center. ( position Left, Center, Right, hidden)
and i have added this variable : var bool FindActorByName;
and i still get the same error.
i want to forced on center. ( position Left, Center, Right, hidden)
You do not have the required permissions to view the files attached to this post.
-
UT Sniper (SJA94)
- Inhuman
- Posts: 767
- Joined: Thu Jun 24, 2010 10:35 pm
- Personal rank: Retard
- Location: England
Re: MonsterhuntCTG : postion weapons forced :
I think she might be talking about the weapon hand position not a certain weapon on a map.
-
Letylove49
- Masterful
- Posts: 537
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MonsterhuntCTG : postion weapons forced :
Yes is that i would like to do.UT Sniper (SJA94) wrote: ↑Sat Jan 17, 2026 12:19 am I think she might be talking about the weapon hand position not a certain weapon on a map.
-
Barbie
- Godlike
- Posts: 3369
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: MonsterhuntCTG : postion weapons forced :
Do I have a flashback here?Letylove49 wrote: ↑Sat Jan 17, 2026 10:34 amYes is that i would like to do.UT Sniper (SJA94) wrote: ↑Sat Jan 17, 2026 12:19 am I think she might be talking about the weapon hand position not a certain weapon on a map.
Auto merged new post submitted 2 minutes later
Yes, see thread weapons position
"If Origin not in center it be not in center." --Buggie
-
Letylove49
- Masterful
- Posts: 537
- Joined: Tue Feb 28, 2012 7:47 pm
- Personal rank: AK admin
- Location: suisse
Re: MonsterhuntCTG : postion weapons forced :
it seemed to me that I had already made a post on this subject but I didn’t find it. I must not have looked well. I will continue on the old Topic.Barbie wrote: ↑Sat Jan 17, 2026 5:35 pmDo I have a flashback here?Letylove49 wrote: ↑Sat Jan 17, 2026 10:34 amYes is that i would like to do.UT Sniper (SJA94) wrote: ↑Sat Jan 17, 2026 12:19 am I think she might be talking about the weapon hand position not a certain weapon on a map.![]()
Auto merged new post submitted 2 minutes later
Yes, see thread weapons position
For the error I get when I try to compile " i get Missing) ) in If. because otherwise I cannot move forward in my project as long as I get this error. and I don’t know how to correct it, so I really need a solution. This positioning project is really important for us.
