iron sights? view bobing?

Przemek

Spy
Joined
Aug 22, 2003
Messages
657
Reaction score
0
I'm not a programmer - just started learning C++ at university. I did a few modifications in QuakeC back in the days of Quake's popularity (modifying monsters' code, weapons, adding entities, etc.).

I remember there were websites with tutorials on how to add a specific feature (like quakesrc.org) - one could simply copy and paste with or without analizing the code.

So I wonder... is there a website like this, with Source Engine code examples/tutorials?

I'm looking for help with:
* iron sights -- I got used to this after paying Call of Duty and Battlefield series, and after I saw the SIN: Ep trailer, I just must have this in Source!
* alternate fire modes?
* view bobing -- I don't like the character sliding on the ground instead of walking. Source Engine is very Quake'ish, so maybe it's easy to implement gentle view bobing like in Quake 1?

I am currently working on a single player map (maybe an episode) and would love to use the above in it.

Ofcourse, the code(s) author(s) will be included in the credits.

Thanks in advance :)
 
Ironsights can be put in easily. One way, off the top of my head is, to just make it zoom but instead of a crosshair put a ironsight.

View bobbing can also be put in, I think some mods have that.

Alternative fire modes is also in already, if your thinking about like how alt-fire should launch a grenade.

Go to the valve wiki (Just google valve wiki) and there are a few helpfull tutorials.
 
* not really, I was thinking about proper viewmodel animations and look through the model's iron sights, do not draw a sprite
* which mods have view bobing? Is their source code available?
* no, I mean "automatic fire" and "single fire" - already found a tutorial
* The Valve Wiki website does not contain too much info on programming, unfortunately :(

I think I will contact mod developers who plan to use iron sights - I saw some cool video showing off a vehicle + iron sights, I think it was Hidden Source...
 
Chances are you'll need custom models to do iron sights how you want them. HL2's viewmodels are heavily optimised with all normally unseen parts removed (ie. the right side). This becomes a problem when you move the viewmodel to the center of the screen, because those removed areas will be visible.

There isn't much in the sense of copy&paste sourcecode out there. Most Source coding resources (like that wiki) assume you are able and willing to do most of the hard work yourself.
 
I see sense in copy&paste source code :)
I realize the beauty of modifying the source code is modyfing it all myself, but... posting basic source code that shows how to do specific things can inspire people do modify the source to their needs, merging different codes and... yeah, learning how to do some stuff.

I am not a programmer, but I would love to have the things I'm writing about in this topic in my mod. I don't know anyone who knows C++ enough.
I'm learning C++ at university, but come on - I just started :p
 
Working with Warcraft 3 mapping has shown me why open-sourced mods )or maps) aren't a good idea.

-Angry Lawyer
 
Ever gone on custom maps on Warcraft 3 when online? You'll see what I mean ;)

-Angry Lawyer
 
al5bz.gif


-Angry Lawyer
 
You learned from Wc3? I learned from Starcraft. Of course I know how to deprotect both Wc3 and Sc with hex editing and\or mpq editing depending on the protection I don't because I use to be a mapper myself and I don't play them to much anymore.

Heres why really:
You make this nice map, then all of the sudden you come back on a week later and theres 18 versions roaming around, all crediting different names, most rigged to hell, and it basically becomes a big mess.

Open Source can be good and bad.
 
I learnt from Doom. I just had a thing for Warcraft once.

-Angry Lawyer
 
Alright, so who's gonna help me code iron sights (a friend will do models with animations) and view bobing? :)
 
Sure, I'm learning C++.
But all I'm capable of doing at the moment are extremely simple console applications, like "Hello world", cout and cin, count powers and some other odd stuff.
When I look at the code in the SourceSDK, I feel like quitting computer science :p

Could anyone post a tip, like where should I look to try adding view bobing?
 
First off, the SDK uses hungarian notation.

http://en.wikipedia.org/wiki/Hungarian_notation

Second off, start experimenting. Go around, find something you want to do, and go see if you can do it. Steal code from other parts of the SDK, copy and paste, ect. You dont have to understand most of it in order to be able to code with it.

I would suggesting using the ViewPunch function. It pretty much makes your view suddenly go in one direction and go back, like its connected to a rubber band. It is passed in a QAngle, which is an array with 3 parts, Yaw, Pitch, and Roll. For ironsights, I dont know.
 
Thanks, Puzzlemaker. I forgot I don't have to understand C++, just make it work ;)
 
Back
Top