Operation Flashpoint Dragon Rising OFDR Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

DXOverlay Mod

5 posters

Go down

DXOverlay Mod Empty DXOverlay Mod

Post by Regg Tue 21 May 2013, 02:04

I posted this in another thread earlier, but we were getting off-topic...

Had a chat with TJDagger last night, and he pointed me to the Dragon Rising Open Programming Project (DROPP). He had been playing with the DirectX Overlay (DXO) module without any success. I was able able to get the example missions working, and I think I know how it's done.

DXOverlay Mod Ofdr-m10

DXOverlay Mod Ofdr-m11

Dschonny (I assume) wrote a new Direct3D library (d3d9.dll) which is a wrapper/pass-through for the standard D3D functions, but also has additional functions for the overlay. Here's an excerpt from a post I found:

I'm currently working on a code-injection project for OPFlashpoint: DragonRising using a proxy-dll-hook. Target is to make custom UI-Elements available to Mission-Designers, which works pretty well so far. The game uses an edited d3d9.dll placed in the game folder which does the custom drawings and hands over all d3d-functions to the original d3d9.dll in the win/sys32-folder.
Just like OWP, the DLL watches a text file for commands related to the overlay. The hotkey functionality is also in this DLL, so there is no need to launch a separate EXE for hotkeys! Of course, it looks like fewer keys are supported than with ofpdr-hotkeys.exe, and it relies on an external config file to specify which function to run, rather than being handled internally as with the EDX.

DROPP claims to be open-source, and while all the Lua code is available, I don't see any source code for Dschonny's d3d9.dll. If we had access to that code, I think this could be the answer to several modding wishes. Without the source, we may still be able to make some progress, but I fear conflicts between the two hotkey systems. Does anyone around here know Dschonny? There's an active Steam account with this name, but I don't have a Steam account myself!

I found another thread discussing DirectX proxy/wrapper DLL's, and there is even some real basic code available. Unfortunately, my C++ isn't what it used to be, nor do I feel like having to learn all the code needed to draw on the screen! So it would be really great if we could get Dschonny's code. I still have Visual Studio 2010 so we can compile code, and I wouldn't mind tinkering with an existing code base.
Surprised
Regg
Regg
Veteran

Points : 143
Reputation : 10
Join date : 2013-02-22

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by Regg Tue 21 May 2013, 03:02

Initial testing is not showing any conflicts with running ofpdr-hotkeys.exe and loading Dschonny's d3d9.dll. Hotkeys in The Perfect Plan are working as they should.
Regg
Regg
Veteran

Points : 143
Reputation : 10
Join date : 2013-02-22

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by Regg Wed 22 May 2013, 08:31

Got the dxoverlay.lua script from DROPP working with the EDX! I noticed there are issues when you restart a mission and dxo.init() gets called again, the screen resolution doesn't come back correct. Not sure if this is a bug in the DLL, but I'll play around more when I have time.

DXOverlay Mod Bcr-dx10

Cool
Regg
Regg
Veteran

Points : 143
Reputation : 10
Join date : 2013-02-22

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by TheGeneral Wed 22 May 2013, 11:16

nice work dude!

looks like ya really getting stuck into a tool that has boggled a few heads over the years.
TheGeneral
TheGeneral
Admin

Points : 780
Reputation : 35
Join date : 2012-12-15

http://maniacaldog.wix.com/keepdralive

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by John J. Stevens Wed 22 May 2013, 11:56

if dxo.reset() BEFORE calling it doesn't work

two approaches here - the easy one would be to execute a dxo function that has a simple callback to validate before calling dxo.init() - kind of like what coders did to roll their own fileexists function by trying to open a file that didn't exists

the other is more of a kluge - perhaps a breadcrumb worth of a txtfile with last start date/time in it -
1) the mission script checks if exists, meaning the program didn't exit properly
2) if the time date is significantly diff than current then it is safe to erase it and do line 3
3) after a dxo.init() the script creates the breadcrumb with current time date
4)at end of mission it deletes the breadcrumb

the only other thing is possibly leaving that breadcrumb in a persistent table in memory - like in the DR editor we don't know all of the functions that are exposed.


