Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

Hi,

I can't get the C# Template for the plugin to work.

I'm sorry, if i just made some bad beginner mistakes... I'm good at PHP and learned C some years ago... Both without IDEs. I must say that this MS IDE is great, but often i dont know what to do. Maybe it's just a stupid mistake i made.

Maybe we can make a tutorial here in the forum. I'll start it with what i did.

Here is what I did:

1. unzip the Template.

2. open MSVC#2005Express

3. File/open project - choose the Folder and then GXPlugin.csproj

4. VC#Express converts the project with no errors

5. I have several warning in my error list:

' * Load of property 'OutputPath' failed. The entered Path is not a valid output path.

' * Unable to create directory "G:\-DATA-\-MyProjects-" and so on... PS: I dont have such a directory

' * The referenced Componetnt 'Speechlib' could not be found.

' * The referenced Component 'System' could not be found

' * and System.Data, System.Drawing, System.Windows.Forms and System XML

5. I doubleclick plugin.cs to have a look at it

6. I rightclick the Project: "GXPlugin" and choose properties

7. In GXPlugin I click on Build, but the at point 5 mentioned Output path seems ok (is bin\Release\)??? Why do i get the error?

8. OK, I try to compile with Build/Build Solution but i get the same errors.

9. OK, then i try Debug/Start Debugging (Of course i get "A project with an Output Type of Class Library cannot be started directly.)

10. My warnings (except the output Path error) were gone!??? Why???

11. OK, just one warning, let's compile... Build/Build soultion

12. One Error, one warning, both about "G:\-DATA-\-My PROJECTS-" and so on...

13. in the Project properties / Build i set the output path manually to a path that i have (although it seems ok.

14. I "Build Solution" again. No Error (Just a warning about the output path (not a valid... )

15. In the outpuit path are two new .dll files. Wow...

16. I copy the files to my gameex plugins directory (made a backup of course) and i say "yes to the question if i want to overwrite".

17. I start the Pluginmanager.exe and the speech-plugin is gone... :-(

Could anyone help me with that.

Posted

Yeah that OutputPath error is wierd, the upgrade wizard dosn't do a very good job. I've just sent off a C# 2005 template to Tom to include in the next release of GameEx.

But now I find the same problem where the Plugin Manager doesn't recognise the plugin compiled in 2005. I've notified Tom about this and hopefully he'll get back soon.

EDIT: Tom's reply

I don't think its going to be possible to run .net 2.0 plugins until I upgrade GameEx and all the apps to .net 2.0. I do plan on doing that as soon as I can.

EDIT2: At the moment you can only use plugins compiled under .NET 1.1 and VS 2005 C# Express only compiles for .NET 2.0. But you can compile 2005 projects with .NET 1.1 using NAnt. Check out the batch file called build.bat included in archive, make sure it points to the location you have nant.exe and it should compile the plugin for .NET 1.1.

Posted

Yes!

Works like charm! I even managed to compile the speech plugin...

That needed some research how to include Libs.

For everyone: How i did it:

1. download nant and unzip to any directory.

2. copy Headkaze's default.build and build.bat into the downloaded Plugintemplate from TS

3. edit build.bat and set the path correctly to nant

4. copy Interop.Speechlib.dll from gameex\plugin dir (thats the .net 1.1 version) to the template dir

5. edit default.build and insert

<references>

<include name="Interop.SpeechLib.dll"/>

</references>

after </sources>

6. execute build.bat

7. copy the DLL to the plugin dir (remove sthe speech plugin before, but don't remove the interop.speechlib.dll

Thanks HeadKaze.

Posted

OK, I have now loaded the plugin in Vc#Express and I'm calling the batch as a post-build event.

Now i can use the IDE and compile it in one step under .net 1.1.

cupid

Posted

Hmmm... got another problem here.

Now my plugin shows up in the plugin manager, but if i press configure nothing happens.

If I load Gameex with my new plugin, GameEx acts normal, but without any plugin functionality. I get the following log entries:

...

17:22:13.8 14.12.2006: Loading PlugIns

17:22:13.9 14.12.2006: Loaded Plugin:"Testplugin" Version 0.1 By Cupid

17:22:13.9 14.12.2006: PlugIn: "Testplugin" Initialized OK

...

17:22:42.3 14.12.2006: Testing Main Loop Once: Processing Frame

17:22:42.5 14.12.2006: Testing Main Loop Once: Main Loop ran successfully

17:22:44.3 14.12.2006: PlugIn: "Testplugin" caused an exception and is being disabled.

17:22:44.3 14.12.2006: Methode GameEx.Plugin.Event_Timer konnte nicht gefunden werden.

(Translated: Method GameEx.Plugin.Event_Timer could not be found.)

17:22:44.3 14.12.2006: at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)

17:22:44.3 14.12.2006: at GameEx.PlugIns.InvokeMethod(Object obj, String sProperty, Object oValue)

17:22:44.3 14.12.2006: at GameEx.PlugIns.InvokeMethod(Object obj, String sProperty, Game_Info oValue)

17:22:44.3 14.12.2006: at GameEx.PlugIns.Event_Timer()

...

Does this mean that GameEx does not find my public void Event_Timer()???

I used the templates from Tom.

It looks like GameEx seems to read PluginInfo, but can't call any methods from Plugin...

Maybe you can help out once more. I would have searched forever to solve the 1.1/2.0 mistake.

Thanks

Cupid

Posted

OK... got the second error myself. Tom changed the call to the Event_Timer Method

My testplugin works now... yay!!! (except the configure screen)

again for everybody:

its not

public void Event_Timer()

anymore

it's now

public void Event_Timer(IntPtr InfoPtr)

(I just read about this in the release news of the new version and analysed the VB code because the c# Code is the same as in the previous version)

But I need help on the dialog box. The configure Dialog is not opening.

Headkaze, I'll try to compile your code tomorrorw, let's see if the button works there.

Posted

OK HK,

I have compiled the code you attached. If i press configure nothing happens. Does the Configure Button in the Template you attached work, if you compile it with nant?

cupid

Posted

OK, i can get it to work.

I can even use C#Express to program the code. But If I add a component to the form (or delete something), nant doesn't compile anymore.

I can get it to work again, if i excange the configuration.resx with an old one and if if comment out these two lines:

   
...
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
...
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
...

Btw: i didn't do anything with the PictureBox1, I added a checkbox.

That drives me crazy

So my question: what IDE do you use? Is it more easy with yours?

Thanks for all the support HK. BTW: I'm now wearing a T-shirt with your avatar on it... One of the greatest bands ever. ;-)

Cupid

Posted

Damn it! Yeah my worse fears have come true then, resx files built in 2005 can't be compiled as .NET 1.1 resources.

I use VS 2003 to compile plugin's, but using 2005 I had the same problem with the same two lines.

I don't know what else you can do to compile using 2005 as your IDE. Tom is thinking about upgrading to .NET 2.0 but that will be a pretty big job. I think it's strange you can't use 2.0 compiled dll's in 1.1 applications too. If you figure out a way around it, let us know.

Yeah Prodigy rock, I've seen them live a few times here in Perth ;)

Posted

OK... Thanks HK. I'm using 2003 now. Thought about coding in Delphi, but now i started my plugin in c#. Thanks for all. Without your help i think i would have never got it to work.

Posted
Damn it! Yeah my worse fears have come true then, resx files built in 2005 can't be compiled as .NET 1.1 resources.

I use VS 2003 to compile plugin's, but using 2005 I had the same problem with the same two lines.

I don't know what else you can do to compile using 2005 as your IDE. Tom is thinking about upgrading to .NET 2.0 but that will be a pretty big job. I think it's strange you can't use 2.0 compiled dll's in 1.1 applications too. If you figure out a way around it, let us know.

Yeah Prodigy rock, I've seen them live a few times here in Perth ;)

I never realised that was a prodigy album cover. I like them too, and they came from around here. "Smack My Bitch Up" always gives me tingles, and the earlier stuff was good too :) I guess your an old skool raver HK? Or maybe a closet one like me!

Posted
I never realised that was a prodigy album cover. I like them too, and they came from around here. "Smack My Bitch Up" always gives me tingles, and the earlier stuff was good too :) I guess your an old skool raver HK? Or maybe a closet one like me!

I saw Prodigy live at my first Rave ;) Yeah I've been to a few but the whole scene died over here a while ago. It was fun while it lasted though :)

Posted

That's why i like to live in Germany... The scene is not almost dead. The music is not the same... Its more industrial-like but you can find it, if you search for it. Check out www.synthetic.org. It can give you a liitle taste to what i mean... Even if it's almost mainstream there. (and not from germany :-) )

Guest
This topic is now closed to further replies.
×
×
  • Create New...