Player Control

Get technical support about the C++ source code and about Lua scripts for maps, entities, GUIs, the console, materials, etc. Also covered are the Cafu libraries and APIs, as well as compiling, linking, and the build system.
Post Reply
SoulRider
Posts:95
Joined:2014-04-06, 00:16
Player Control

Post by SoulRider » 2014-09-06, 19:06

I have looked but other than PlayerCommand.hpp I can't find anything to do with player controls. I want to set it up so that when a user presses tab a scoreboard comes up. I have created the scoreboard GUI, now I need to enable the TAB key to activate it.

Sorry for asking so many questions on the whereabouts of code, but without project files, it is hard to search for specifics :D
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Player Control

Post by Carsten » 2014-09-07, 10:00

SoulRider wrote:I have looked but other than PlayerCommand.hpp I can't find anything to do with player controls. I want to set it up so that when a user presses tab a scoreboard comes up. I have created the scoreboard GUI, now I need to enable the TAB key to activate it.
See Ca3DE/Client/ClientStateInGame.cpp, methods
  • ClientStateInGameT::ProcessInputEvent() for keys that are usually pressed "once" (that is, immediately released), and
  • ClientStateInGameT::MainLoop() for keys that are usually held down for a while.
Sorry for asking so many questions on the whereabouts of code, but without project files, it is hard to search for specifics :D
No problem, I'm happy to help!

As a side note, many Windows developers seem to think that there is no live outside of Visual Studio, and not being able to find things in a set of source files without its help is a common pattern. (I see this often because Cafu doesn't ship with Visual Studio project files, but instead uses SCons as its build system.)

Well, there are several solutions to this problem:

Indirectly, it should still be possible to use Visual Studio, either by creating projects files "manually", or by employing another build system such as Premake or CMake. See
for additional details.

A much quicker solution that works without the ballast of Visual Studio is to just find a good "grep" tool for Windows. Personally, I always use UltraEdit's excellent "Find in Files" under Windows, and usually ack (the actual command name is ack-grep) under Linux.

For more details, see:
Best regards,
Carsten
SoulRider
Posts:95
Joined:2014-04-06, 00:16

Re: Player Control

Post by SoulRider » 2014-09-08, 20:59

Making some progress in understanding on this. I am just working on implementing the scoreboard into the human player component. I see your comments on making GUI's a separate component, that is a very good idea, and I may have a go at that at some point. Overall, there are a lot of things I want to do but, I am doing a little bit of each, increasing my understanding and getting there slowly..

Making the change from modding a complete game to writing one from scratch is a big step, but I am enjoying the challenge :D
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Player Control

Post by Carsten » 2014-09-10, 10:05

SoulRider wrote:Making the change from modding a complete game to writing one from scratch is a big step, but I am enjoying the challenge :D
It's great to hear that! :wohow:
Best regards,
Carsten
Finch46
Posts:1
Joined:2020-08-18, 14:17
Contact:

Re: Player Control

Post by Finch46 » 2020-08-18, 14:22

What is a player control?
Anyone tell me about this topic?
Complete guide about sri lanka arrival visa fees for Indian citizens is available.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests