Jump to content

help for a complete coding noob


Recommended Posts

What I want to do: play around with the source of WheelSounds at https://github.com/pizzaoverhead/WheelSounds/blob/master/WheelSounds/WheelSounds.cs and change the equation which changes the pitch to something like the Sigmoid Curve or Logistic function.

I searched all around Google to see how to get Unity to understand a logistic function and somebody posted:

"position =10/(1+Math.Exp(-t);"

So I'm trying to change this:

WheelSound.audio.pitch = (float)(Math.Sqrt(averageRpm)) / 13;

Into something like this:

WheelSound.audio.pitch = (float)10/(1+Math.Exp(-averageRpm);

Can someone explain to me why this won't work?? When I drag the DLL over to the plugin folder (even if I change the name) the rover wheel sounds go away completely.

I'm using Xamarin Studio. When I "build" it outputs a total of 14 files, including DLL files and NLP.

Link to comment
Share on other sites

Just to clarify, the line of code should look exactly like this (the missing brackets above is annoying me...)

WheelSound.audio.pitch = (float)[COLOR=#ff0000]([/COLOR]10 / (1 + Math.Exp(-averageRpm)[COLOR=#ff0000]))[/COLOR];

You only need to move the .dll specific to the mod. When adding references in Visual Studio, you have to change the copy local field to false to get rid of the majority of the rubbish. I assume there's something similar in Xamarin.

You should also be moving it to overwrite the .dll shipped by the mod in question, which will be in GameData/<insertModFolder> or one of it's subdirectories. DO NOT put it in the <KSPInstall>/Plugins folder and DO NOT have the old and new .dll both inside GameData.

Edited by Crzyrndm
Link to comment
Share on other sites

Still not working...my DLL's are 4 kb while the released one is 7kb, don't know if that explains anything. Should I be referencing the ModuleManager.DLL or anything?

Edited by jtn191
Link to comment
Share on other sites

I think this is the output_log:

Building Solution: WheelSounds (Release)

Building: WheelSounds (Release)

Build started 5/21/2015 2:00:44 PM.

__________________________________________________

Project "C:\Users\Jeff\Documents\Projects\plugin_tutorial\plugin_tutorial\WheelSounds.csproj" (Build target(s)):

Target GetReferenceAssemblyPaths:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

Done building target "GetReferenceAssemblyPaths" in project "WheelSounds.csproj".

Target ResolveAssemblyReferences:

No way to resolve conflict between "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

Done building target "ResolveAssemblyReferences" in project "WheelSounds.csproj".

Target GenerateTargetFrameworkMonikerAttribute:

Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.

Target CoreCompile:

Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.

Target CopyFilesToOutputDirectory:

WheelSounds -> C:\Users\Jeff\Documents\Projects\plugin_tutorial\output\Plugins\plugin_tutorial.dll

Done building project "WheelSounds.csproj".

Build succeeded.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

2 Warning(s)

0 Error(s)

Time Elapsed 00:00:00.37

---------------------- Done ----------------------

Build: 0 errors, 2 warnings

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...