Jump to content
Sign in to follow this  
gandalf the white

maybe this makes 3D sights possible?

Recommended Posts

Your wrong, I allready posted it before in this thread that you can use key activated scripts. But its kind of a secret right now so Im not going to discuss how. If you want to know ask manticore aka nephilim.

lol and she's got it from me, and I don't give a damn if it is secret or not biggrin_o.gif

You can in fact check some pressed keys, the best is still V. Do that by creating a manual controllable camera in the background, when you press the moving keys (i.e. Q,W,E,A,S,D,Y,X,C) the camera will have different velocities which you can check. And once you press V the cam gets destroyed, you can check that also by querying (alive _cam) in your looping script. Once it's not alive anymore you know that V was pressed and can create a new cam, if you've got the last velocity save you can even query if a player has pressed f.ex. A+V.

In the most cases this isn't very helpful though since the movement keys most of the time have a function in OFP, and you don't want your vehicle driving to the right just because you want the radio channel on D biggrin_o.gif

As I said though, V is the best. It's nearly ever unused, if used you can deactivate the gun sight in your addon and you can do anything with it you want. Like custom 3d sights wink_o.gif

edit: a part of the credits goes to Vektorboson though, who first of all got the idea to run an afterburner using E with this method

Share this post


Link to post
Share on other sites

hardrock, where does the camera part "start"? Seems like you would have to execute something before you started pressing keys, or else you wouldn't be able to move.

That's a damn neat trick though.

Share this post


Link to post
Share on other sites
"We" could do a shout for big addonmakers to make the ironsights compatible for those who wants to edit that animation? Or create "3D sight guns" that anim replacement mods might use? or atleast have the creators of guns mention in the readme if they want to open their gun open to "3D sights editing" ?

I think you miss the most important point, that most guns have ironsight parts in diffrent positions and it's not possible standarize their location so that they fit one animation. sad_o.gif In the best scenario you'll end up with a small number of rifles compatibile with aiming animation and rendering the rest of rifles pretty much useless (as they'll obstruct your view).

IMHO the whole thing is not worth the effort as I see now, that results will be miserable (I hope someone could prove me wrong, though). Sorry to disapoint you guys.  rock.gif

Share this post


Link to post
Share on other sites
hardrock, where does the camera part "start"? Seems like you would have to execute something before you started pressing keys, or else you wouldn't be able to move.

Well first I thought I kept it secret too, but since it's lying on my hd for a year now I don't give a damn anymore.

Edit: The whole thing is now available at OFPEC!

Visit OFPEC to view my script submission, you can find both versions of the keyboard script there.

Share this post


Link to post
Share on other sites
the cam idea is pretty old... (ok, i didn't know it, but rom did)

check this.

Oh, I didn't know this one. wow_o.gif

Pretty interesting though smile_o.gif

Share this post


Link to post
Share on other sites

But, how can you move your unit or vehicle around while you are running a "manual on" camera script?

Share this post


Link to post
Share on other sites

The camera moves in the background, and it is set so you can't view it, so you have control. The camera still responds to your key movements though, and the detection of the camera's velocity will determine what key.

Share this post


Link to post
Share on other sites

Btw, I must say hardrock thats a pretty nice discovery, I used a modified version on my AH-64 taxi script, its basicly the same without the pressing V part, er... crap.. a little off-topic. So, yea. So what was the problem with using a 3d optics model?

Share this post


Link to post
Share on other sites

Thanks Kyle. Didn't realize you could put it in the backround and still move around.

Share this post


Link to post
Share on other sites
Btw, I must say hardrock thats a pretty nice discovery, I used a modified version on my AH-64 taxi script, its basicly the same without the pressing V part, er... crap.. a little off-topic. So, yea. So what was the problem with using a 3d optics model?

-The impact is not exactly where you think it will be (in the first screenshot, it is +/- 3 cm above the sight itself).

-the possible disappearance of several polygon too close to your view.

-You have to place the gun in a position for your "ironsight"-like animation that will create some anatomy problem.

-The aiming animation must be done by gun, as using a different gun with that animation will end in a no-ironsight situation.

So we're thinking of solutions now...

I hate using "we" when i let you guys do all the work sad_o.gif But i can do VERY little with OFP editing, and scripts scare the fuck out of me, so... carry on working tounge_o.gif

Share this post


Link to post
Share on other sites

You could make an animation for a transition to the irons, kind of like in America's Army. Then you would still be using the 2d sights and everything would be accurate.

Share this post


Link to post
Share on other sites

true, that'l solve allot of problems, but basicly... it's thesame, no?

The point is to either show the way to people how to make 3D ironsights, and let them decide if it's worth it...

Keeping a gun that close to your face also requires VERY good textures... so the 2D way would be better in that area.

The point that we're at now is that it's not worth it, mostly because the front and back part of ironsights do not represent the target, meaning allot of weapons would have to be edited.

Share this post


Link to post
Share on other sites

like blackdog said i think it would be much better jut to have a 2d sight which looks 3d.

offtopic- @kyleSarnik so if there are animations that let you move does this mean an animation could be made so you can reload while running rock.gif

Share this post


Link to post
Share on other sites
like blackdog said i think it would be much better jut to have a 2d sight which looks 3d.

offtopic- @kyleSarnik so if there are animations that let you move does this mean an animation could be made so you can reload while running rock.gif

Indeed, even if they DO look like crap. That's how this game looks, and since we're so used to it, we might as well make crappy 3d looking 2d sights based off Sanctuary's animation for example (take screenshot, cut out background, voila 3d sight)

Share this post


Link to post
Share on other sites

But the problem is that you can not aim correctly with 2d sights when you are using 3d glasses. And ofp looks really magnificient in 3d. It's a shame that this is all that is missing.

Share this post


Link to post
Share on other sites

I used the keyboard script and some animations to imitate transitioning to the iron sights. When you press V, you raise the gun and a moment later the 2d irons pop up. When you press V again, they disappear and the gun is lowered. By moving the "pilot" memory point in my soldiers .p3d closer to his right eye, I got around the "gun sticking in center of face" problem. It's even possible to play different animations for different weapons.

Unfortunately, it only works for the standing posture right now, because I can't figure out how to check what stance the player is using.

See here: http://www.flashpoint1985.com/cgi-bin....1;top

Another nag is that the game doesn't seem to react to the key being pressed every time.

If someone could figure out how to check the players stance, I could make this work.

Share this post


Link to post
Share on other sites

Maybe you put a proxy point on the weapon and use that in the script ?

Sorry I have no idea of Modeling Proxies etc tounge_o.gif

Share this post


Link to post
Share on other sites
Maybe you put a proxy point on the weapon and use that in the script ?

Sorry I have no idea of Modeling Proxies etc tounge_o.gif

You can't do that because weapons themselves are proxies.

Share this post


Link to post
Share on other sites

well you could use the keyscript too biggrin_o.gif

detect if the player presses Q or Y and keep the current state saved in the script. Maybe you got to adjust the timing values (~xx) in the script if the detection isn't working good enough for you, I think it was quite fine for me but am not too sure though

Share this post


Link to post
Share on other sites

I thought of using the keyboard script for it but I figured it would get garbled after a while. If you put the gun on your back for example, the saved state would be wrong. I would rather have a way to check instead of using dead reckoning.

Maybe I could drop an invisible object with geometry ontop of the player, so it would "land" ontop of him for a moment, and give his height.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×