C DLLs and UnrealScript

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Spalas

UnrealScripter
Apr 17, 2006
24
0
0
Hi,

Is it possible to use UnrealScript to call functions from a DLL that I've made in C?

Thanks in advance.
 

Spalas

UnrealScripter
Apr 17, 2006
24
0
0
Thanks Angel Mapper, I was looking at tutorials and so far I managed to export an .h file for my native class using ucc make. However, I got stuck since to make my DLL I need engine specific header files such as "engine.h" and "core.h". Well, it's been fun researching it anyway.
 

Gibberstein

Killing Floor Code Monkey
Apr 29, 2006
17
0
0
killingfloor.freedomsnet.net
Don't give up hope just yet - I know that it was possible to do exactly this for the UT edition of the engine and some of the other games based on that generation of the Unreal Tech. However I haven't had cause to try and do so for the 2kX generation engines, so I don't know if it is still possible in this generation. Maybe someone else can confirm one way or the other, and if it is possible give directions to an in-depth tutorial.

That said, the reason I haven't explored it is that UScript has always met my needs, and is portable across all platforms that the engine supports. That's a really big plus that shouldn't be thrown away casually. What do you need to do that can't be done in UScript? There's a lot of dusty UScript corners that aren't particularly well documented, but are definately still easier to work with than native code. Maybe I can point you at something UScript based that could do the job?
 

Switch`

Pixelante
Feb 27, 2004
98
0
0
Yes, you need headers for game DLLs though. If they aren't available (ie UT2004) then you'll have to roll your own or try something else.
 

Erebus

NULL
Apr 26, 2006
5
0
0
77.5S, 167.2E
Spalas said:
Is it possible to use UnrealScript to call functions from a DLL that I've made in C?

Its entirely possible to do that but you need to get hold of the Native c++ headers for the Unreal version you are using. These are freely available for UT99.

What are you trying to do?
 

Spalas

UnrealScripter
Apr 17, 2006
24
0
0
Thanks for your replies,

I'm using UT2004 and trying to get input from a USB input device which comes with its own API. I assume "talking" to such devices is not supported through UnrealScript unless you provide a DLL that tells UT2004 how to do it.

I'll have a look at UDPLink and TCPLink suggested by [Sixpack]-Shambler-.

Please post any other workaround if you know of any.
Thanks
 

Spalas

UnrealScripter
Apr 17, 2006
24
0
0
So if I got that right all I have to do is create a program that listens for connections in the localhost at some port and use SendText in an UnrealScript TCPLink subclass to pass requests to it.

That's genius.

If I get this working I'll share it with you.

Thanks everybody
Off to work now!!!
:D :D :D
 

Spalas

UnrealScripter
Apr 17, 2006
24
0
0
Wormbo, I'll have a look but I doubt it. It's datagloves I'm talking about. 10 sensors outputing different values in certain ranges.
 

Erebus

NULL
Apr 26, 2006
5
0
0
77.5S, 167.2E
Wormbo said:
If there's a way for the input device to map its controls to joystick axes and buttons, you might be able to use them directly in any UnrealEngine game.

You could get 12 float input axes via this method.

MouseX,
MouseY,
MouseZ,
MouseW (Intellimouse wheel),
JoyX,
JoyY,
JoyZ,
JoyR (joystick rudder),
JoyU,
JoyV (joystick alternate axis for example the Panther XL trackball).
JoySlider1,
JoySlider2,

I personally would be surprised if a dataglove cannot be configured to do this unless it is one of those old Nintendo ones. I which case you can probably hack it's driver to provide them.

Sounds like an interesting project. What kind of gloves are they and how are you tryuing to use them?
 
Last edited:

Spalas

UnrealScripter
Apr 17, 2006
24
0
0
Sounds like an interesting project. What kind of gloves are they and how are you tryuing to use them?

I'm using the 5DT Data Gloves. I'm primarily trying to read their values from UT2004 which I have partially managed using the TCPLink and a server Win32 application as suggested by [Sixpack]-Shambler-.

And as a second objective, trying to demonstrate its use through a "simple" game. The idea for a game is a racing game controlled with hand gestures since these gloves can only report finger movement (no tilt, or movement in 3D, hence 10 sensors only).

You could get 12 float input axes via this method.

MouseX,
MouseY,
MouseZ,
MouseW (Intellimouse wheel),
JoyX,
JoyY,
JoyZ,
JoyR (joystick rudder),
JoyU,
JoyV (joystick alternate axis for example the Panther XL trackball).
JoySlider1,
JoySlider2,

I believe that I already have a way to get the input from the gloves which also retains these values. But If I were to do it like that, how would I change these values? The gloves do not have a utility to map to these values directly (none that I'm aware of at least), however it provides an API to talk directly to the driver.

Thanks for your suggestions
 

Spalas

UnrealScripter
Apr 17, 2006
24
0
0
According to http://www.vrealities.com/5dtglove5.html they do "Mouse emulation" and "Joystick Emulation"

There probably is some sample code that shows you how to do it, but I would prefer to keep the mouse and joystick functionality while still supporting the gloves.

pricey **** dude:lol:

Yes they are indeed. I guess part of my fees went there so I practically paid for them although I'm not taking them home with me when the course is over.:lol: