Sir_Odie Report post Posted May 11, 2009 (edited) I wrote a patch to implement a Ranging-Lock feature similar to Sit-Lock as suggested here... Index: elconfig.h =================================================================== RCS file: /cvsroot/elc/elc/elconfig.h,v retrieving revision 1.33 diff -u -r1.33 elconfig.h --- elconfig.h 8 May 2009 23:51:54 -0000 1.33 +++ elconfig.h 11 May 2009 21:36:10 -0000 @@ -103,6 +103,8 @@ extern int gx_adjust; extern int gy_adjust; +extern int ranging_lock; + void display_elconfig_win(void); void change_language(const char *new_lang); Index: elconfig.c =================================================================== RCS file: /cvsroot/elc/elc/elconfig.c,v retrieving revision 1.334 diff -u -r1.334 elconfig.c --- elconfig.c 10 May 2009 20:14:49 -0000 1.334 +++ elconfig.c 11 May 2009 21:40:10 -0000 @@ -151,6 +151,7 @@ int you_sit= 0; int sit_lock= 0; +int ranging_lock= 0; int use_keypress_dialogue_boxes = 0, use_full_dialogue_window = 0; int use_alpha_banner = 0; int show_fps= 1; @@ -1668,6 +1669,7 @@ #ifndef MAP_EDITOR2 add_var(OPT_BOOL,"sit_lock","sl",&sit_lock,change_var,0,"Sit Lock","Enable this to prevent your character from moving by accident when you are sitting.",CONTROLS); + add_var(OPT_BOOL,"ranging_lock","rl",&ranging_lock,change_var,0,"Ranging Lock","Enable this to prevent your character from moving by accident when you are using ranging weapons.",CONTROLS); add_var(OPT_BOOL,"item_window_on_drop","itemdrop",&item_window_on_drop,change_var,1,"Item Window On Drop","Toggle whether the item window shows when you drop items",CONTROLS); add_var(OPT_BOOL,"use_floating_messages", "floating", &floatingmessages_enabled, change_var, 1, "Floating Messages", "Toggles the use of floating experience messages and other graphical enhancements", CONTROLS); Index: gamewin.c =================================================================== RCS file: /cvsroot/elc/elc/gamewin.c,v retrieving revision 1.320 diff -u -r1.320 gamewin.c --- gamewin.c 7 May 2009 23:14:41 -0000 1.320 +++ gamewin.c 11 May 2009 22:21:19 -0000 @@ -458,7 +458,7 @@ { elwin_mouse = CURSOR_TRADE; } - else if(alt_on || action_mode==ACTION_ATTACK) + else if(alt_on || action_mode==ACTION_ATTACK || ranging_lock) { elwin_mouse = CURSOR_ATTACK; } @@ -490,7 +490,7 @@ { elwin_mouse = CURSOR_WAND; } - else if(alt_on || action_mode==ACTION_ATTACK || (actor_under_mouse && !actor_under_mouse->dead)) + else if(alt_on || action_mode==ACTION_ATTACK || ranging_lock || (actor_under_mouse && !actor_under_mouse->dead)) { elwin_mouse = CURSOR_ATTACK; } @@ -913,7 +913,7 @@ if ((mx >= window_width-hud_x) || (my >= window_height-hud_y)) return 1; - if (flag_alt && range_weapon_equipped) + if ((flag_alt && range_weapon_equipped) || (ranging_lock && range_weapon_equipped)) return 1; if (you_sit && sit_lock && !flag_ctrl){ LOG_TO_CONSOLE(c_green1, no_walk_with_sitlock); Edited May 11, 2009 by Sir_Odie Share this post Link to post Share on other sites
bluap Report post Posted May 17, 2009 (edited) This certainly works but I wonder how convenient it is being a config option? Obviously, by design, with the lock on, you can not move until you turn the option off or you unequip your bow. Would you really want to save the value between game sessions? Also toggling it on and off is currently a bit time consuming. May be instead, there could be a new key sequence to enter/leave the lock mode, and/or a new entry in the player context menu. Edited May 17, 2009 by bluap Share this post Link to post Share on other sites
Sir_Odie Report post Posted May 17, 2009 (edited) Ty for your comments. This was only a first attempt implemented similar to the sit_lock variable. Saving between sessions is really not needed and a key sequence and/or context-menu entry is a great idea (but wouldn't the same be true for sit_lock?)... Edit: I rewrote the patch to use the player context-menu instead of a config option and uploaded it to Berlios... Edited May 18, 2009 by Sir_Odie Share this post Link to post Share on other sites
Raistlin Report post Posted June 3, 2009 anyone working on this? or considering to implement it? sounds good imo Share this post Link to post Share on other sites
bluap Report post Posted June 6, 2009 (edited) Ty for your comments.This was only a first attempt implemented similar to the sit_lock variable. Saving between sessions is really not needed and a key sequence and/or context-menu entry is a great idea (but wouldn't the same be true for sit_lock?)... I had also thought about the similarity to the sit-lock. However, it is very easy to override by just standing up and most people probably want it on/off permanently. So different behaviour for this lock is OK IMHO. Edit:I rewrote the patch to use the player context-menu instead of a config option and uploaded it to Berlios... Sorry, I didn't notice the edit before. The updated patch still has the config setting though and it will not apply for me again (like your usermenu for mac build patch). I think the problem with the patch is that you have converted tab characters to spaces so the patch command naturally gets confused. Generally the client uses real tab characters for indentation and you should do the same when writing patches. Anyway, have you thought about using a key combination to activate the attack lock? Something like ALT+a would be nice. With probably a console message saying your were entering or leaving lock mode. Like Raistlin said, "sounds good imo". Edited June 6, 2009 by bluap Share this post Link to post Share on other sites
Sir_Odie Report post Posted June 6, 2009 (edited) Sorry, didn't notice that there was an auto-conversion from tabs to spaces in my patches... :=(( I corrected and re-uploaded all my patches and hopefully they work now... I thought about a key-combination (ALT+r for ranging-lock) in addition to the context-menu but we already have alot of key-combinations, so I first wanted to know, if it's ok to add that... Ty for your hints! Edit: I added the key-conbination with an according consol-message... Edited June 7, 2009 by Sir_Odie Share this post Link to post Share on other sites
Torg Report post Posted June 7, 2009 I thought about a key-combination (ALT+r for ranging-lock) in addition to the context-menu but we already have alot of key-combinations, so I first wanted to know, if it's ok to add that... I would say it is always ok to add the code for additional key combinations to a patch, finding a free combination can of course be tough, but it is easily changed later, or it could simply be removed if undesired. Share this post Link to post Share on other sites
Raistlin Report post Posted October 1, 2009 I revive this thread. Is there any support for this to be implemented? Or are there any reasons to abandon it? Radu, what's your opinion on it? Share this post Link to post Share on other sites
yuhquah Report post Posted October 7, 2009 thumbs up from my side. with an obligatory keyboard shortcut, ofc. Share this post Link to post Share on other sites
Burn Report post Posted October 7, 2009 Definitely needed. With a shortcut, don't care what just as long as it works on linux (unlike holding the alt to target, heh) Share this post Link to post Share on other sites
bluap Report post Posted October 7, 2009 Definitely needed. With a shortcut, don't care what just as long as it works on linux (unlike holding the alt to target, heh) Yes it works nicely on Linux and I think it would be very useful. I use the gnome desktop so I just remapped the desktop's use of the ALT key. Share this post Link to post Share on other sites
Sir_Odie Report post Posted October 7, 2009 I put in <ALT+r> for ranging lock. This could be changed by adding #K_RANGINGLOCK = <your preferred key-combo> to the 'key.ini' file in the EL program folder... Share this post Link to post Share on other sites
Hompf Report post Posted October 8, 2009 This sounds like a great new feature! Will this be in the next client release? - Hompf. Share this post Link to post Share on other sites
piiia Report post Posted October 11, 2009 fantastic idea would be great for my nerves i hate it when i miss the monster and run close to it.. especially on the nordcarn wall. thx odie.. Share this post Link to post Share on other sites
korrode Report post Posted December 17, 2009 (edited) Did something get changed in ranging lock with CVS recently? In current CVS, i noticed today that when i hold alt while in ranging mode it doesn't prevent me from walking if i misclick... I tested in normal 1.8.0 release client, and in that it still works fine... just in current CVS it doesn't work for me. Also, a ranging lock as per Odie describes in this thread definitely has thumbs up from me. Will be cool if ctrl+right-click does still make you walk though (as it does now even when you're sit-locked). Edited December 17, 2009 by Korrode Share this post Link to post Share on other sites
Sir_Odie Report post Posted December 17, 2009 (edited) Force-walk (ctrl+rightclick) works as intended: it OVERRIDES the locks (sit/ranging) but doesn't disable them. For the ranging-lock that means you can walk with ctrl+rightclick while ranging-lock is enabled but after releasing ctrl the lock is still active. You can disable it with alt+r or by unequipping the bow/crossbow. If people think ctrl+rightclick should disable the ranging-lock i can change that of course.... :=)) EDIT: I just tested alt while ranging with the current CVS client under Windows and it worked: i didn't move when i clicked next to the target... Edited December 17, 2009 by Sir_Odie Share this post Link to post Share on other sites
korrode Report post Posted December 18, 2009 Force-walk (ctrl+rightclick) works as intended: it OVERRIDES the locks (sit/ranging) but doesn't disable them.For the ranging-lock that means you can walk with ctrl+rightclick while ranging-lock is enabled but after releasing ctrl the lock is still active. You can disable it with alt+r or by unequipping the bow/crossbow. Now that i think about it, having it work that way is probably better ^^ u can go grab a drop bad and walk back to your spot and not have to turn the lock on again. EDIT:I just tested alt while ranging with the current CVS client under Windows and it worked: i didn't move when i clicked next to the target... Doesn't work for me on my current Arch linux install :\ Maybe it's somehow at my end. Share this post Link to post Share on other sites
bluap Report post Posted December 22, 2009 (edited) Doesn't work for me on my current Arch linux install :\Maybe it's somehow at my end. Using Alt to stop movement works fine here on Ubuntu. Curious. Looking again at this patch, do we really need the "Ranging-Lock is enabled. Disable...." every time you click and don't get the attach cursor? With a fast moving creature, I certainly miss a lot and so get an awful lot of SPAM on screen and in my chat log. What we could really do with is an on-screen indication when the lock is in place.... Like the poison and shields may be.... There appears to be a lot of support for this patch. Does anyone object to adding it to the client? Edited December 22, 2009 by bluap Share this post Link to post Share on other sites
Sir_Odie Report post Posted December 22, 2009 (edited) Looking again at this patch, do we really need the "Ranging-Lock is enabled. Disable...." every time you click and don't get the attach cursor? With a fast moving creature, I certainly miss a lot and so get an awful lot of SPAM on screen and in my chat log. What we could really do with is an on-screen indication when the lock is in place.... Like the poison and shields may be.... For this we would need at least 1 new icon. Some ideas: 1) put a text (e.g. RL: 0/1) in the upper right corner together with the FPS/UVP message 2) add a counter so that the console-message is only printed on every x'th misclick 3) add a timer so that there is only one message per x seconds Of course i'm open for better ideas... :=)) Edited December 23, 2009 by Sir_Odie Share this post Link to post Share on other sites
bluap Report post Posted December 26, 2009 For this we would need at least 1 new icon.Some ideas: 1) put a text (e.g. RL: 0/1) in the upper right corner together with the FPS/UVP message 2) add a counter so that the console-message is only printed on every x'th misclick 3) add a timer so that there is only one message per x seconds Of course i'm open for better ideas... :=)) I'd prefer something like option 1 rather than the others. I've also just experimented with using the walk/attack/spell highlight graphic. Like the red cross that briefly appears at the feet of you target, I made a yellow highlight that briefly appears at your feed if you try to walk with the lock on. The same highlight could be used for the sit lock too. Just another option. Share this post Link to post Share on other sites
Sir_Odie Report post Posted December 26, 2009 I uploaded an alternate version of the ranging lock to Berlios. This one uses an indicator in the top right corner (R-L: 0/1) instead of the status message. This could be a good combination with your highlight-graphic which sounds good for both locks... I didn't really notice the messages as spammy as i get lots of messages (you failed to flee / you're too far away) while training --> they look somewhat 'normal' to me :=)) Share this post Link to post Share on other sites
Burn Report post Posted December 26, 2009 The yellow highlight sounds perfect. And yes, works for sit lock too. A general "locked in place" effect. Share this post Link to post Share on other sites
bluap Report post Posted January 12, 2010 (edited) After chatting with Entropy, I've committed this patch. Slightly modified to use the yellow cross highlight rather than the console message to warn it's engaged. I also removed the sit lock message in favour if using the same yellow highlight. For now, I did not add the FPS area indicator text. I wonder if its needed? Also, the existing code is a bit messy and some people (myself included) have that text switched off. Edit: I forgot to add. Thanks Sir_Odie for the patch. Edited January 12, 2010 by bluap Share this post Link to post Share on other sites
Sir_Odie Report post Posted January 13, 2010 Thanks alot bluap! The yellow cross is perfect and thus the indicator text in the top right is really not needed... Share this post Link to post Share on other sites