UPak weapons do not shoot

Discussions about Servers
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

UPak weapons do not shoot

Post by Barbie »

Recently I played the map MH-IceSkaarjPrologue: playing locally everything works fine, but if map runs on server, the UPack weapons ("RocketLauncher", "GrenadeLauncher", "CARifle") do not shoot. They DO shoot, if I press fire button and switch to the weapon by mouse wheel. But that's not a satisfying solution.^^ Furthermore I get ugly ScriptWarnings on client:
Spoiler
ScriptWarning: SBHealingGun MH-IceSkaarjPrologue.SBHealingGun0 (Function Botpack.TournamentWeapon.ClientDown.AnimEnd:0088) GotoState (ClientActive None): State not found
ScriptWarning: TFemale1 MH-IceSkaarjPrologue.TFemale2 (Function Botpack.TournamentPlayer.ReplicateMove:0085) GotoState (ClientActive None): State not found
ScriptWarning: TranslocatorSB MH-IceSkaarjPrologue.TranslocatorSB0 (Function Botpack.TournamentWeapon.ClientDown.AnimEnd:0088) GotoState (ClientActive None): State not found
ScriptWarning: TFemale1 MH-IceSkaarjPrologue.TFemale2 (Function Botpack.TournamentPlayer.ReplicateMove:0085) GotoState (ClientActive None): State not found
ScriptWarning: TFemale1 MH-IceSkaarjPrologue.TFemale2 (Function Botpack.TournamentPlayer.ReplicateMove:0085) GotoState (ClientActive None): State not found
ScriptWarning: TFemale1 MH-IceSkaarjPrologue.TFemale2 (Function Botpack.TournamentPlayer.ReplicateMove:0085) GotoState (ClientActive None): State not found
ScriptWarning: TranslocatorSB MH-IceSkaarjPrologue.TranslocatorSB0 (Function Botpack.TournamentWeapon.ClientDown.AnimEnd:0088) GotoState (ClientActive None): State not found
ScriptWarning: TFemale1 MH-IceSkaarjPrologue.TFemale2 (Function Botpack.TournamentPlayer.ReplicateMove:0085) GotoState (ClientActive None): State not found
ScriptWarning: enforcer MH-IceSkaarjPrologue.enforcer0 (Function Botpack.TournamentWeapon.ClientDown.AnimEnd:0088) GotoState (ClientActive None): State not found
Before I dig into the code of that package: Is there an easy possibility to get them work?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: UPak weapons do not shoot

Post by sektor2111 »

UPak = UnrealI = UnrealShare = No Net Code stuff
Solutions:
- WTriggerer - or such - like this one;
- UT2U1 - by Loathsome;
- XC_Engine v16 by Higor.
Too bad I though that you read this forum.
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: UPak weapons do not shoot

Post by MrLoathsome »

Very interesting.

I ran into the exact same issue during some testing last week.

But it was not MH. I was testing EXU2 coopgame2 gametype online with the DK and UTLNP SP maps.
The EXU weapons and other guns I was adding to the game all worked fine.
Could only shoot the U1/UPack weapons if I did the same thing you did, switch to the gun while firing.
(Agreed. Not acceptable.) Didn't check the client log so not sure if the same warnings showed up or not.

Not sure at this point if it is the same issue, but it seems likely.

If you try the UT2U1 tweak, let me know how it goes. I think it works with MH, but haven't tested that.
Would be interested to know if it fixes these issues in that gametype.
Only thing it doesn't work with that I currently know about is Oldskool.coopgame2.

Note: The Upak/U1 weapons do indeed contain net code stuff and work online.... :loool:
With the UT2U1 tweak running on a UT server I can mix all those weapons and UT99 weapons online without any issues.
They also have been working fine online on the coop servers without this issue for years.
blarg
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: UPak weapons do not shoot

Post by Higor »

sektor2111 wrote:Too bad I though that you read this forum.
Yep lol.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: UPak weapons do not shoot

Post by Barbie »

