View unanswered posts | View active topics It is currently Thu Apr 18, 2024 8:06 am



Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
 Assault rifle with recoil-affected aiming 
Author Message

Joined: Thu May 14, 2009 8:44 am
Posts: 29
Location: Finland
Reply with quote
Post 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
Sun Jul 19, 2009 1:32 pm
Profile
User avatar

Joined: Mon Mar 26, 2007 1:15 am
Posts: 593
Location: UK
Reply with quote
Post 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?


Sun Jul 19, 2009 1:49 pm
Profile

Joined: Thu May 14, 2009 8:44 am
Posts: 29
Location: Finland
Reply with quote
Post 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.


Sun Jul 19, 2009 2:13 pm
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post 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?


Sun Jul 19, 2009 2:47 pm
Profile WWW

Joined: Thu May 14, 2009 8:44 am
Posts: 29
Location: Finland
Reply with quote
Post Re: Assault rifle with recoil-affected aiming
Yeah, you can use it. Same goes for anyone else who's interested in using it.


Sun Jul 19, 2009 3:15 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post 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


Sun Jul 19, 2009 5:28 pm
Profile
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post 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.


Sun Jul 19, 2009 5:36 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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()


Sun Jul 19, 2009 8:24 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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


Sun Jul 19, 2009 10:37 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Assault rifle with recoil-affected aiming
Btw, to avoid inter gun conflicts, use a globalized list.


Sun Jul 19, 2009 11:03 pm
Profile
User avatar

Joined: Sun Dec 21, 2008 8:16 am
Posts: 293
Reply with quote
Post 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!


Wed Jul 22, 2009 1:39 am
Profile
DRL Developer
DRL Developer

Joined: Fri May 15, 2009 10:29 am
Posts: 4107
Location: Russia
Reply with quote
Post 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!


Thu Jul 23, 2009 11:32 pm
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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.


Fri Jul 24, 2009 5:06 am
Profile WWW
User avatar

Joined: Fri Sep 14, 2007 9:52 pm
Posts: 304
Location: No.
Reply with quote
Post Re: Assault rifle with recoil-affected aiming
Quite Awesome. Most download once I get home.


Fri Jul 24, 2009 1:19 pm
Profile
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post 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.


Fri Jul 24, 2009 5:19 pm
Profile YIM
Display posts from previous:  Sort by  
Reply to topic   [ 33 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.058s | 19 Queries | GZIP : Off ]