Can someone here point me in the right direction please

Discussions about Coding and Scripting
Post Reply
sXs-sketchpad
Experienced
Posts: 131
Joined: Sun Mar 29, 2020 3:37 am
Contact:

Can someone here point me in the right direction please

Post by sXs-sketchpad »

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: 9698
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

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

Post by EvilGrins »

Screenshots, please.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
sXs-sketchpad
Experienced
Posts: 131
Joined: Sun Mar 29, 2020 3:37 am
Contact:

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

Post by sXs-sketchpad »

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
Attachments
GeofG11.rar
(1.1 MiB) Downloaded 14 times
Image
sXs-sketchpad
Experienced
Posts: 131
Joined: Sun Mar 29, 2020 3:37 am
Contact:

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

Post by sXs-sketchpad »

Anybody there lol
Image
User avatar
Barbie
Godlike
Posts: 2802
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 »

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
Experienced
Posts: 111
Joined: Mon Oct 19, 2020 6:53 pm

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

Post by f7r »

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: 1462
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Resident Wallaby
Location: Porto Alegre, Brazil
Contact:

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

Post by Gustavo6046 »

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.
"Everyone is an idea man. Everybody thinks they have a revolutionary new game concept that no one else has ever thought of. Having cool ideas will rarely get you anywhere in the games industry. You have to be able to implement your ideas or provide some useful skill. Never join a project whose idea man or leader has no obvious development skills. Never join a project that only has a web designer. You have your own ideas. Focus on them carefully and in small chunks and you will be able to develop cool projects."

Weapon of Destruction
Post Reply