Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » big new engine feature added to scripts 2.1, Keyboard Hooks
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134444] Wed, 26 January 2005 01:57 Go to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

I have jsut completed adding the new keyboard hooks feature to scripts.dll 2.1 as well as the first scripts that will use it (the Jetpack scripts)

How it works is this:
Firstly, there is code that runs on the client.
At startup, the client reads a file called keys.cfg from the data folder (the name and/or location may change).
This file contains lines of the form Jetpack=Y_Key or Deploy=U_Key
The first part can be any string you like and is the "logical key" name which is used later when the script registers the hook.
The second part is one of the standard renegade key names (a full guide/list and possibly a GUI application or custom renegade dialog for editing the config file will be included with 2.1 when its released).
The code takes each line and adds it to a data structure containing key entries.
Each entry contains the logical key name, the number corresponding to the physical key (there is a function in renegade to do the conversion which I have hooked and am using) and the current "key value" (i.e. the value returned from the renegade input code)

Then, it installs a hook into the renegade input processing. This hook iterates through the key list created when the config file was read in.
for each key, it asks the input system for the "state" of the physical key involved.
some extra code is then invoked to make sure that keypresses are only triggered once (I can make it recognize multiple keypresses if a use comes up where recognizing repeat keypresses/key is held down arrises but for now it was easier to make it only recognize one keypress at a time)
After this, if the result was that the key was pressed (and it was in the released state last time the input check ran), a message is sent to the server part of the code.
This contains the logical key name that has been depressed along with the player ID of the player who pressed the key.

A script notifies the server code that it wants to process a given key by handing it 4 things:
The address of the hook procedure
The logical key it is interested in
The player ID it is interested in (obtained e.g. from a GameObject via Get_Player_ID)
and a piece of data that can be whatever you want.
The same data will be given back to the hook procedure when it is called.
There is also a process to unregister a hook when you have finished (e.g. when the infantry unit with JFW_Jetpack on it dies or buys a new character)

When the keypress message is recieved by the server, it loops through all the registered hooks.
If it finds a hook where the player ID and logical key name match with the ones sent from the client, the hook is called (passing in the data that was passed in when the hook was reigstered).
Then, the hook can do whatever you want it to do.

So far, the hook has been used for the Jetpack script which is to go on the jumpjet infantry for Reborn, it can also be used for the soviet cosmonaut infantry in RA2Ven if required and in fact anything else where you want infantry that can "fly" (including if you wanted spellcasting infantry that could levitate).
It is also planned to be used for the underground digging logic (Subterranian APC/flame tank) and the deploying vehicle logic (e.g. tick tank and lots of other stuff in many games)


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134463] Wed, 26 January 2005 06:19 Go to previous messageGo to next message
Majiin Vegeta is currently offline  Majiin Vegeta
Messages: 2186
Registered: February 2003
Location: London
Karma: 0
General (2 Stars)
nice work Smile
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134464] Wed, 26 January 2005 06:50 Go to previous messageGo to next message
glyde51 is currently offline  glyde51
Messages: 1827
Registered: August 2004
Location: Winnipeg
Karma: 0
General (1 Star)
All I understand is that this is kick ass.

No. Seriously. No.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134475] Wed, 26 January 2005 09:18 Go to previous messageGo to next message
Sir Kane
Messages: 1701
Registered: March 2003
Location: Angerville
Karma: 0
General (1 Star)
First off, "keyboard hooks" are normally used in keyloggers.
So who would want something that installs "keyboard hooks"?
I can certainly say that I wouldn't want that. That's just my
opinion there.

And I have had something that's placed in the Renegade input
code (which garuanteed only worked when the input devices are
acquired, meaning it only works then the game has focus) to
check keypresses for like 3 or 4 month now. It was supposed
to be used for RenAlerts chronotank and other stuff.


Proud N9500 and proud N6270 user. Creator of the IEE libraries (original bhs.dll) and the RB series software.
http://n00bstories.com/image.fetch.php?id=1189992501http://www.n00bstories.com/image.fetch.php?id=1257492907
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134486] Wed, 26 January 2005 12:10 Go to previous messageGo to next message
vloktboky is currently offline  vloktboky
Messages: 290
Registered: February 2003
Location: Kentucky, USA
Karma: 0
Recruit

