Jump to content

Search the Community

Showing results for tags 'srfspeed'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Welcome Aboard
  • Kerbal Space Program 1
    • KSP1 Discussion
    • KSP1 Suggestions & Development Discussion
    • KSP1 Challenges & Mission ideas
    • KSP1 The Spacecraft Exchange
    • KSP1 Mission Reports
    • KSP1 Gameplay and Technical Support
    • KSP1 Mods
    • KSP1 Expansions
  • Kerbal Space Program 2
    • KSP2 Dev Updates
    • KSP2 Discussion
    • KSP2 Suggestions and Development Discussion
    • Challenges & Mission Ideas
    • The KSP2 Spacecraft Exchange
    • Mission Reports
    • KSP2 Prelaunch Archive
  • Kerbal Space Program 2 Gameplay & Technical Support
    • KSP2 Gameplay Questions and Tutorials
    • KSP2 Technical Support (PC, unmodded installs)
    • KSP2 Technical Support (PC, modded installs)
  • Kerbal Space Program 2 Mods
    • KSP2 Mod Discussions
    • KSP2 Mod Releases
    • KSP2 Mod Development
  • Community
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
    • KSP Fan Works
  • International
    • International

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


About me


Location


Interests

Found 1 result

  1. Hi all ! After playing KSP for a while and using a couple of mods, i decided to try and create my own. I would like to create a Stuka-like-siren part, which make an increasingly higher sound depending of the speed, when activated. I don't want the sound to be played when my custom part is not attached to the vessel, and i don't want all parts to play the sound. I have a basic undersanding in object oriented programming, and i'm fairly new to c#. My problem is, i didn't find the way to get the vessel info "srfSpeed" (see: http://wiki.kerbalspaceprogram.com/wiki/API:Vessel#Fields). public class ModuleStukaSiren : PartModule { double vspeed = vessel.srfspeed; } I get this error : A field initializer cannot reference the nonstatic field, method, or property... As far as i know/understood, i can't set that class as static, and at this point i don't even know if i can access the class "vessel" through PartModule (whereas Documentation for the KSP API let me think i should), or even if the class "vessel" needs to be used. I spent the afternoon on c#, KSP API, KSP plugins related forums, without conclusive result. So, is it possible to access the vessel info through a plugin for a module i will attach on a specific part, and how ? Does someone have in mind some simple tutorial or mod source which can help or inspire me ? My apologies if that question is dumb and only c# related, and sorry for my bad english. Thanks Roiarg
×
×
  • Create New...