|
| 25 Jun 2014 01:43 PM |
I mean ones with one of those ADS aiming options all the kool kids have in their games.
How does one go about implementing something like that?
Should be filteringEnabled compatible.
I dont think its possible to use roblox animations for it because you cant really control those...
Explain plz. |
|
|
| Report Abuse |
|
|
A2D8
|
  |
| Joined: 15 Jun 2014 |
| Total Posts: 548 |
|
| |
|
Lazulite
|
  |
| Joined: 09 Jun 2014 |
| Total Posts: 1217 |
|
|
| 25 Jun 2014 01:51 PM |
| ADS = instance new a part in front of ur head / where u look and put camera on it |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 01:57 PM |
Is this how its done?: 1.Figure out where the middle of your view is in world coords 2.Place gun such that the sight/scope/whatever its called is in that position/line 3.Weld gun to torso or something 4.Change arm welds such that they look like they were holding the gun |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 25 Jun 2014 01:59 PM |
| if you place the sight exactly where your head is (head.CFrame * CFrame.new(0, 0, 1)) then it should be right in the middle of the user's screen. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 02:00 PM |
And if i want to cheat: 1. Weld gun to some random body part so it looks ok 2. When you go in first person mode slap a low res texture on the screen so it looks like the gun is there |
|
|
| Report Abuse |
|
|
Lazulite
|
  |
| Joined: 09 Jun 2014 |
| Total Posts: 1217 |
|
|
| 25 Jun 2014 02:05 PM |
| it's usually pretty useless unless you increase some accuracy stat or decrease spread as a feature / scripting it |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 02:06 PM |
| I know, but I wanted to know how its done in case I add a 2-brick weapon and decide to spend too much time on it. |
|
|
| Report Abuse |
|
|
Lazulite
|
  |
| Joined: 09 Jun 2014 |
| Total Posts: 1217 |
|
|
| 25 Jun 2014 02:07 PM |
| look at some crappily scripted lagging guns from a USM or USA group they usually have ADS |
|
|
| Report Abuse |
|
|
A2D8
|
  |
| Joined: 15 Jun 2014 |
| Total Posts: 548 |
|
|
| 25 Jun 2014 02:12 PM |
my brain = [ ]
now
[inspiration] |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
| |
|
| |
|
|
| 25 Jun 2014 08:03 PM |
other people are noobs. Easy way:
Make Pseudo Character
Position arms like you have them with a normal grip and add gun
Set Studio's workspace camera's type to Scriptable with the CmdBar and set its coordinate frame to the character's head's position looking forward.
Now that your camera is locked in place, you can freely move/rotate the arms/gun and see what it looks like in first person.
Create weld in workspace welding the arms/gun to the character
delete welds locally and create new ones
(Separate welds for client/server so client can get smooth transition, and server change doesn't override client weld. Welds are created in the workspace because if you use :Destroy() on a weld in the character, FilteringEnabled accepts the change instead of ignoring it.)
Get offset of final placed parts and use welds to change the arm/gun positions to the ones you just set (with local script.)
To update the server welds, fire a server event with two parameters (offset of the weld and name of weld) and have the server event find the server weld from the name and change its offset.
Speaking from experience -- already have a FPS I'm working on that is compatible with FilteringEnabled. Send me a friend request if you want to see it. |
|
|
| Report Abuse |
|
|
UniCop
|
  |
| Joined: 02 Apr 2012 |
| Total Posts: 180 |
|
|
| 25 Jun 2014 09:06 PM |
| Psuedo Character = ewww no |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 09:10 PM |
You could move the weapon in front of your character by manipulating GripPos with KeyBindings (and increase the FieldOfView while you're at it), but that would look messy to other players
>I will rip out your duodenum |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 09:30 PM |
| You can always set the normal welds Part1 to nil while your doing things than reset it when ur all done. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2014 09:43 PM |
http://www.roblox.com/Mercs-OPEN-SOURCE-place?id=133019129
i wrote this like 5 months ago so dont kill me for my stupid coding. just go there and learn. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2014 12:41 AM |
@Uni: You're dumb. Re-read the post -- not a pseudo-character in-game -- a dummy to use in visually positioning the gun/arms.
@Fire: You're dumb.
@Matt: You're dumb.
Leave it to the big boys. I've done this already and finished it -- my way works and is the best way. I've learned that through trial and error. |
|
|
| Report Abuse |
|
|
magnalite
|
  |
| Joined: 18 Oct 2009 |
| Total Posts: 2467 |
|
| |
|
|
| 26 Jun 2014 01:02 AM |
@echo
yeah ive done so many FPS engines since that game mercs, i know how to do everything in them now. its pretty fun to develop one, once you get the hang of it.
@radio
heres some tips
make 3 tables : example:
update = {} init = {} corou = {}
at the bottom of yor script make those tables do stuff
for i, v in pairs(init) do v() end
game:GetService("RunService").RenderStepped:connect( function() for i, v in pairs(update) do v() end end )
for i, v in pairs(corou) do Spawn(v) end
heres an example of using all those tables:
init.Hello_World = function() print("Init: Hello World") end -- prints hello world first before the update and corou functions are called
update.printCamLookVector = function() print(workspace.CurrentCamera.CoordinateFrame.lookVector) -- will print the cameras look vector every renderstep end
corou.ChangeGuiDisplays = function() -- gui variables here while wait() do gui.TextLabel.Text = tick() -- changes a guis text to the current tick every 30th of a second. useful for changing guis because renderstepped is only for stuff that must be done every 60th of a second to keep it in sync with the render for a player. end end
-----------------------------------------------------------------
i would recommend using the update table for stuff that must be done every 60th of a second.
use the init table for stuff that happens when the script is run, like creating fake body parts and changing properties of the camera
use corou table for changing what guis say and stuff that doesnt have to be running constantly like checking if a round is over or something.
-----------------------------------------------------------------
heres a few tips for making the player do stuff
create fake arms for the player since i dont like doing all that jazz to use the normal player arms, plus you get to see them in game when you create fake ones.
make a model in workspace called Ignore and insert everything you want to stop rays from hitting in that, like the fake arms mentioned earlier.
create a fake head and make the original head invisible, use this to show where the player is looking to other players, but still make moving the arms around slow with linear interpolation ( so that the guns dont look like they're just welded to the screen) also make the arms welded to the original head.
create tables to put cframes in for the arms, head, fakehead, and the welds you're using to equip weapons. you put cframes in those tables to offset the normal cframe of the object, although this might take a while to perfect. just put a function in update that will multiply the default offset for a weld by a cframe that has been multiplied by all the cframes in the table.
i hope these fps tips help you good luck on your next project radio, i know you're capable of making something really fun. also i loved ur game where there were planes :D |
|
|
| Report Abuse |
|
|
jasondee1
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 8002 |
|
|
| 26 Jun 2014 02:04 AM |
guys
theres an easy way to this
1. just make the camera interpolate to the front of the scope when mousebutton2 is down
2. make head move sideways a little bit towards the scope
3. ?????
4. PROFIT!!!!!1 |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2014 04:07 AM |
yh
So first: 1. Weld gun to some body part in server, weld outside character model 2. Destroy server weld locally and replace with fully local one to make it smooth locally 3. Adjust weld based on camera direction, request server do the same 4. Apply quaternions to make it smooth
And second: 1. Weld fake arms to real arms (dont feel like removing real arms) outside character 2. Apply surrogate welds to them shoulders both locally and on server like with the gun weld 3. Control arm welds locally and on server to make them seem like they hold the gun using some weapon specific grip data
And for a weapon I need a handle, and then I need a CFrame for the location of the scope/will-be-at-middle-of-screen point (CFrame in case I want a gun that is held at a 45 degree angle? lel) as well as 2 vector3s for the grip positions (which should be modifiable to have an overly detailed shotgun firing sequence)
And im not even making an FPS
I will have to add a scoped axe |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2014 04:22 AM |
Weld an invisible part to Character.HumanoidRootPart, not Head or Torso...
the RootPart will stay still unlike the Torso and Head which move around with ROBLOX meanie animations
put all your stuff in Workspace or inside a tool inside a model inside Character (don't ask why, but it just works getting rid of collisions and stuff)
when you want to aim you can use CFrame:toObjectSpace(otherCFrame) which finds the relative position, learn to use this function it's very useful!!!!! and you can do :inverse() on it to switch CFrame and otherCFrame if I'm right, this worked for me for a few things but it may not exactly be "switching CFrame and otherCFrame"
since you're not some noob that's just going to go and steal things and post them on C&G (hopefully), i'm willing to share my old FPS and a new thing I have to easily make animations, if you want |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2014 04:37 AM |
Ye I use the CFrame methods all the time.
I probably wont be implementing a gun in a while so im satisfied with the current information. |
|
|
| Report Abuse |
|
|