stigzler Posted October 27, 2015 Share Posted October 27, 2015 So - in terms of debugging - guess you can't use the VIsual Studio debugger as you have to compile and run? Do you debug via logging? Quote Link to comment Share on other sites More sharing options...
Adultery Posted October 27, 2015 Author Share Posted October 27, 2015 Right, and yes.It's a hard biz. Quote Link to comment Share on other sites More sharing options...
stigzler Posted October 27, 2015 Share Posted October 27, 2015 ..but someone's gotta do it, right? Quote Link to comment Share on other sites More sharing options...
stigzler Posted October 27, 2015 Share Posted October 27, 2015 Ouch. Was going great guns and getting excited about plugin development, until I hit the reality of debugging. It looks like if your code in an event handler causes an error - this doesn't get caught via the JIT (?), rather it returns false or something to GameEx and gameex closes/disables the plugin? Looked in the GameEx log, and this is what I found:14:53:41.6 27/10/2015: PlugIn: "Marquee Masher" caused an exception and is being disabled.14:53:41.6 27/10/2015: Exception has been thrown by the target of an invocation.14:53:41.6 27/10/2015: at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)14:53:41.6 27/10/2015: at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)14:53:41.6 27/10/2015: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)14:53:41.6 27/10/2015: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)14:53:41.6 27/10/2015: at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)14:53:41.6 27/10/2015: at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)14:53:41.6 27/10/2015: at GameEx.PlugIns.InvokeMethod(Object obj, String sProperty, String oValue)14:53:41.6 27/10/2015: at GameEx.PlugIns.Event_EmulatorLoad(String EmuName)Ouch. I have no idea how to apply this to the code area concerned - is there any way to get the MS error reporting back (is it the JIT debugger or something?) Quote Link to comment Share on other sites More sharing options...
Adultery Posted October 27, 2015 Author Share Posted October 27, 2015 Your best bet here is to put all your code in a try/catch block and log the error. I can provide an example for you if you are already using a log file, or I can look at your code. Your choice. 1 Quote Link to comment Share on other sites More sharing options...
stigzler Posted October 27, 2015 Share Posted October 27, 2015 Aha! Yeah that would make sense. Yerp - using your logging class - so any code that can write to outer and inner (?) exceptions to log file would be fab - thanks! (btw - loving this plugin malarky!) Quote Link to comment Share on other sites More sharing options...
Adultery Posted October 27, 2015 Author Share Posted October 27, 2015 Assuming you've code initializes the logger class...Try yourcodehere(variable)Catch ex As Exception log.Log_Error(ex.Message) log.Log_Data(ex.StackTrace)End Try 1 Quote Link to comment Share on other sites More sharing options...
stigzler Posted October 27, 2015 Share Posted October 27, 2015 Nice one - I shall await the inevitable slippery error at some point to try it out... Quote Link to comment Share on other sites More sharing options...
stigzler Posted October 29, 2015 Share Posted October 29, 2015 Oh get in.... loving this plugin development thing now... just don't look under the hood... So, in your tmeplate, Adultery, there's this stuff: Public Sub Dispose() Dispose(True) GC.SuppressFinalize(Me) End Sub ''' <summary> ''' This event handles the disposal of unused variables. ''' </summary> Private Sub Dispose(ByVal disposing As Boolean) If Not (Me.disposed) Then If (disposing) Then End If End If disposed = True End SubBit confused by this bit. Firstly - not very good with disposing stuff - what should I dispose of?Secondly - where should i stick any code - after "If (disposing) Then"?Thanks for getting me up and running with yet another great tinker-tastic feature of GameEx! Quote Link to comment Share on other sites More sharing options...
Adultery Posted October 30, 2015 Author Share Posted October 30, 2015 You shouldn't need to do anything there unless you are adding your own handles, are reserving memory, holding files and blocking access to them, holding registry values, or unmanaged code or something. GameEx and/or Windows will automatically take care of your garbage collection when you exit the app.Here's more on that: https://msdn.microsoft.com/en-us/library/fs2xkftw%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396 1 Quote Link to comment Share on other sites More sharing options...
stigzler Posted October 30, 2015 Share Posted October 30, 2015 That's good news! Another couple of questions. With attract mode:Is there any way to get what game and system are playing? The code is Public Function Event_ScreenSaver(ByVal Type As Integer) As BooleanThere's no Dim Info As Game_Info = DirectCast(Marshal.PtrToStructure(InfoPtr, GetType(Game_Info)), Game_Info) To get the game details? Also - is there any way to start the attract mode manually from the GE UI? I'm sure I remember there was a launch screensaver option - but I can't find it for love nor money - i remember making a graphic for it, but now it no there cheers Quote Link to comment Share on other sites More sharing options...
Adultery Posted October 30, 2015 Author Share Posted October 30, 2015 For one: Yes. Get it from the game run event. That event only triggers when attract is actually started or exited, nothing more to see there. It still passes games through the same process of events > Game Run, Command Line, Game Exit. For two: Yes. It's under more programs menu unless you have it disabled. 1 Quote Link to comment Share on other sites More sharing options...
stigzler Posted December 11, 2015 Share Posted December 11, 2015 Me again!Does it absolutely have to be .net 2.0, or can you use 3.5? Just need to use linq stuff + not avail on 2.0. Have tried it with 3.5 and everything seems to be working OK...unless there some hidden snakes that are gonna bite further down the track? Quote Link to comment Share on other sites More sharing options...
Adultery Posted December 12, 2015 Author Share Posted December 12, 2015 Yes it does, you'll lose compatibility for users on other OS's. The reason it works for you is probably because you're on an OS with 3.5 or up.But if yuh don't care about alienating XP users, go for it. Quote Link to comment Share on other sites More sharing options...
stigzler Posted December 12, 2015 Share Posted December 12, 2015 Whilst I have a certain nostalgia around XP (OS on my first purchased PC), every dog has its day, and thus it may have to become a casualty of progress....I do hate to alienate, but needing that LINQ goodness. Quote Link to comment Share on other sites More sharing options...
jimdeprado Posted July 28, 2017 Share Posted July 28, 2017 Adultery, Can I ask a real noob type question. I have Visual Studio 17.0 and I have downloaded your plugin template. When I open the template and try to run it, I get the following error: Severity Code Description Project File Line Suppression State Error BC30113 '$safeprojectname$' is not a valid name and cannot be used as the root namespace name. GameEx PluginTemplate1 C:\Users\Jim dePrado\Documents\Visual Studio 2017\Templates\ProjectTemplates\Visual Basic\vbc 1 Active I would like to try and create a basic plugin, but I am having trouble getting started. Thanks and enjoy your weekend! Jim Quote Link to comment Share on other sites More sharing options...
stigzler Posted July 28, 2017 Share Posted July 28, 2017 When you say "Run" do you mean you're trying execute it in the VS IDE environment? I.e. you're pressing "Start" (the little green arrow at the top)? If so, this won't work. You cannot execute plugins directly. You have to Build them to the GameEx Plugins directory and execute them via GameEx. This also means that you cannot use the VS debugger or runtime environment. So you'll have to build your own logging/error catching system. If you're just starting out, I'd recommend trying to write a small stand-alone app first incorporating logging and monitoring tools (an equivalent to Console) and then moving onto writing your first plugin. Take it form someone who, until a couple of years ago, could only remember Commodore BASIC: 10 Print "Wham suck" 20 Goto 10 Thus, have been on those starting blocks! Just for the record - the Plugin Template works fine, having used this to start all my plugins. 1 Quote Link to comment Share on other sites More sharing options...
Adultery Posted July 29, 2017 Author Share Posted July 29, 2017 What he said. [emoji317] Quote Link to comment Share on other sites More sharing options...
jimdeprado Posted August 1, 2017 Share Posted August 1, 2017 Thanks! Like I said, I am a complete amateur, especially compared to you guys. My initial thought is to create an app that creates custom lists for emulators. Here is my thought process. Read existing emulators from gameex.ini Read games/roms from somewhere (I haven't figured this out yet) Allow users to create alternate lists by selecting games/roms Copy the selected emulator (and all of it's properties - including rom location). Maybe make the copied emulator at the bottom of the list (~250) Create a map file for the emulator for the selected games Edit custommenu.ini to include the new list Does that seem reasonable? There are a ton of things that I'm sure that I haven't thought about yet. This may have been done in whole or part already. It is just something that I thought of that would be easy for me to get started. Are there any files out there that work with input and output of text files that I could look at to get some ideas? Thanks! Jim Quote Link to comment Share on other sites More sharing options...
Adultery Posted August 1, 2017 Author Share Posted August 1, 2017 The nice thing about the plugin system is that you can do pretty much anything. It's definitely reasonable, but that will be quite the undertaking! The plugin template comes with ini parsing code I think. If not I got a class you can import. There are people here who can help, so feel free to open a project thread. [emoji880] Quote Link to comment Share on other sites More sharing options...
stigzler Posted August 1, 2017 Share Posted August 1, 2017 2 hours ago, jimdeprado said: Thanks! Like I said, I am a complete amateur, especially compared to you guys. He must be talking about you, A..... @jimdeprado - Errrrrr, Custom Lists can do all that (I believe you've downloaded that?). But if you want to re-invent the wheel - tuck in! I would say though, as a complete amateur, aim smaller first. People will help out, but not to the level of helping a brick layer do brain surgery. Aim for technical drawing before architecture. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.