Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN2 IDEAS

- Jump to comments -
Name  UI / Script / GetKey
Author  Irgenwo
Submitted / Updated  10-20-2007 / 10-30-2007
Category  Script
Short Description  a hook to send serverside any key typed clientside
Type  Improvement
NWN2Game  All
Description
In NWN2, key inputs seems to be deeply hardcoded. as proof, you ll have noticed that there ain't any keyboard shortcut in the different menus (which are simply xml gui files)
That was a problem for me cause i was trying to code a piano, and i would have liked the ability to use my keyboard in a fasttracker way (for those who remember ^^ ), but i guess many minigames could be implemented serverside with this method.

As i kinda found a solution ( a barbaric one, but nonetheless ^^), I'd would like to get comments and/or ways to improve it.

here we go:

-in my "ingamegui.ini" and "ingameguix1.ini", i added, under [mandatory Gui]:

SCREEN_GETKEY=getkey.xml
a=getkeya.xml
z=getkeyz.xml
e=getkeye.xml
[etc...]

-the getkey.xml file contains this UIText (among other things, the rest is standard gui to open and close)
<UIText name="inputbox" x=0 y=30 width=20 height=20 text=""
fontfamily="International" multiline="false" returnrestricted="true" editable=true
selectable=true maxlength=1 filter="alpha" allowspace="false" allowpunc="false"
update="true"
OnUpdate0=UIObject_Misc_SetLocalVarString(local:0)
OnUpdate1=UIButton_Input_ScreenOpen(local:0,"false")
/>

-the getkeya.xml is as follow (and is a template for the rest of them)
<UIScene name="a" width=10 height=10 x=100 y=100 draggable=true
priority="SCENE_SCRIPT" modal="false"
idelexpiretime=0.1f
<!-- expiretime=0.1f -->
OnCreate=UIObject_Misc_ExecuteServerScript("gui_getkey","a")
/>

- finaly, the gui_getkey script (aside from the pure treatment of the key entered) always empty the inputbox (with SetGUIObjectText(OBJECT_SELF, "SCREEN_GETKEY","inputbox",-1,"") ) and close the calling UIScene (with CloseGUIScrenn (OBJECT_SELF, sInput) ).


when i click on the inputbox, i get myself a catch for any letter typed :)
It works very well on my local machine, but i can't test the influence of a server response time

this method is kinda ulgy, i know (27 xml files (only lower case)) and i don't know yet wether or not i could make it in a hak or override of some sort. plus this is definitely not idiot-proof...

anyway, any comment or advice is welcome :)

Edit:

Rah, the comments section doesn't allow < and > ...

here is what is suposed to be in the blank in the second comment :

<UIText name="inputbox" x=0 y=30 width=50 height=20 text="" fontfamily="International"
multiline="false" returnrestricted="true" editable=true selectable=true maxlength=1
filter="alpha" allowspace="false" allowpunc="false"
update="true"
OnUpdate0=UIObject_Misc_SetLocalVarString(local:0)
OnUpdate1=UIObject_Input_ClearTextfield("inputbox")
OnUpdate2=UIObject_Input_SetFocus(local:0)
/>

<UIText name="a" x=0 y=60 editable=true OnGainedFocus=UIObject_Misc_ExecuteServerScript("gui_getkey","a") />
<UIText name="z" x=0 y=60 editable=true OnGainedFocus=UIObject_Misc_ExecuteServerScript("gui_getkey","z") />
<UIText name="e" x=0 y=60 editable=true OnGainedFocus=UIObject_Misc_ExecuteServerScript("gui_getkey","e") />
<UIText name="r" x=0 y=60 editable=true OnGainedFocus=UIObject_Misc_ExecuteServerScript("gui_getkey","r") />
[etc]

Files

NameTypeSizeDownloads
piano.xmlpiano.xml
Submitted: 10-20-2007 / Last Updated: 10-30-2007
xml6.4Kb132
I open this ui via script, it's a fonctionning getkey of some sort, it calls gui_piano( ' key pressed ' ) when you press a key (yeah :D ).
SCORE OUT OF 10
N/A
Cast Your Vote!
Voting FAQ

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (3):

Posted by charlievale at 2007-10-25 13:20:42    
Nice idea. Could you upload all the get_key*.xml files?
_________________________
Charlie's Pages | Fournoi Forum | Charlie's UI | Charlie's Item Modifier | Charlie's Item Appearance Changer

Posted by Irgenwo at 2007-10-24 02:47:23    
Ok, sorry for the barbaric version above, there is way, way simplier

I tried the version below with the event OnLostFocus, which seems to be broken (and abandoned it...) but i just noticed that OnGainedFocus ain't, so...

this is in my getkey.xml (only file required, now) :







[etc...]

the script only handels processing.

UIObject_Input_SetFocus(local:0) being kinda a conditional statement, i think this could be useful for other types of ui programing

Posted by Irgenwo at 2007-10-21 08:58:41    
in the UIText, add:
OnUpdate2=UIObject_Input_ClearTextfield("inputbox")
and in the getkeya.xml, reenable the expiretime=0.1f

this prevents the client to continuously send requests to the server when he's not responding, so the gui_getkey script can only focus on processing the data.
That mainly means one or two server->client transfert is avoided

You must be Logged In to post comments in this section.

10 - A Masterpiece, Genuinely Groundbreaking
9 - Outstanding, a Must Have
8 - Excellent, Recommended to Anyone
7 - Very Good, Deserves a Look
6 - Good, Qualified Recommendation
5 - Fair, Solid yet Unremarkable
4 - Some Merit, Requires Improvements
3 - Poor Execution, Potential Unrealized
2 - Very Little Appeal
1 - Not Recommended to Anyone

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 UI


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters