Jump to content

Discovery about hotkeys.ids


i30817

Recommended Posts

Posted

Morning. I've discovered something (that may not be new).

 

Hotkey.ids can be extended with new ASCII codes and keywords to new keys.

 

I tested appending

8 BACKSPACE

 

and a script displaying a message with HotKey(8) and it worked when pressing the keyboard BACKSPACE.

 

This example is interesting, because CTLR+H is also backspace (8) in most posix shells, and yet pressing in game CTLR+H didn't do anything. However pressing just H or SHIFT+H did toggle the main hud like usual in the game if you press H.

 

Then i went into the config program to disable H from the game hotkeys but that didn't work either!

 

This is a small mystery:

1) pressing ctrl+h when the game had the H hotkey proves CTRL is not ignored

2) Disabling the game H hotkey didn't allow me trigger the script.

 

Maybe it detects a modifier key and dumps the input.

 

 

The end intention is to allow hotkey selection in mods to have a "modifier" to only use 3 keys instead of 6, etc.

Posted

Wow, CTRL + X already does a lot of things i've noticed now. Strange, maybe it's a effect of turning cheats on.

 

Going to try ALT now.

Posted

Now i've found something surprising (to me)...

 

IF
 !HotKey(S)
THEN
 RESPONSE #100
   DisplayStringHead(Myself,@26)
END

IF
True()
THEN
RESPONSE #100
  DisplayStringHead(Myself,@8)
END

 

This code will only display @26 the first time it is executed after a load. After that it is always @8 unless you press any other button than S. Pressing S will also display @8

 

This is .... surprising. And annoying.

 

Trying to negate a hotkey simply does not work as a cuttoff

Posted
This is .... surprising. And annoying.
not really only thing that surprised me is the display on initial load. otherwise it makes sense. you press any hotkey other than S and the string is displayed otherwise the following True() block displays

 

I'm afraid to find out what you are wanting to accomplish...

Posted

the script will ALWAYS go on. it has to parse the entire script till it either finds an action to execute OR it reaches the end. in the case of Continue() it stores up a list of actions to perform while it performs those actions but variables aren't set until the script processing restarts.

 

this may provide the behavior you want

assumes player assigned script

in "scriptA"

IF
HotKey(S)
THEN
RESPONSE #100
ActionOverride(Myself,ChangeAIScript("scriptB",CLASS)
END

at extreme bottom of "scriptB"

IF
True()
THEN
RESPONSE #100
ActionOverride(Myself,ChangeAIScript("scriptA",CLASS)
END

this would allow you to switch to the hotkey actions and if nothing is viable then switch back to the initial script that you set up to be player assigned. of course you could use any other script level and method of assigning the script to the creature, just so long as you knew all the script names you were working with....

Posted

That would be slower than the option i got now (change AI script has to end the round, not just the AI "tick").


IF
OR(3)//inverting hotkeys doesn't work
 HotKey(%S_KEY%)
 HotKey(%F_KEY%)
 HotKey(%X_KEY%)
THEN
 RESPONSE #100
SendTrigger(Myself, 1)
Continue()
END

IF
CombatCounterLT(1)
!Trigger(1)
THEN
RESPONSE #100
  DisplayStringHead(Myself,@8)
END

 

However , this ALSO doesn't does what i want for unrelated reasons (the "Instant Actions are not really instant" thread i opened), it doesn't trigger in the same AI tick.

 

It really seems it is impossible to have conditionals in a descending script with Continue() in BGScript in the same AI tick. As things that modify variables are actions (except See) they would never get set before the triggers were evaluated.

 

I think the dynamic memory (SetGlobals, Timers, Shouts, Triggers - except possibly LastSeenBy) is always a AI "tick" behind. The engine appears to be collecting all actions to do them at once.

 

Which is very inconvenient if you don't want to have npc casting duplicated mass buff effects or something, especially considering the key is hotkeys.

 

Maybe there is a "eventual" scheme i could follow that would do it. Maybe. But that would also be quite a waste of both processing time and possibly "round" game time.

 

BTW, that code above only prints @8 due to the Hotkey derived trigger when you release the button (once), which proves more or less that the Hotkeys always are delivered every round you keep them pressed (disregarding the weirdness with !).

Posted

IDS lookup files can generally be extended (or at least have new entries added, which allow modding tools and script compilers to reference 'new' values), e.g. specific.ids, gender.ids, so adding entries to hotkey.ids is expected. Likewise the plain/shift/control hotkey behaviour is expected. Finally, Ctrl-X is known and documented. Moving to archive.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...