Author Topic: Button events (read inside)  (Read 966 times)

0 Members and 1 Guest are viewing this topic.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Button events (read inside)
« on: December 19, 2007, 09:06:28 pm »
I think there should be events to handle the pressing of the clients buttons

like:

function OnButtonDown(ID: Byte; Btn: variant):boolean;
Result:=false; //return true to ignore button press

Btn would be the unicode value for the button (A (shift + a) would be 065 (with the 0))
or it would be the string value of the key (A, a, B, b, left mouse/left click, right mouse/right click, tab)

Paste IS a unicode value btw :)
so is copy, tab, cut, etc.

and:

function OnButtonCombo(ID: Byte; Btn1, Btn2: variant):boolean;
Result:=false; //return true to ignore button combo

Btn1 would be the modifier button (left shift/right shift, left alt/right alt, left ctrl/right ctrl, left "flag"/right "flag", menu key, no apple key tho XD) (flag key is windows key)
Btn2 is the modified key (a, l, g, pad1, pad2, 1, 2, -, enter/return)

and maybe:

procedure ForceKeyDown(ID: Byte; Btn: variant; Length: integer);
procedure ForceKeyCombo(ID: Byte; Btn1, Btn2: variant; Length: integer);


they force ID to use the key or key combo (waypointing unsuspecting server people O.o)
Length is the time in ticks to use the key/combo (so you don't just move 1 pxl to the left with 'a')

I think there should also be an:

procedure StopBot(ID: byte);
procedure StartBot(ID: byte);


stops/starts a bot from using Waypoints (so server (or player ;) ) can control the bot)

attached is an alt+numpad number key map for the heck of it (took half an hour to make)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline poutch

  • Major(1)
  • Posts: 34
Re: Button events (read inside)
« Reply #1 on: December 19, 2007, 09:12:38 pm »
Interactions with button events would be great, but i guess that this won't be possible
www.pleez.fr .... coming soon

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Button events (read inside)
« Reply #2 on: December 19, 2007, 09:14:09 pm »
Not really needed, only brings up shitloads of extra bandwidth for little gain; and would only be used to grief people.

Offline poutch

  • Major(1)
  • Posts: 34
Re: Button events (read inside)
« Reply #3 on: December 19, 2007, 09:16:24 pm »
if you can make it, i don't think that it would be little gain ;p
You can make streetfighter style combos and use buttons for special spells if u add a button event ;p
www.pleez.fr .... coming soon

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Button events (read inside)
« Reply #4 on: December 19, 2007, 09:24:29 pm »
there are probably many uses for these (one possibly being stopping ppl from using alt+f4 and windows+l :P)

I can't think of all of them at the moment

and you could also use this with GetCursorXY to make a spawning gun *hint* *hint*
Code: [Select]
(if Btn = 'LMouse' then SpawnObject(GetPlayerStat(ID,'MouseX'),GetPlayerStat(ID,'MouseY'),Whatever);)
and btw, by "combo" I mean like alt+f4 or alt+b or something (in case you thought I meant "punch, kick, kick = SuperUberFlippyKick!!!")

btw, btw Enesce, I like your "Rainbow Warrior" tag thingy, did you get that for 2000 posts or do you get it for being uber (I noticed Keron and some others has 1 too)

(on topic) Besides, 1: if you don't add this, you will keep being asked (maybe not by me, but by everyone that notices that the engine does not have this)
and 2: you never know when it might be useful, along with the get cursor XY, and it would be a great neccessity to have these events, even if it is just in case
« Last Edit: December 20, 2007, 12:02:32 am by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: Button events (read inside)
« Reply #5 on: December 20, 2007, 06:54:02 am »
Would be nice with sort of an OnButtonDown, for just a couple of keys. But it's not really necessary.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Button events (read inside)
« Reply #6 on: December 20, 2007, 10:17:21 am »
I think it could be much more than little gain.. if you use it properly..
How-a-bout if the server sends to the client what on-button-press keys to actually check for and then only send those keys, much less bandwidth would be used.

for the Start/Stop bot.. wouldn't procedure SetBotUseWaypointState(ID: byte; State: boolean); be easier? maybe with a shorter name tho.. but i already suggested something like that and I think it was denied, but who knows! :)

if OnButtonPress and OnButtonRelease exist, then you could create your own combo checker..

now if they were functions returning booleans, that would be too much work for something that would probably make things worse.. i say have them procedures so lag doesn't happen as much; unless you have it so when the client receives the result, he a teleported to the old place he was b4 he used that button at.. (like if he jumped while standing still), but again, a lot of work..

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Button events (read inside)
« Reply #7 on: December 20, 2007, 06:31:33 pm »
How-a-bout if the server sends to the client what on-button-press keys to actually check for and then only send those keys, much less bandwidth would be used.

like maybe add an:

Code: [Select]
AllowedKeys='W w A a S s D'+032+03+'alt ctrl shift enter return LMouse RMouse Scroll';

in server.ini
and possibly a AllowedKeys=Default option (for default controls) or AllowedKeys=Client (for the client's current key config)

btw, anyone try/look at my AltMap?
« Last Edit: December 20, 2007, 06:35:09 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline corl45

  • Major
  • *
  • Posts: 51
  • PWNED!
    • www.freewebs.com/tylersmod
Re: Button events (read inside)
« Reply #8 on: December 20, 2007, 08:10:18 pm »
this would be really usefull, and not a small gain! this would be awesome.
BE AWESOME!

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: Button events (read inside)
« Reply #9 on: December 21, 2007, 09:43:52 am »
It would also allow for a whole new sort of lame.