sektor2111 wrote:Too bad I though that you read this forum.
All posts of UT99.org? You're joking :roll:
Actually I did a search for "UPak" in this forum and got a bunch of results, but - I apologize - didn't fully understand what these threads deal with; I've never heard before of that UPak and its weapons. And if I read "Old Weapons" I think of Unreal's Eightball or Minigun and they are working.
sektor2111 wrote:Solutions:
- WTriggerer - or such - like this one;
- UT2U1 - by Loathsome;
- XC_Engine v16 by Higor.
Thanks for your summary - such I was looking for. :gj:
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: UPak weapons do not shoot

Post by sektor2111 »

MrLoathsome wrote:Note: The Upak/U1 weapons do indeed contain net code stuff and work online.... :loool:
Yes, It's impressive SeekingRocket On-Line and TournamentPlayer firing it...
Barbie wrote:All posts of UT99.org? You're joking :roll:
For sure not. But If you mind 2015-2016 general posts by Greens or others, which are not bullshitting you'll find more stuff good to know and you might have answers in advance. Else I think I read the most of Higor's posts because... he knows enough things helpful. Another dude which has 2 dumb posts or unrelated to nothing from UT99 for sure won't be "hunted for reading". I read even Billy's posts - that man was telling some truth in harder way but for me this is not really disturbing. The rest of Persons who don't care about others, full of themselves I could only enjoy their outage (without names of course - RULE no. 1). For UT was a need to pass almost 10 years until an "evil mad" (me was that) to find a cheap solution for firing a stupid Flak On-Line properly and to see that FlakAmmo IS NOT BUGGED as described in a stupid "Coop" mod - a lousy wreck. How in Mother of God to have bugs in a null code class similar with the rest "un-bugged" ? Where are bugs if we have no scripts and the rest do works properly ?
Last edited by sektor2111 on Thu Apr 28, 2016 9:04 pm, edited 1 time in total.
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: UPak weapons do not shoot

Post by Higor »

XC_Engine has a linux version too, but v16 is only v436 friendly.
For v451 you're gonna need to wait for v17.

In the meantime... this is how the weapon thing is solved.
This function is called upon map load to apply the hook.

Code: Select all

//Make Unreal weapons fire on UT, this looks like an Epic Games limitation, shame on them

/*
function ForceFire()
{
	Fire(0);
}
*/

void UXC_GameEngine::ReplaceForceFireFunc( UBOOL bSet)
{
	guard(UXC_GameEngine::ReplaceForceFireFunc);

	UFunction* ForceFire = FindBaseFunction( AWeapon::StaticClass(), TEXT("ForceFire"));
	if ( !ForceFire ) //Script not serialized?
		return;

	if ( OldForceFire.IsCleared() && (!bSet || !OldForceFire.Setup( &ForceFire->Script )) )
		return;
	
	if ( !bSet )
	{
		OldForceFire.Restore( &ForceFire->Script);
		if ( bEnableDebugLogs )
			debugf( NAME_XC_Engine, TEXT("Reverting Weapon.ForceFire hook") );
		return;
	}
	else if ( OldForceFire.MismatchSize(&ForceFire->Script) )
		return;

	FName Name_Fire = FName( TEXT("Fire"), FNAME_Find); //Should never fail

	ForceFire->Script.Empty();
	ForceFire->Script.AddZeroed( 13);
	BYTE* Block = &ForceFire->Script(0);

	*Block++ = 0x1B;	//EX_VirtualFunction (1)
	Block += WriteINT( Block, Name_Fire.GetIndex()); // (5)
	*Block++ = 0x1E;	//EX_FloatConst (6)
	Block += WriteINT( Block, 0); //0.f (10)
	*Block++ = 0x16;	//EX_EndFunctionParams (11)
	AddReturn( Block );	// (13)

	if ( bEnableDebugLogs )
		debugf( NAME_XC_Engine, TEXT("Weapon.ForceFire hook success"));
	unguard;
}
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: UPak weapons do not shoot

Post by Barbie »

Now I see a sense in that MonsterHunt weapons "OLStinger", "OLRifle", ... These are ports of the old Unreal weapons, right? And the UPak' weapons are not part of MonsterHunt, I guess, and so they don't work out of the box here.
Furthermore now I understand the condition I saw at some places finally:

Code: Select all

if (Other.IsA('Weapon') &&  ! Other.IsA('TournamentWeapon'))
I've never dealt with this matter because until now all old weapons have just worked.

With one of the workarounds mentioned above the replacements for the old Unreal weapons found in MonsterHunt2Gold.MH2Base.uc for example would not be necessary any more?

Code: Select all

// example of one replacement:
if(Other.Class==Class'Stinger') {
  ReplaceWith(Other, "MonsterHunt.OLStinger");
  return false;
}
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: UPak weapons do not shoot

Post by sektor2111 »

Barbie wrote:Now I see a sense in that MonsterHunt weapons "OLStinger", "OLRifle", ... These are ports of the old Unreal weapons, right?
...
I've never dealt with this matter because until now all old weapons have just worked.
No, they are TournamentWeapons and that's why they were working having old meshes and some people have been fooled years because it is not explained well in any official doc what was about and then due to default raw replacement we have another series of issues. The rest of "TournamentWeapons" have nothing to do with TournamentPlayer, here we add "push-tool".
User avatar
EvilGrins
Godlike
Posts: 9668
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: UPak weapons do not shoot

Post by EvilGrins »

Must all weapons shoot?
Can we not find other means of solving our disputes?
I say we all go into MonsterHunt, find a large and violent beastie, and hug it out!
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: UPak weapons do not shoot

Post by MrLoathsome »

You funny.

But seriously. If you need some more weapons that don't shoot, let me know.

I will hook you up quick..
Bet I can make a weapon that won't fire under any conditions.
:pfff: :omfg: :barf:

It will be a cool looking weapon. With lots of extra features that
don't work, and custom ammo that doesn't explode.
blarg
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: UPak weapons do not shoot

Post by MrLoathsome »

Barbie wrote:Now I see a sense in that MonsterHunt weapons "OLStinger", "OLRifle", ... These are ports of the old Unreal weapons, right? And the UPak' weapons are not part of MonsterHunt, I guess, and so they don't work out of the box here.
Furthermore now I understand the condition I saw at some places finally:

Code: Select all

if (Other.IsA('Weapon') &&  ! Other.IsA('TournamentWeapon'))
I've never dealt with this matter because until now all old weapons have just worked.

With one of the workarounds mentioned above the replacements for the old Unreal weapons found in MonsterHunt2Gold.MH2Base.uc for example would not be necessary any more?

Code: Select all

// example of one replacement:
if(Other.Class==Class'Stinger') {
  ReplaceWith(Other, "MonsterHunt.OLStinger");
  return false;
}
OLStinger, OLRifle etc. are the Oldskool versions of all those original Unreal weapons.

If my memory is still working the cool UPak weapons were first shipped with the UTLNP SP/Coop maps long ago.
Pretty sure that mission had/has U1 weapons, UT weapons and the UPak weapons all working together on the same
maps without this issue. Working fine way back when oldskool.coopgame2 was the only option at the time.
It was the 2nd Unreal SP mission port for UT/Oldskool after the DK maps.
There were 2 versions of it released. The best one is still running on my coop servers.

I never look at code within maps because I dislike UED that much, but they must have done
something in there to make all the weapons work together.

As mentioned, using the UT2U1 tweak should solve your issues, unless you are running an oldskool.coopgame2 gametype
or something based on it. It will enable all the weapons to work together in every other gametype I have tested it
with. Which doesn't include monsterhunt. Would be interested to know any results you get if you try it with MH.

*Edit: Those UPak weapons, would be great with just a few minor adjustments. They are just a bit weak in the damage department.
blarg
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: UPak weapons do not shoot

Post by sektor2111 »

Te he, I ran a few moments ago a default MH session with a few old wepsy and WTriggerer.
To drew conclusion: I'm really stupid. Why I did not made this thing earlier, some 5 years ago, LOL ?
[attachment=0]Razor.png[/attachment]
Yo, hunters freaks, do you have ever seen this in Original MH ? Does it work ? He, he... No worries is not a Local Game, it's a Net Game.
Ahah, now I have to slap duwn, that trash as I recall vague a name ...MonsterofSpam... with some bStatic craps loading logs with manure...
Attachments
Razor.png
Post Reply