Can someone here point me in the right direction please

Discussions about Coding and Scripting
sXs-sketchpad
Average
Posts: 72
Joined: Sun Mar 29, 2020 3:37 am

Can someone here point me in the right direction please

Post by sXs-sketchpad » Wed Dec 02, 2020 5:41 pm

Hi guys and girls I'm hoping someone can point me in the right direction.


I'm using a Geoff sledge type gun on my server it's a rapid fire weapon when crouched and single shot while running.

Is there any posts here that can help me to change the single shot to rapid fire I'm a bit of a noob with this sort of thing would like to try and do it if I can and how easy is it to do.

Thanks
Image

User avatar
EvilGrins
Godlike
Posts: 7896
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA

Re: Can someone here point me in the right direction please

Post by EvilGrins » Wed Dec 02, 2020 5:55 pm

Screenshots, please.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758

sXs-sketchpad
Average
Posts: 72
Joined: Sun Mar 29, 2020 3:37 am

Re: Can someone here point me in the right direction please

Post by sXs-sketchpad » Wed Dec 02, 2020 6:55 pm

Hi mate I'm not at home for about a week so no piccys but I've attached the gun it's the geoff_v9 one with the blue crosshairs it fires single shot when running and rapid fire when crouched or standing still.

I have the explosive rounds one on the server also wich fires rapid while running or crouching that one is fine I'm using the tracer rounds one at the moment but want to see if I can modify the other one hope this all makes sense.


Also I would like to know how to maybe put sXs on it not sure if I'm clever enough for that though


Thanks


P.s also did you see I gave you your own room on our forum seeing as though you are pretty much the only other person besides me who puts stuff on there lol
You do not have the required permissions to view the files attached to this post.
Image

sXs-sketchpad
Average
Posts: 72
Joined: Sun Mar 29, 2020 3:37 am

Re: Can someone here point me in the right direction please

Post by sXs-sketchpad » Sat Dec 05, 2020 10:29 am

Anybody there lol
Image

User avatar
Barbie
Godlike
Posts: 2069
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Can someone here point me in the right direction please

Post by Barbie » Sat Dec 05, 2020 2:44 pm

Your archive contains only compiled code. Is any source code available?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
f7r
Novice
Posts: 21
Joined: Mon Oct 19, 2020 6:53 pm

Re: Can someone here point me in the right direction please

Post by f7r » Sat Dec 05, 2020 5:13 pm

I look into GeofG11_v9.u only.
In my layman opinion, I suppose the point is that here:

Code: Select all

simulated function PlayFiring()
{
	local int r;

      PlayOwnedSound(FireSound, SLOT_None, Pawn(Owner).SoundDampening*3.0);
      bSteadyFlash3rd = True;
	
      if ( (Owner.Physics != PHYS_Falling && Owner.Physics != PHYS_Swimming && Pawn(Owner).bDuck != 0)
	   || Owner.Velocity == 0 * Owner.Velocity )
         PlayAnim('fire',0.7 + 0.7 *(FireAdjust*17.0), 0.05);
      else
         PlayAnim('fire',0.2 + 0.2 *(FireAdjust*3.0));


	if ( (PlayerPawn(Owner) != None)
		&& (PlayerPawn(Owner).DesiredFOV == PlayerPawn(Owner).DefaultFOV) )
		bMuzzleFlash++;

}
i.e. branching at PlayAnim()

Ducking also affects shooting accuracy:

Code: Select all

     --------------------- <...>
			if ( (Owner.Physics != PHYS_Falling && Owner.Physics != PHYS_Swimming && Pawn(Owner).bDuck != 0)
			   || Owner.Velocity == 0 * Owner.Velocity )
				TraceFire(0.0);
			else
				TraceFire(16);
     --------------------- <...>
function TraceFire( float Accuracy )	
     --------------------- <...>
	EndTrace = StartTrace + Accuracy * (FRand() - 0.5 )* Y * 1000
		+ Accuracy * (FRand() - 0.5 ) * Z * 1000;
     --------------------- <...>
and huge damage... and add ammo ??? :shock:

Code: Select all

if ( Other.bIsPawn && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight)
		&& (instigator.IsA('PlayerPawn') || (instigator.IsA('Bot') && !Bot(Instigator).bNovice))
		&& ((Owner.Physics != PHYS_Falling && Owner.Physics != PHYS_Swimming && Pawn(Owner).bDuck != 0)
		|| Owner.Velocity == 0 * Owner.Velocity) )
		{
			if ( Pawn(Other).Health > 0 )
			{
				Other.TakeDamage(100000, Pawn(Owner), HitLocation, 35000 * X, AltDamageType);

				if ( Pawn(Other).Health < 1
				    && (!Level.Game.bTeamGame || Pawn(Owner).PlayerReplicationInfo.Team != Pawn(Other).PlayerReplicationInfo.Team) )
					AmmoType.AddAmmo(3);
			}
			else
				Other.TakeDamage(100000, Pawn(Owner), HitLocation, 35000 * X, AltDamageType);
		}
		else
			Other.TakeDamage(45,  Pawn(Owner), HitLocation, 30000.0*X, MyDamageType);
This behavior is not configurable. I don't know which would be easier, recompile or subclass. I have not done either one yet. :noidea: :wink:

User avatar
Gustavo6046
Godlike
Posts: 1158
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Zeta Group leader

Re: Can someone here point me in the right direction please

Post by Gustavo6046 » Sat Dec 05, 2020 5:43 pm

Barbie wrote:
Sat Dec 05, 2020 2:44 pm
Your archive contains only compiled code. Is any source code available?
.u files tend to come with the source code (which can be viewed e.g. from UnrealEd, or exported using ucc). It is possible to strip them, but in this instance they weren't.
Gee, you.
f7r wrote:
Sat Dec 05, 2020 5:13 pm
This behavior is not configurable. I don't know which would be easier, recompile or subclass. I have not done either one yet. :noidea: :wink:
I believe that in this situation subclassing would be preferable. Avoid conflicts when you can!

In fact, making it fully configurable (with config vars and whatnot) is probably the best option once you do, to prevent more and more subclasses and additional confusion.