Lol, good job. How long did it take you to do this again? Laughing

But seriously, what good is this going to do? Attach a script to an object on a fan map that will never be made so when anyone presses their M key, the object blows up? Pointless.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134516] Wed, 26 January 2005 15:53 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

This is for Reborn for the Jumpjet infantry so you can toggle the jetpack on and off.
And its for the deployable vehicles
And its for the dig logic.

And its there for other mods too (e.g. ra2ven, swmod etc)


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134590] Wed, 26 January 2005 23:15 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
Too bad all of those are either dead or will take a year to get released, if they ever do.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134613] Thu, 27 January 2005 07:37 Go to previous messageGo to next message
Blazea58 is currently offline  Blazea58
Messages: 408
Registered: May 2003
Karma: 0
Commander
Aircraftkiller

Too bad all of those are either dead or will take a year to get released, if they ever do.


To bad renalert never came out, lol


http://i175.photobucket.com/albums/w125/Blaze558/ECW_WebBanner1.jpg
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134614] Thu, 27 January 2005 07:39 Go to previous messageGo to next message
Deactivated is currently offline  Deactivated
Messages: 1503
Registered: February 2003
Karma: 0
General (1 Star)
Blazea58

Aircraftkiller

Too bad all of those are either dead or will take a year to get released, if they ever do.


To bad renalert never came out, lol


Version 1.0 for Renegade, that is.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134640] Thu, 27 January 2005 11:58 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
It never came out? I guess all those memories of like 15 private beta tests and at least five public versions were just a dream...
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134656] Thu, 27 January 2005 13:59 Go to previous messageGo to next message
Spice
Messages: 1448
Registered: November 2003
Location: Ohio
Karma: 0
General (1 Star)
Aircraftkiller

It never came out? I guess all those memories of like 15 private beta tests and at least five public versions were just a dream...


They were just betas , Beta's don't count for shit. The mod was never finished.

The only finished mod out there is sole survivor and all that was done by only 2 people.


http://img46.imageshack.us/img46/8027/userbar358428pu3.gif
big new engine feature added to scripts 2.1, Keyboard Hooks [message #134658] Thu, 27 January 2005 14:05 Go to previous messageGo to next message
WNxCABAL is currently offline  WNxCABAL
Messages: 1391
Registered: July 2004
Karma: 0
General (1 Star)
I think he means the final release.


Nice work JonWil!


Warrior Nation Number One Gaming Clan In The World Razz

http://www.tibnas.com/Outbound_Images/wnxcabal_cabalcc3kw_sig_ani.gif
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135339] Mon, 31 January 2005 06:16 Go to previous messageGo to next message
blackhand456 is currently offline  blackhand456
Messages: 146
Registered: January 2004
Karma: 0
Recruit
i dont think ren alert will have a final release for awhile

http://img.photobucket.com/albums/v244/blackhand456/Sigg.gif
Aim: BlackHand456
Msn: lacrosse_ideot456@hotmail.com
WOL: blkhnd456
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135411] Mon, 31 January 2005 14:14 Go to previous messageGo to next message
WNxCABAL is currently offline  WNxCABAL
Messages: 1391
Registered: July 2004
Karma: 0
General (1 Star)
or ever :rolleyes:

Warrior Nation Number One Gaming Clan In The World Razz

http://www.tibnas.com/Outbound_Images/wnxcabal_cabalcc3kw_sig_ani.gif
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135770] Wed, 02 February 2005 13:42 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
Because we stopped working on it. But unlike everything made for this pathetic game, we have had more than one release. More like over 15 in the three years we worked on it, which is more than any of you idiots can say... Especially you, The Fucking Whiner Andy.

The version number is irrelevant. A 1.0 release is still a public beta for that Sole Survivor thing because it sucked so hard that no one would even play it after two days, yet we kept a consistent fanbase that continually grew over two years until Half Life 2 was out, where they all went... Which means that's where we went as well.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135778] Wed, 02 February 2005 14:03 Go to previous messageGo to next message
liberator is currently offline  liberator
Messages: 246
Registered: May 2003
Location: Classified, Level Phi cle...
Karma: 0
Recruit
Funny thing ACK? There are more people playing Ren now than there were when I started. Fact is with HL2 you have to deal with Valve and all their neurotic BS paranoia as well as the CS kiddies and their "skillz". I got better things to do with my time than babysit.

