It is currently Mon Oct 23, 2017 7:06 pm




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Writing a latent function. 
Author Message
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 395
Post Re: Writing a latent function.
atrey65789 wrote:
Do I call RegisterNames() in the native functions I am importing?

You need to call it once so your the names get initialized, you just need to make sure this gets called at least once (before you use any name, like when doing your event* call). Classic place these were called are inside UEngine and subclasses Init() method, for dx they also put it into other places like DeusExPlayer. So i think just calling it off the constructor of your class you add should work fine.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Sat Sep 30, 2017 9:40 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 395
Post Re: Writing a latent function.
You don't have do copy each individual include file you need into src, just add the relative paths to the dirs they reside as include paths to the project.

Also you should use relative paths to libs like Core.lib, WinMM.lib should be in VC library dir anyway, etc.

You could use SampleNativePackage project files out of ut/rune pubsrc as a template to properly set it up.

Also you can create a file named as the C++ name of the class, e.g. Inc\AUnrealMidi.h which gets autoincluded in the class definition to put the declaration for the ctor and poll exec in.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Sun Oct 01, 2017 4:34 am
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 395
Post Re: Writing a latent function.
Did a bit of experimenting around, cleaned up the stit and added some define to test just basic ue polling code, etc.

http://coding.hanfling.de/UnrealMIDI.zip

Turns out, the reason why the polling exec was never called is because you didn't set up your project correctly and in particular used an struct alignment of 8 instead of 4 and thus due to changed alignment LatentAction was apparently never written to right place and hence having no effect.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Sun Oct 01, 2017 5:33 am
Profile
Thug

Joined: Tue Jun 26, 2012 3:32 am
Posts: 49
Post Re: Writing a latent function.
This looks great, I am studying the heck out of this and noting your revisions. Did this compile for you? I am getting 3 errors all regarding redefinitions, but looking over everything, all the error-related functions are only defined once. They include the function you made that calls RegisterNames() (It says it already has a body), The poll function (MidiPoll) and MidiPollTemp, where I cannot find anywhere but the error brings me to the IMPLEMENT_FUNCTION line for MidiPoll.

Thank you very much so far, I am impressed as heck about your proficiency of C++


And I saw what you were saying about each individual header being in my source, I did that because I couldn't get the paths of them to work, wierd stuff. I swear I was putting in the correct path for an hour, so I did this to save me a headache.


Mon Oct 02, 2017 5:43 pm
Profile
Thug

Joined: Tue Jun 26, 2012 3:32 am
Posts: 49
Post Re: Writing a latent function.
I got it to compile, but still isn't calling the Poll function... question, I have a callback function that actually detects the midi signal and message, that sort of acts as a poll function, as it waits for detection of what it is looking for. I tried using it to call eventMidiMessage and got this error: 'AUnrealMIDI::eventMidiMessage' : illegal call of non-static member function.

It also tells me to look at its declaration, in a sense that I am giving it incorrect parameters, but it has two parameters (both being strings) which is what I give it.

Maybe there is a way to get it to work?


Tue Oct 03, 2017 4:21 pm
Profile
Thug

Joined: Tue Jun 26, 2012 3:32 am
Posts: 49
Post Re: Writing a latent function.
Got the poll function to work, almost there thanks to your help... The function in-game waits patiently for detection before it moves on with the rest of the state... Now all I need to figure out is why the callback function isn't detecting midi input.

Edit: I found the issue to that too, fixed that.. very close.

Last Edit: fixed the final issue which was the engine only accepting one midi input due to not closing the midi port at the end of the function. Everything works the way I need it to to advance with what I want to do.


Hanfling, what can I say, you went above and beyond by helping me for a month with this and I appreciate every single bit of it.


Fri Oct 06, 2017 2:07 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forum/DivisionCore.