Last edited by John J. Stevens on Wed 22 May 2013, 17:28; edited 1 time in total
John J. Stevens
John J. Stevens
Admin

Location : WV/PA
Points : 285
Reputation : 22
Join date : 2012-12-19

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by nepgeargo Wed 22 May 2013, 12:44

What the!!! mate this looks cool but what is this exactly for? is it a menu thing that u can choose what to do in DR? ;o
nepgeargo
nepgeargo

Points : 62
Reputation : 0
Join date : 2013-03-20

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by Regg Wed 22 May 2013, 22:37

JJ --

Found a quick fix for the resolution issue, don't delete 'resolution.dat' after it has been checked! Of course it's not been fully tested, but I can restart missions. I haven't tried changing the resolution and starting a new mission, but I think this will have an issue. Restarting the game will update 'resolution.dat' however, so if you change resolution, re-launch the game.



Omar --

The DirectX Overlay (DXO) will allow you to display your own images and text anywhere on the screen! DROPP has some modules for menus already, and they could be made to work with the EDX. TJDagger and I have been discussing an image-based menu module that would just show different images for each menu screen, rather than dealing with placing and rendering text.


I'm still playing with code for this, but I'll post something soon! study
Regg
Regg
Veteran

Points : 143
Reputation : 10
Join date : 2013-02-22

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by nepgeargo Thu 23 May 2013, 03:34

whoa so i can make menus with DROPP! awesome! time to dig out my copy Razz ill add it into my missions if i can figure out how to use it
nepgeargo
nepgeargo

Points : 62
Reputation : 0
Join date : 2013-03-20

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by Regg Thu 23 May 2013, 07:43

Good luck with DROPP!! Check out the 'dialogs2' example mission for a multi-level menu. Remember that DROPP has its own hotkey system, which I think is a little trickier to setup.

Hopefully between me and tjdagger, we'll get something together for the EDX in the coming weeks, maybe sooner.
Regg
Regg
Veteran

Points : 143
Reputation : 10
Join date : 2013-02-22

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by dewi316 Sat 25 May 2013, 02:08

How to Create a CNN-Style News Ticker in Adobe Premiere Pro
maybe you could use this mod for this type of application.
Personally I found the mission updates in some missions were just not noticeable enough.
You had other screen clutter which took away from main objectives.
Use yellow and black font and your a winner.sunny
dewi316
dewi316
Veteran

Location : swansea
Points : 179
Reputation : 22
Join date : 2012-12-19

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by Regg Sat 25 May 2013, 02:24

Scrolling text sounds like pain in the ass to code, but you could easily have 'pop-up' messages that display and disappear after a few seconds. Maybe have a hotkey to display the last message. The DXO mod allows the user to pick the font, size, weight, and colors for text. Use a timer to alternate the text color and background color between black and yellow for a real hi-viz message.
Regg
Regg
Veteran

Points : 143
Reputation : 10
Join date : 2013-02-22

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by dewi316 Sun 30 Jun 2013, 14:01

Regg wrote:Got the dxoverlay.lua script from DROPP working with the EDX! I noticed there are issues when you restart a mission and dxo.init() gets called again, the screen resolution doesn't come back correct. Not sure if this is a bug in the DLL, but I'll play around more when I have time.

DXOverlay Mod Bcr-dx10

Cool


Definitely a conflict happening somewhere in this code, screen resolution gone too crap needs looking at.
dewi316
dewi316
Veteran

Location : swansea
Points : 179
Reputation : 22
Join date : 2012-12-19

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by Regg Sun 30 Jun 2013, 18:47

Dewi-

I haven't posted any code yet! Not sure what you're messing with, but I did encounter a screen resolution issue early on. Check my posts further up. A solution has been found, which neither I nor Tjdagger have had issues with. Of course I think we're the only ones with the working code at this moment! Progress towards release has been steady, as you can see in this thread.
Regg
Regg
Veteran

Points : 143
Reputation : 10
Join date : 2013-02-22

Back to top Go down

DXOverlay Mod Empty Re: DXOverlay Mod

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum