Search found 42 matches

by Stoo
2012-08-07, 01:25
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Re: Adding vehicles

Not really, the HumanPlayer "is" the camera. Although it is clear that we eventually need a better separation of player input (PlayerCommands) and camera, e.g. for 3rd person view, vehicles, or chess-like games, the close connection of the camera to the human player is due to the prediction/repredi...
by Stoo
2012-08-03, 03:54
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 14085

Re: Calling script functions from code

Well, run into another bit of a conundrum... I got a very basic set of characters all set up in the map script, and was able to pick it up fine running commands through the console. Next step was to be able to select a character before spawning, so the game would associate character stats with the p...
by Stoo
2012-08-02, 04:41
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Re: Adding vehicles

Well, yes, that's true: Before the player enters the vehicle, we have two distinct entities: the player and the vehicle. When the player enters the vehicle, it must internally change its "state" as discussed earlier, which only means that it now has to do something else with the player input than b...
by Stoo
2012-07-31, 04:07
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Re: Adding vehicles

Although I think that you need to think about the Think() ( 8) ) method only as if it was running on the server only: The Think() method "transfers" an entity from one state to the next. Human player entities are special mostly because their thinking is not driven by the frame time, but by the inco...
by Stoo
2012-07-26, 13:42
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Re: Adding vehicles

No, it's much easier than that: You need to be concerned about player commands only in the human players Think() method (as it is now / in DeathMatch MOD). ... In your case, the original EntHumanPlayerT would take the role of the "redirecting" class ( EntHumanPlayerThatCanWalkAndDrive ;-) ), and it...
by Stoo
2012-07-20, 05:23
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Re: Adding vehicles

Yes, that's right: the player commands are assembled by the client ( ClientStateInGame.cpp ), which sends them to the server and stores them for local client prediction. Okay... so where would the "redirecting" class fit into the flow? It sounds like something needs to happen server-side to determi...
by Stoo
2012-07-18, 13:34
Forum: Coding and Scripting
Topic: Equipment and hardpoints
Replies: 3
Views: 2492

Re: Equipment and hardpoints

For example, the root bone of a weapon model (the sub-model) could be "right hand", if the player model (the super-model) somewhere has a bone with that name in its body. Another example, the weapon could have bones like "right shoulder" and "right hand", that would align with the players bones of ...
by Stoo
2012-07-18, 13:18
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Re: Adding vehicles

I'm still trying to figure out how to split out the player input handling section from the HumanPlayer code... what actually captures keyboard inputs? It looks like every HumanPlayer instance looks at what PlayerCommands the server has sent out, rather than what's happening to the keyboard...
by Stoo
2012-07-13, 22:57
Forum: Coding and Scripting
Topic: Equipment and hardpoints
Replies: 3
Views: 2492

Equipment and hardpoints

I've actually got questions on two topics, but they seem related enough to include in one post - Equipment: As I'm working on making an RPG, I'd like to be able to have equipment fill other "slots" on the character (helmet, body armor, boots, etc.) I noticed while reading through the docs that weapo...
by Stoo
2012-07-10, 23:54
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 14085

Re: Calling script functions from code

Sorry for the delay in response... casualty of the spare-time status of my project :P [edit - Did post about missing files, realized I'd been getting an error while opening the downloaded archive... Redownloaded and all seems peachy now... :nerd: ] Just for the records, here's what I've been up to r...
by Stoo
2012-07-03, 13:46
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Re: Adding vehicles

One aspect is that - in the original suggestion - I'd consider the EntHumanPlayerT class less like the human player as it is now, into which the vehicle code is squeezed besides the normal code, but rather only as a "proxy". This proxy would forward all functionality to e.g. WalkingHumanPlayerT if ...
by Stoo
2012-07-03, 13:24
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 14085

Re: Calling script functions from code

My latest updates in the SVN head revision, though not yet completely implementing what I have in mind (see http://trac.cafu.de/browser/cafu/trunk/ ... tState.hpp for details), should solve the problems we discussed above: That sounds really promising... I'll have to look into it! Hi Stoo, Yeah, I ...
by Stoo
2012-06-29, 01:34
Forum: Coding and Scripting
Topic: Adding vehicles
Replies: 20
Views: 8174

Adding vehicles

So I've been trying to work out the best way to implement vehicles in this engine, and the most relevant thread I've been able to find - http://www.cafu.de/forum/viewtopic.php?f=6&t=490&view=next - is from 2008, so I thought it better to start a new topic to ask for clarification rather than raise a...
by Stoo
2012-06-29, 01:03
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 14085

Re: Calling script functions from code

Well, yes and no: Both the C++-implemented functions that a Lua object can call, as well as the inheritance, are implemented with Lua's concept of metatables, which we have chosen to keep in the registry so that only C++ code can access and change them. If we kept the metatables elsewhere, e.g. as ...
by Stoo
2012-06-22, 02:25
Forum: Coding and Scripting
Topic: Calling script functions from code
Replies: 37
Views: 14085

Re: Calling script functions from code

the entity inheritance is fully functional, but it is intended so that Lua methods that are implemented in C++ can be used in Lua with entities of derived classes. For example, the C++ BaseEntityT class implements Lua methods GetName() and GetOrigin() , and the inheritance code makes sure that in L...