View unanswered posts | View active topics It is currently Sat Dec 28, 2024 4:01 pm



Reply to topic  [ 7 posts ] 
 2D with 3D elements 
Author Message

Joined: Fri Oct 07, 2011 4:42 am
Posts: 1
Reply with quote
Post 2D with 3D elements
Is there a way to make a weapon have a miss ratio if the bullets hit the actor. kinda make it so people are more likely to miss a direct shot because the bullet was to far to the background or foreground of the target.

Example of what im thinking is you have two targets one a dummy or a colaltion soldier. The dummy would have a 35% miss ratio for direct hits well a soldier would have 20% because he was a bigger target. I find it would simulate the 3rd dimension into this 2 dimension game.

Sorry if i put this in the wrong fourm and if i make no sense :???:


Fri Oct 07, 2011 4:51 am
Profile

Joined: Tue Aug 16, 2011 5:11 am
Posts: 7
Location: Auckland, NewZealand
Reply with quote
Post Re: 2D with 3D elements
Might be able to do it Via Script, just have a bullet that changes into a Non-Hitting depending on Weapon (Would be Simple'st) and then maybe further depending on the Objects in the way "Class"


Fri Oct 07, 2011 7:41 am
Profile
User avatar

Joined: Tue Feb 08, 2011 4:14 am
Posts: 59
Reply with quote
Post Re: 2D with 3D elements
This is the right forum, don't worry.

As for this concept, it wouldn't be very balanced because automatic fire from an AK-47 is fairly inaccurate in it's own right. Adding in chance is not something you want to do as it'll just make it even more difficult for you.


Fri Oct 07, 2011 7:42 pm
Profile

Joined: Tue Aug 16, 2011 5:11 am
Posts: 7
Location: Auckland, NewZealand
Reply with quote
Post Re: 2D with 3D elements
Just saying, It would be balanced and would add a bit more Depth and reason to by a Coalition Assault rifle Over a Ak-47, Simply as it would Theoretically be a more Accurate rifle

If you wanted to go overboard, then Maybe even have the 3 dot Aim line kinda light-up? (Just a Random Idea) from left to right to signify if the Bullets gonna hit, Left or right



I dont know scripting in CC, but For a basic script would only need to check if 'WeaponTypeA' has shot and spawn Projectile based on & chance (Either a Non-Hit or a Hitting Projectile)


Sat Oct 08, 2011 6:39 am
Profile
User avatar

Joined: Wed May 20, 2009 3:10 pm
Posts: 366
Location: Århus, Denmark
Reply with quote
Post Re: 2D with 3D elements
First off giving a constant 30% miss chance doesn't simulate 3d spread at all, what you want is to start with a fx. 10%*the diameter of the target (This is the only size describing variable we got access to through lua, and I think it describes pretty well how far it goes into the third dimension) hit chance then multiply it with distance^-2

I made something like this before, for personal use. It isn't hard really. I could remake it after the weekend if ya want ^^


Last edited by akblabla on Sat Oct 08, 2011 3:41 pm, edited 1 time in total.



Sat Oct 08, 2011 8:27 am
Profile
User avatar

Joined: Sat Feb 26, 2011 10:29 am
Posts: 163
Reply with quote
Post Re: 2D with 3D elements
akblabla wrote:
First of giving a constant 30% miss chance doesn't simulate 3d spread at all, what you wan't is to start with a fx. 10%*the diameter of the target (This is the only size describing variable we got access to through lua, and I think it describes pretty well how far it goes into the third dimension) hit chance then multiply it with distance^-2
I made something like this before, for personal use. It isn't hard really. I could remake it after the weekend if ya want ^^


Agree. Really simple by using random variable and SetWhichMOToNotHit.


Sat Oct 08, 2011 2:31 pm
Profile
User avatar

Joined: Wed May 20, 2009 3:10 pm
Posts: 366
Location: Århus, Denmark
Reply with quote
Post Re: 2D with 3D elements
Attach this script to any bullet and it should hopefully work

Code:
function Create(self)

  self.Spread = 0.0001;
   
  for i = 1,MovableMan:GetMOIDCount()-1 do
    self.object = MovableMan:GetMOFromID(i);
    if self.object ~= nil then
      if math.random(0,100) > self.object.Diameter / SceneMan:ShortestDistance(self.object.Pos,self.Pos,SceneMan.SceneWrapsX).Magnitude^2 / self.Spread then
        print(i)
        self:SetWhichMOToNotHit(self.object,-1);
      end
    end
  end
end


Fiddle around with the self.Spread variable until it fits what you desire, current the spread makes it miss 90% of the shots at 1000 pixels which obviously is a bit overkill. Hope it helps :)


Sat Oct 08, 2011 4:09 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.094s | 13 Queries | GZIP : Off ]