Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding

Reply
 
Thread Tools Display Modes
Old 05-14-2012, 08:24 PM   #1
afurmanjhu
 
Join Date: Nov 2011
Reputation: 0
Posts: 8
Altering player movement

Hey All,
I am currently building a map that is trying to recreate some aspects of the game chess. Specically, I am trying to make it such that each time a person is allowed to move, and presses the forward key for example, the game will move that player forward exactly one square/unit (which of course will be defined by the size of the source map that I build). Similarly, if a person were to want to move to the right, then the program would both rotate 90 degrees and translate the requisite unit length.

In short, is there anyway to alter the game code such that player translation always moves a stereotyped amount and that player rotation is always 90 degrees in the specified direction (preferably this would appear as a smooth rotation rather than an instantaneous one).

Thanks for all help in advance!
afurmanjhu is offline  
Reply With Quote
Old 05-14-2012, 10:41 PM   #2
bloodytoaster
 
 
 
Join Date: Aug 2011
Reputation: 0
Posts: 17
Yes you can code that, anything is possible.
No, I don't know how, you'd have to figure it out yourself.
As a side note, you didn't need to use that fancy grammar and those big words, it doesn't make you look any smarter, just trying to be friendly here. :P
bloodytoaster is offline   Reply With Quote
Old 05-14-2012, 10:55 PM   #3
CrAzYpotpie
 
Join Date: Sep 2010
Reputation: 35
Posts: 455
Quote:
Originally Posted by bloodytoaster View Post
As a side note, you didn't need to use that fancy grammar and those big words, it doesn't make you look any smarter, just trying to be friendly here. :P
You clearly have no idea what you're talking about. Big words and fancy grammar? He doesn't use any complex words at all, just the right ones needed to get his point across. No, it doesn't make him look smarter, but that was never the intention. Your post, on the contrary, makes you sound very unintelligent. Don't encourage people on the internet to use even worse spelling/grammar techniques.
CrAzYpotpie is offline   Reply With Quote
Old 05-14-2012, 11:17 PM   #4
MilkywayM16
 
Join Date: Sep 2010
Reputation: 0
Posts: 51
Quote:
Originally Posted by CrAzYpotpie View Post
You clearly have no idea what you're talking about. Big words and fancy grammar? He doesn't use any complex words at all, just the right ones needed to get his point across. No, it doesn't make him look smarter, but that was never the intention. Your post, on the contrary, makes you sound very unintelligent. Don't encourage people on the internet to use even worse spelling/grammar techniques.
+Rep for that one.
MilkywayM16 is offline   Reply With Quote
Old 05-14-2012, 11:47 PM   #5
Karlos_Modder
 
 
 
Join Date: May 2007
Reputation: 7
Posts: 748
This could probably be done in Hammer.
A path_track for each checker section on the board, Each chess piece (either a model or brush) is parented to a func_tracktrain. A point_viewcontrol (flags in the viewcontrol can stop the actaul player from moving) that can be moved and parented to any chess piece. A ton of logic_case, logic_compair, logic_relay for each chess piece and problably a few for each path_track. It might take a while to do and might be very long winded but im a mapper and not a coder.
I think you can use vehicle_viewcontroller to control the func_tracktrain movments. IE when the play presses "W" the train moves to the first path_track and stops. If the player presses "A" the train rotates on the path_track. I think that can be done by messing with its orientation. I;d need to look into it some more but i think its posible...
The only problem i can foresee is if this is for anyother game apart from Garry's mod then you will need to modify the game code to allow multiple intances of acive point_viewcontrol (if its for MP, SP is not a problem.)
Karlos_Modder is offline   Reply With Quote
Old 05-15-2012, 09:19 AM   #6
afurmanjhu
 
Join Date: Nov 2011
Reputation: 0
Posts: 8
Thanks for the advice, looks like it might work. Any other thoughts from anyone?
afurmanjhu is offline   Reply With Quote
Old 05-15-2012, 11:25 AM   #7
afurmanjhu
 
Join Date: Nov 2011
Reputation: 0
Posts: 8
Does anyone know if it is possible to create a console alias that will do the trick? I'm thinking it might be possible to play with the +right and -right (and + left - left) in such a way that once a button is pressed, -command occurs x seconds later.
afurmanjhu is offline   Reply With Quote
Old 05-15-2012, 12:28 PM   #8
bloodytoaster
 
 
 
Join Date: Aug 2011
Reputation: 0
Posts: 17
Quote:
Originally Posted by CrAzYpotpie View Post
You clearly have no idea what you're talking about. Big words and fancy grammar? He doesn't use any complex words at all, just the right ones needed to get his point across. No, it doesn't make him look smarter, but that was never the intention. Your post, on the contrary, makes you sound very unintelligent. Don't encourage people on the internet to use even worse spelling/grammar techniques.
You're right, that last part was probably in bad taste, and it isn't good to encourage people on the internet to use bad spelling/grammar techniques, but this is what I meant:

Quote:
is there anyway to alter the game code such that player translation always moves a stereotyped amount and that player rotation is always 90 degrees in the specified direction
I don't see why he couldn't have just said, --- on second thought that was pretty much the easiest way to say what he said without sounding like a moron.

Sometimes I don't see why I argue on the internet, I'm slowly realizing that I'm not always right
bloodytoaster is offline   Reply With Quote
Old 05-17-2012, 05:23 PM   #9
afurmanjhu
 
Join Date: Nov 2011
Reputation: 0
Posts: 8
bumpity bump....anyone else with any ideas?
afurmanjhu is offline   Reply With Quote
Old 05-18-2012, 04:06 AM   #10
durrchet
 
Join Date: Mar 2012
Reputation: 204
Posts: 895
Gamemovement.cpp is all you need for movement mechanics.
durrchet is offline   Reply With Quote
Old 05-18-2012, 07:53 AM   #11
afurmanjhu
 
Join Date: Nov 2011
Reputation: 0
Posts: 8
Cool, and that contains something that regulates how much one key press down per movement equals?
afurmanjhu is offline   Reply With Quote
Old 05-24-2012, 10:25 PM   #12
RomeoJGuy
 
Join Date: Aug 2004
Reputation: 67
Posts: 1,144
No, but I suggest just overriding with a new class and starting with the main entry points for movement add your desired movement code and work from there, the gamemovement is bloated with hl2 movement code, your movement desires are much simpler so you don't need it all.
RomeoJGuy is offline   Reply With Quote
Old 06-01-2012, 02:18 PM   #13
afurmanjhu
 
Join Date: Nov 2011
Reputation: 0
Posts: 8
Going through the actual .cpp and not exactly sure where to start, any tips/hints?
afurmanjhu is offline   Reply With Quote
Old 06-01-2012, 06:17 PM   #14
DanielNaught
 
Join Date: May 2012
Reputation: 0
Posts: 6
You could just throw a few new con commands that teleport the player via a raytrace, and rotate the player via their Euler angles. Though I don't see too many problems with wholly editing the movement base.

I'd say leaving the ability to use standard movement is a great thing for debugging purposes. (Especially when viewing the map as a whole)
DanielNaught is offline   Reply With Quote
Old 06-05-2012, 04:06 PM   #15
afurmanjhu
 
Join Date: Nov 2011
Reputation: 0
Posts: 8
I've been playing around with the in_main.cpp, specifically the line of code that determines what happens when a key is pressed, anyone have any insights as to the areas that might be useful to modify?
afurmanjhu is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Tool Discussions > Source Coding


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -7. The time now is 12:47 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.