There was a time when people were impressed that I have the firepower to decimate a planet in under 10 minutes.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135780] Wed, 02 February 2005 14:06 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
Funny thing is that since I started playing, which was 3 December of 2001 in the first private beta test for Renegade, more players have been lost than gained. Renegade initially had around 70,000 players... Now the number is like 2,000. That's horrible.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135782] Wed, 02 February 2005 14:17 Go to previous messageGo to next message
icedog90 is currently offline  icedog90
Messages: 3483
Registered: April 2003
Karma: 0
General (3 Stars)
Actually, there are 5,582 ranked players on WOL. Two months ago there were about 20,000... I wonder what happened in the span of two months. :/

Damn, I missed my "1337" post by accident...
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135845] Wed, 02 February 2005 17:11 Go to previous messageGo to next message
WNxCABAL is currently offline  WNxCABAL
Messages: 1391
Registered: July 2004
Karma: 0
General (1 Star)
Aircraftkiller, you are the Simon Cowell of this forum & Ren Community.
You talk shit, nobody likes you & people don't like your opinions!


Warrior Nation Number One Gaming Clan In The World Razz

http://www.tibnas.com/Outbound_Images/wnxcabal_cabalcc3kw_sig_ani.gif
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135846] Wed, 02 February 2005 17:13 Go to previous messageGo to next message
cheesesoda is currently offline  cheesesoda
Messages: 6507
Registered: March 2003
Location: Jackson, Michigan
Karma: 0
General (5 Stars)

Funny thing about that is, Simon's my favorite judge. Also, on the American Idol site before the season started, Simon was the judge voted most missed by fans of the show.

whoa.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135850] Wed, 02 February 2005 17:17 Go to previous messageGo to next message
WNxCABAL is currently offline  WNxCABAL
Messages: 1391
Registered: July 2004
Karma: 0
General (1 Star)
If only you lived in the UK, to which we have a different view of him Wink

Warrior Nation Number One Gaming Clan In The World Razz

http://www.tibnas.com/Outbound_Images/wnxcabal_cabalcc3kw_sig_ani.gif
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135870] Wed, 02 February 2005 18:39 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
1. I don't know who Simon Cowell is and I most likely don't care.

2. You don't speak for anyone but yourself. Saying "no one likes you or cares about what you think" is contradictive and wrong. If we're going to talk about what everyone doesn't care about, I'd say it's you... But then again, I don't speak for everyone like you attempt to.

3. This isn't a Ren & Stimpy community. It's a Renegade community.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135874] Wed, 02 February 2005 19:04 Go to previous messageGo to next message
liberator is currently offline  liberator
Messages: 246
Registered: May 2003
Location: Classified, Level Phi cle...
Karma: 0
Recruit
1) Have you been under a rock for a couple of years?

2)I think you're a prick most of the time....

3)Who cares you eeeediot? Laughing


There was a time when people were impressed that I have the firepower to decimate a planet in under 10 minutes.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135875] Wed, 02 February 2005 19:06 Go to previous messageGo to next message
Aircraftkiller is currently offline  Aircraftkiller
Messages: 8213
Registered: February 2003
Karma: 0
General (5 Stars)
I don't pay attention to pop culture or whatever "new" thing is going on most of the time. It's a waste of energy to care about someone who doesn't give a damn about you.
big new engine feature added to scripts 2.1, Keyboard Hooks [message #135888] Wed, 02 February 2005 20:51 Go to previous messageGo to previous message
Blazer is currently offline  Blazer
Messages: 3322
Registered: February 2003
Location: Phoenix, AZ
Karma: 0
General (3 Stars)
Administrator/General

Yet you turned your back on what I have seen to be the most loyal members of the gaming community to join the HL2 hypefest Wink
Previous Topic: Waypoints
Next Topic: mod install on server
Goto Forum:
  


Current Time: Mon Nov 11 07:18:33 MST 2024

Total time taken to generate the page: 0.01494 seconds