Witchie NL Posted April 11, 2007 Report Posted April 11, 2007 Bak could you give me a bit of help with other functions instead of just the display an image tutorial, becouse i got that working fine?Like for instance 'if a key is pressed do:' functions. And how to work with playerdata. Since i have limited skills in C++, coz i only coded in MERVBot, its kinda irritating to learn this.You can contact me on msn (look at my profile).And if you dont have msn.. you may post it here if you want. Thank you, Witchie NL
Bak Posted April 11, 2007 Report Posted April 11, 2007 Definately. I'll write up a tutorial soon (most likely tomorrow). The basic idea behind controls, such as ones that involve the keyboard is the controls module: /** * tell the Controls modules you want a function to be called when a certain control is pressed, * down is true iff we want the function to be called when the key is pressed down, if it’s false it will be * called iff the key combo is lifted up. * * call this function in your handler for the CB_CONTROLSLOADED callback * * @param keyString the keyString cooresponding to the event, as defined in the settings (like "repel") * @param funcToCall the function to call when the event occurs, down = true iff we're pressing the key combination */ void (*regControlEvent)(const char* controlString, void (*funcToCall)(bool down, const char* controlString)); now controlString here is specified in a conf file (along with the actual buttons that are needed to be pressed) as in conf/modules/Controls.h: ;; This section defines what controls map to what actions ;;; for keyboard controls, use SDLK_ constants minus the SLDK_ when using them [Controls] ;;; all of the key bindings in the section ;;; the rest of the section will be in the form of ;;; <name> = <binding> where <name> is one of the ones in this list and <binding> is a list of keys (the SDLK_ constants without the SDLK_ part) ;;; these can include + to use multiple keys to active this command, as in "repel = LSHIFT + LCTRL, RSHIFT + LCTRL" Names = menu_toggle, menu_quit, menu_fps, specUp, specDown, specLeft, specRight, specFast, toggleCursor, chat_toggle, chat_left, chat_right, chat_ignore_modifier, chat_send_message, moveForward, moveBackward, turnLeft, turnRight, repel, burst, decoy, thor, brick, rocket, portal, gun, bomb, mine, stealth, cloak, xradar, antiwarp, playerlist change view, playerlist up, playerlist down ; from SpecMode module ;;; move up while spectating specUp = UP ;;; move down while spectating specDown = DOWN ;;; move left while spectating specLeft = LEFT ;;; move right while spectating specRight = RIGHT ;;; move quickly modifier for spectating, to be used in conjunction with specUp, specDown, specLeft, or specRight specFast = RSHIFT, LSHIFT ; from EscapeBox module ;;; toggle the escape menu menu_toggle = ESCAPE ;;; the quit key while the escape menu is active menu_quit = Q ... As for per player data, look at the do!@#$%^&*entation in Modules/PerPlayerData/PerPlayerData.h, I'll get a tutorial on this one too.
Bak Posted April 13, 2007 Report Posted April 13, 2007 Here you go: http://wiki.minegoboom.com/index.php/Liste...Per_Player_Data Let me know if there's parts that need clarification.
Witchie NL Posted April 15, 2007 Author Report Posted April 15, 2007 Sorry i forgot to reply .. Ill take a closer look at it when i have time. Thank you.
Recommended Posts