gerbilOFdoom Posted December 19, 2011 Report Share Posted December 19, 2011 Alright, so I'm trying to figure out where the input events are in the source code. If this project were in java, it would have event listeners to perform an action upon a mouse click or key press, but I can't find anything even remotely along those lines. Where is the code for input events and the resulting actions located? Quote Link to comment Share on other sites More sharing options...
quantumstate Posted December 19, 2011 Report Share Posted December 19, 2011 I think you would probably want to look at binaries/data/mods/public/gui/session/input.js. Some other files in those folders might be relevant as well. You will find that these often call simulation components, http://trac.wildfiregames.com/wiki/SimulationArchitecture gives an overview of the simulation system. The js parts are in /home/jonathan/programming/0ad/binaries/data/mods/public/simulation the components folder contains the simulation components and the helpers folder has some stuff which they use, commands.js is an important file since it handles commands sent to entities. The C++ components are found in source/simulation2.There is a lack of high level documentation for the game unfortunately, hopefully this will help you a bit. Quote Link to comment Share on other sites More sharing options...
gerbilOFdoom Posted December 19, 2011 Author Report Share Posted December 19, 2011 That's exactly it, Quantumstate! Thanks. I think I'll start logging my exploration of the code, too. Maybe I can add to the documentation... Quote Link to comment Share on other sites More sharing options...
gerbilOFdoom Posted December 20, 2011 Author Report Share Posted December 20, 2011 For the purpose of figuring out my way around the code, does a command exist that I could use to print a message to the console? For example, if I wanted to print "User has right-clicked" when the user right clicks, what command would I use? Quote Link to comment Share on other sites More sharing options...
quantumstate Posted December 20, 2011 Report Share Posted December 20, 2011 It is easiest to use warn(). This prints a message onto the normal game screen and into the console. You also get the messages logged in interestinglog.html (found in the log folder which is OS dependent). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.