Raised This Month: $32 Target: $400
 8% 

[QUESTION] Is this possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m00foo
New Member
Join Date: May 2007
Old 05-18-2007 , 04:36   [QUESTION] Is this possible?
Reply With Quote #1

Hello,

I am wondering is it possible to do the following programitcally using SourceMod. I am trying to make a mod to a custom gamepad controller that I made to play Half Life 2. But I want to see if I can program it.
  1. Finding the direction of who hit you (exact)
  2. Add properties to each gun, like Weight
  3. Grabing the movement of how the gun is hit (or I could just add more properties)
The reason is that, if I hardware designed a Simulated Gun, that will act like a virtual gun, similar http://novint.com/halflife2drivers.htm

I am trying to do something opensource, I have a strong background about Haptics and wishing to do something opensource, am I in the right place of something which will help me mod me own driver for custom device?
m00foo is offline
BAILOPAN
Join Date: Jan 2004
Old 05-18-2007 , 10:19   Re: [QUESTION] Is this possible?
Reply With Quote #2

SourceMod is a scripting engine. It doesn't explicitly contain features to do what you want, mostly because those properties tend to be very mod-specific, and SourceMod right now is just SDK abstraction. Your best bet would be to do one of:

1) Develop the code in C++;
2) If you wanted to allow for scripting in SourceMod, develop a C++ "extension" that added the necessary functions to the scripting platform;
3) Tell us what generic properties in the SDK need to be abstracted so we can plan to add them to an extension ourselves.
__________________
egg
BAILOPAN is offline
m00foo
New Member
Join Date: May 2007
Old 05-18-2007 , 13:56   Re: [QUESTION] Is this possible?
Reply With Quote #3

Quote:
Originally Posted by BAILOPAN View Post
SourceMod is a scripting engine. It doesn't explicitly contain features to do what you want, mostly because those properties tend to be very mod-specific, and SourceMod right now is just SDK abstraction. Your best bet would be to do one of:

1) Develop the code in C++;
2) If you wanted to allow for scripting in SourceMod, develop a C++ "extension" that added the necessary functions to the scripting platform;
3) Tell us what generic properties in the SDK need to be abstracted so we can plan to add them to an extension ourselves.
Thanks for your reply,
The code "should" be coded in C++, but I am wondering, where should I look at to grab the properties that I need. Cause I would like to do the following.

When a person shoots me from the left side, I can feel a force on the device that is coming from the left side. When I hold the virtual gun, I can feel the weight of it and force reactions when I shoot with it.

That is basically it. I get the weapon that is chosen, and I program a force to the device. In other words, I want the device to act instead of a mouse.

It would be nice if we could abstract the controlling functionality into sourcemod, so then I can make a module that interacts with a haptics device similar to Novint.com and Sensable.com .
m00foo is offline
BAILOPAN
Join Date: Jan 2004
Old 05-18-2007 , 14:15   Re: [QUESTION] Is this possible?
Reply With Quote #4

There are functions in the SDK that can be hooked and will give you hit group info. Look at the CTakeDamageInfo structure (takedamageinfo.h) and the damage+trace related functions in player.h
__________________
egg
BAILOPAN is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 05-18-2007 , 14:53   Re: [QUESTION] Is this possible?
Reply With Quote #5

This sounds like something you would do for the HL2 client, rather than on the dedicated server.
__________________
sslice is offline
el hippo
Member
Join Date: Jan 2006
Location: Texas
Old 05-18-2007 , 15:16   Re: [QUESTION] Is this possible?
Reply With Quote #6

It seems as though you need a way to grab things such as acceleration, hit directions, etc from games such as HL2.

The only problem with this is that it is mostly a client side project as sslice said. Since HL2 is a commercial Valve game, you would probably have to look for any 'secret' HID sdk stuff to see if there is any output data from the game. Otherwise you would probably have to hook into the process memory, or replace game binaries, which would be unwise unless you would only be playing in single player non-VAC mode.

The easiest way out of this would be to host a game with a listen server and load a plugin that way. The plugin would then have access to your system (USB, serial, etc) to allow you to feed data to your gamepad. You would also have direct access to player acceleration, attack, etc. This is a little hacky, but it shouldn't be too different from other C++ win32 i/o access projects.

Hippo
__________________
el hippo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode