Data Realms Fan Forums
http://forums.datarealms.com/

Assault rifle with recoil-affected aiming
http://forums.datarealms.com/viewtopic.php?f=1&t=15924
Page 1 of 3

Author:  MacAnkka [ Sun Jul 19, 2009 1:32 pm ]
Post subject:  Assault rifle with recoil-affected aiming

I've never really liked the way assault rifles work in this game. You can't fire accurate single shots with them, so there's no point in firing them in any other way than full auto. So I decided to do something about it. I tried to make an assault rifle that gets more inaccurate the more shots you fire continuously with some Lua magic. This is also the my first mod.

It's very accurate if you fire single shots or short bursts, but if you fire long on full auto, it get quite inaccurate very fast.

The rifle is named and sprited after the Finnish Defense Forces rifle, 7,62RK95TP (7.62 caliber Rynnäkkökivääri[assault rifle] model 95 taittoperä[collapsable stock]).

This is basically just a quick hack, so the actual coding is not amazing (read: it's awful). If someone wants to improve it or something, please go ahead. Have a look at the lua if you're interested.

One problem I've noticed: if you reset the scene or start a new one, you have to enter this in to the console after that, or the aiming will be inaccurate all the time:
aimTimer:Reset();

Image

Attachments:
762RK95.rte.zip [30.25 KiB]
Downloaded 327 times

Author:  capnbubs [ Sun Jul 19, 2009 1:49 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Very nice work, gives a really nice feel to the rifle.

With your permission I would like to incorporate something similar to this in my mod, that cool with you?

Author:  MacAnkka [ Sun Jul 19, 2009 2:13 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Thanks, glad to hear you like it.

And sure, use it or any ideas you get from it in any way you like.

Author:  Areku [ Sun Jul 19, 2009 2:47 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

...
I was trying to make one of those for a long time. :x

No matter, you've pulled it off beautifully. Would you give permission for me to use it on one of my mods?

Author:  MacAnkka [ Sun Jul 19, 2009 3:15 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Yeah, you can use it. Same goes for anyone else who's interested in using it.

Author:  MaximDude [ Sun Jul 19, 2009 5:28 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Well, this is quite innovative. I think i'll use it in a few of my weapons.

Good job, sire. :D

Author:  piipu [ Sun Jul 19, 2009 5:36 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Though you get double recoil when 2 rifles are fired at the same time. I think I'll do some fiddling with the shooter's AimAngle.
Edit: 10 minutes of fiddling caused the following script:
Code:
function Create(self)
   for actor in MovableMan.Actors do
      if (actor.Pos - self.Pos).Magnitude < 60 and math.abs(actor:GetAimAngle(true) - self.Vel.AbsRadAngle) < 0.2 then
         actor:SetAimAngle(actor:GetAimAngle(false) + 0.1)
      end
   end
end
Sadly, mouse aiming isn't affected by it.

Author:  mail2345 [ Sun Jul 19, 2009 8:24 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

MacAnkka wrote:
One problem I've noticed: if you reset the scene or start a new one, you have to enter this in to the console after that, or the aiming will be inaccurate all the time:
aimTimer:Reset();


Run a check on destroy if the scene is resetting or is over, then reset the timer.
The checks were FrameMan:IsResettingRTE() and ActivityMan:GetActivity():ActivityOver()

Author:  Grif [ Sun Jul 19, 2009 10:37 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Congratulations on doing a better job on something than an official dev.

MacAnkka for dev '09 you heard it here first

Author:  mail2345 [ Sun Jul 19, 2009 11:03 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Btw, to avoid inter gun conflicts, use a globalized list.

Author:  deathbringer [ Wed Jul 22, 2009 1:39 am ]
Post subject:  Re: Assault rifle with recoil-affected aiming

If you want to add more realism maybe you should make some script that reduce the recoil when holding the crouch key, so when you're proned you shoot more accurately kinda. I don't know if you can do that with lua but it would be a nice add. You should also double the effect when the player is holding any movement keys.

Btw this, vehicles and online play are the things that actually lack to CC imo. I mean basic CC without any mods or fiddling around with remote desktops. So 100 thanks and MOAR for making that!

Author:  Lizardheim [ Thu Jul 23, 2009 11:32 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

I agree with grif on this guy as a content dev.

It was just so much more fun to use, you could actually use the assault rifle for assaults! Not just for meleeing!

Author:  Geti [ Fri Jul 24, 2009 5:06 am ]
Post subject:  Re: Assault rifle with recoil-affected aiming

beat me to it :P
i might improve it a bit though, but im planning on using this for most of my weapons to some degree. this is the way sniper rifles especially should work in game.

Author:  Raintail99 [ Fri Jul 24, 2009 1:19 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Quite Awesome. Most download once I get home.

Author:  Darlos9D [ Fri Jul 24, 2009 5:19 pm ]
Post subject:  Re: Assault rifle with recoil-affected aiming

Hey, cool. This is an idea I've had for a while. I never did it, though, because I didn't want to make it the way you did: where the bullet searches for the nearest person and adjusts their aim. Unfortunately, in CC's current state I can think of no other way. But I don't want to risk you firing near other actors and their aim angles getting messed with instead. So I'll just wait for further improvements on the engine. I suppose you could tighten it up a bit by making sure that the actor is holding the weapon in question though. Then there'd be no mistakes unless you have two actors with the same weapon.

But yeah, as suggested above, it'd be neat if you lessened the change in aim angle depending on the state of the actor. Like, being in sharp aim should decrease it, and crouching/crawling should decrease it. I believe you can check for these states quite easily. Crouching and sharp aiming at the same time should decrease it even more.

Once I feel more comfortable with the game engine, I plan on fully implementing something like this in my mod.

Page 1 of 3 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/