Jump to content

Xty

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by Xty

  1. Locking it to a variable makes no difference.. infact, locking it to a non 0 number or a non zero variable still makes it unlock for some reason. And that piece of code shouldn't even be being executed. I don't understand it.
  2. I'm having some issues with a script and I'm not sure if I have some syntax or logic error or something, or if there's some weird bug with KOS. I'm using the new pre-release v0.12.P3. I know exactly which part is causing the problem, but I don't understand why it is causing the problem. This part, for some reason, is causing the throttle to be unlocked right away, even though it shouldn't even be executed. Snippet from stager.txt IF fuelGood = FALSE OR airGood = FALSE { print "no good". IF airGood = FALSE { LOCK THROTTLE TO 0. //print "why are you unlocking stuff!". DECLARE enginesOff. If I place a print statement there, nothing is printed, but if I comment out the LOCK THROTTLE TO 0. then it works as expected. test.txt lock throttle to 1. lock steering to UP + R(0,0,180). until 1 { print "test". run stager. wait 1. }. stager.txt LIST PARTS IN prts. SET lastStage TO 0. SET lastCoupler to 0. FOR p IN prts { IF p:STAGE > lastStage { SET lastStage TO p:STAGE. }. RUN decouplers(p:NAME). IF return = TRUE { IF p:STAGE > lastCoupler { SET lastCoupler TO p:STAGE. }. }. }. SET fuelGood TO FALSE. SET airGood TO TRUE. FOR p IN prts { IF p:STAGE >= lastCoupler { FOR res IN p:RESOURCES { IF res:NAME = "liquidfuel" OR res:NAME = "solidfuel" OR res:NAME = "oxidizer" { IF res:AMOUNT > 0 { SET fuelGood TO TRUE. }. }. IF res:NAME = "intakeair" { IF res:AMOUNT = 0 { SET airGood TO FALSE. }. }. }. }. }. IF fuelGood = FALSE OR airGood = FALSE { print "no good". IF airGood = FALSE { LOCK THROTTLE TO 0. //print "why are you unlocking stuff!". DECLARE enginesOff. UNTIL enginesOff = TRUE { SET enginesOff TO TRUE. LIST ENGINES IN engs. FOR eng IN engs { IF eng:IGNITION = TRUE { IF eng:THRUST > 10 { SET enginesOff TO FALSE. }. }. }. }. }. STAGE. IF airGood = FALSE { UNLOCK THROTTLE. }. SET doubleStage TO TRUE. LIST ENGINES IN engs. FOR eng IN engs { IF eng:IGNITION = TRUE { SET doubleStage TO FALSE. }. }. IF doubleStage = TRUE { WAIT 1. STAGE. }. }.
  3. Is there a way to get the stage your ship is currently in? Also how is the CONTAINS function of LIST used? I can't find any examples. While I'm asking can ITERATOR be used specifically somehow or is it just used behind the scenes in the FOR command or something?
  4. If I might make a request, could either the RUN command be changed, or a new command almost the same as run be added, where it would not remove things like when commands or throttle and steering locks when the script ends. It would be useful for modularizing scripts, for example a small script to stage automatically when fuel runs out with a when command. You could do this by either changing the run command to not remove throttle locks and stuff when the run command has been used inside a script, or just add a new command.
  5. I've tried using Resources.Load to load a font but I cant get it to work, it never loads anything. I've looked around on the internet but the examples are all vague and whatever I try doesn't work. I tried coping a courier new font from my computer into the resources directory of KSP and then loading it with Resource.Load but no font is loaded. Could anyone tell me how I actually use Resource.Load to load a font properly?
  6. I would like to setup a textarea to use a monospaced font but I have no idea how to do it. Are there built in fonts I can use and/or is there a way to load in a font? Edit: I've tried using Resource.Load to load a font but I cant get it to work, it never loads anything. I've looked around on the internet but the examples are all vague and whatever I try doesn't work. I tried coping a courier new font from my computer into the resources directory of KSP and then loading it with Resource.Load but no font is loaded. Could anyone tell me how I actually use Resource.Load to load a font properly? Edit: I've come to the understanding that resources that can be loaded with resource.load are linked into the game at compile time and therefore this will not work. What options do I have to use a custom font. Can I create some kind of font asset that can be used or do I have to do something crazy like make an image with my font and do all the drawing myself?
  7. Putting it in the main directory fixed it. I took a look at KerbComAvionics but the source doesn't seem to be updated, I'm guessing if I put my mod in the GameData folder then it might be loadable from there, either that or a relative path. Thanks everyone.
  8. I have a C dll that I'm trying to load with my plugin but in the debug console it says DllNotFoundException when it tries to load the dll. I got the dll working with a C# console application so I'm fairly certain it works. I put the dll in the same directory as the plugin (I'm using the old plugins directory) and I know the plugin is loading. Is it possible to load a C dll with a plugin, and if yes, can anyone tell me where it should go or what I'm doing wrong?
×
×
  • Create New...