Jump to content

How to make a NON-PART plugin?


Recommended Posts

  • 6 months later...

So, this post seems dead, but maybe somebody can still help me. All this doesn't work for me :-p

I'm using Xamarin Studio on Mac and when I want to build the code the first error comes up on [KSPAddon(KSPAddon.Startup.EditorAny, false)]

Also I'm guessing I have to inlude libraries or references or something (sorry I'm new to C#)

Thanks for the help

Link to comment
Share on other sites

for VS follow this

http://msdn.microsoft.com/en-us/library/7314433t%28v=vs.90%29.aspx

I assume your IDE has some documentation - right?

follow that to add the references:

UnityEngine.dll and Assembly-CSharp.dll

you will find them inside the KSP-Data folder..

it helps if you have an IDE with intellisense..

so you know an error before building btw..

if VS is available for mac, it could be a good idea to change...

HTH

Link to comment
Share on other sites

it helps if you have an IDE with intellisense..

so you know an error before building btw..

if VS is available for mac, it could be a good idea to change...

HTH

It is not, but Xamarin is IMHO just as good if not better than VS (I can't stand VS's multiple key shortcuts) and has intellisense as well.

Link to comment
Share on other sites

Thanks everyone for your great answers so far! Not to change the subject but I didn't feel this was worth creating my own thread over, in addition to what I've learnt here so far, what steps are we expected to take in order to ensure mod compatibility? Or rather, what causes mods to be incompatible in the first place? Any answer is appreciated!

Link to comment
Share on other sites

If both you and another mod change the same thing at the same time, that could lead to problems.

For example, consider the Procedural Parts SRB and KIDS.

*The SRB changes the maxThrust based on what size it is

*KIDS changes maxThrust based on ambient air pressure.

Those situations are few and far between, however, generally one doesn't have to worry about it. One thing that you *should* do, however, is any time you use some setting or hardcoded value, instead of doing that, load it from a cfg file. That way other mods can modify it with Module Manager. Like if the cost of something should be (default) 5 * mass, you have

MYMODSETTINGS

{

costMult = 5

}

and then get that node from GameDatabase during play and read the cost that way, rather than just doing `part.mass * 5` in your code.

Link to comment
Share on other sites

for VS follow this

follow that to add the references:

UnityEngine.dll and Assembly-CSharp.dll

you will find them inside the KSP-Data folder..

I actually got that far but still no luck. Like I said, it dies on [KSPAddon(KSPAddon.Startup.EditorAny, false)]

- - - Updated - - -

Nevermind, I mucked it up. Gots it to work :-)

- - - Updated - - -

Except that it wont build :-/ I feel really stupid for asking this question, but how do I build a dll (with Xamarin). It keeps trying to build an exe which doesn't work because there's no main method. I can understand that that would be a problem but that's not what I want to do.

- - - Updated - - -

Again, nevermind :-p

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...