Jump to content

maculator

Members
  • Posts

    746
  • Joined

  • Last visited

Posts posted by maculator

  1. I got a quastion, if somebady wants to push me in the right direction (literally).

    I got my small script to hold my planes altitude and direction:

    Spoiler
    
    clearscreen.
    core:part:getmodule("kOSProcessor"):doevent("Open Terminal").
    set terminal:charheight to 18.
    set terminal:width to 30.
    set terminal:height to 14.
    set terminal:brightness to 1.
    
    if alt:radar < 10 {
    	print "we're landed... bye.".
    	wait 2.
    	shutdown.
    } else {
    	sas off.
    	set alt_t to ship:altitude.
    	print "target altitude: " + round(alt_t).
    	set WhyDoesItHaveToBeThatComplicated to ship:bearing * -1.
    	set angle to 0.
    	lock angle2 to angle.
    	print "heading " + round(WhyDoesItHaveToBeThatComplicated).
    	lock steering to Heading(WhyDoesItHaveToBeThatComplicated, angle).
    	until false {
    		if ship:altitude > (alt_t + 100) {
    			set angle to angle - 1.
    			print "down " + angle.
    			lock steering to heading(WhyDoesItHaveToBeThatComplicated, angle2).
    		}
    		if ship:altitude < (alt_t - 100) {
    			set angle to angle + 1.
    			print "up " + angle.
    			lock steering to heading(WhyDoesItHaveToBeThatComplicated, angle2).
    		}
    		if ship:altitude > (alt_t - 100) and ship:altitude < (alt_t + 100) {
    			print "hold " + angle.
    			lock steering to heading(WhyDoesItHaveToBeThatComplicated, angle2).
    		}
    		lock steering to heading(WhyDoesItHaveToBeThatComplicated, angle2).
    		print angle.
    		print "wait".
    		wait 10.
    	}
    }

     

    And I really would like it to hold a sort of "global" direction, unaffected by the compass.

    Right now it goes like this:

    lock steering to Heading(WhyDoesItHaveToBeThatComplicated, angle2).

    Is there a way to tell it to just hold the direction unaffected by compass?

    I red through the documentation but that stuff is a bit much for me :S

    Thank you!

  2. 3 minutes ago, Vanamonde said:

    Some posts have been removed from this thread. We know you meant well, guys, but trading previous versions of KSP is actually illegal. 

    Than make a official statement about it in the original official thread about those versions!

    They used to be available to the public on the official page and until this comment I didn't know they turned "illegal".

  3. I can report that behavior too.

    For me the node stil is openable when it happens, so no big deal. Running both evolved mods now since they released for 1.4 and updated them and never had bigger issues. Sometimes a recovered or destroyed vessel stil stay in the list until you siwtch out and back in on the tracking station, but that too is a thing with no real effect and the benefit of the mod weights muuuch more..

  4. Is KOS know to disable the switching of designs on the new parts?

    Spoiler

    ZqEqcSU.png

    As far as I know KOS is the only mod that touches the fairings in my install. (Doesn't happen with all of the, oddly).

    Anyways here is my log if it helps:

    https://raw.githubusercontent.com/maculator/STUFF/master/LICENSE.md/LOG.txt

     

    Edit it is loading the correct ones when the vessel spawns, just doesn't update the editor.

  5. Is there a way to make a thing like this work:

    function get {
    	parameter folder, file.
    	copypath("0:/folder/file.ks","1:/file.ks").
    }

    (This obviously doesn't work and is there to illustrate my problem)

    And a second thing I can'T get past is the fact that I really can't run functions from the terminal. Does it really always have to be in a programm that runs the function or a sub scribt with the functions?

    Cheers, great mod, great fun, manny nerve wrecking moments :D

  6. Allright it all worked out. Exept I stil don't know how to be able to load functions and execute them myself.

    Problem: bootscript boots script with functions and runs it (does obviously nothing), all good, but when I want to start a function it won't let me.

    I can't run start(12) for example.

    Here is what I mean:

    Bootscript:

    (this is not the problem)

    Spoiler
    
    //bootlaunchdirection.ks
    //
    //boots "launchdirection.ks" to a vessel.
    IF exists("1:/launchdirection.ks") = true {
    	deletepath("1:/launchdirection.ks").
    	IF exists("0:/launchdirection.ks") = true {
    		copypath("0:/launchdirection.ks","1:/launchdirection.ks").
    		print "launchdirection.ks copied to 1:/".
    	} ELSE {
    		print "launchdirection.ks not found on 0:/".
    	}
    } ELSE {
    	IF exists("0:/launchdirection.ks") = true {
    		copypath("0:/launchdirection.ks","1:/launchdirection.ks").
    		print "launchdirection.ks copied to 1:/".
    	} ELSE {
    		print "launchdirection.ks not found on 0:/".
    	}
    }
    runpath("1:/launchdirection.ks").

     

    Problem is the booted script:

    (the last line is a workarround, because that's what I'd like to do myself via the console, but I can't. It's not allowing me :S)

    Spoiler
    
    //launchdirection.ks
    //
    //provides a function to launch a vessel into a suborbital trajectory with a user defined direction.
    function stagecheck {
    	WHEN ship:maxthrust < 0.01 THEN {
    		IF ship:liquidfuel > 1 or ship:solidfuel > 1 {
    			stage.
    		} ELSE {
    			print "out of fuel".
    		}
    	}
    }
    function ascentstep {
    	parameter targetaltitude, targetdirection, targetangle.
    	UNTIL ship:altitude > targetaltitude {
    		lock steering to heading(targetdirection, targetangle).
    		stagecheck().
    		wait .1.
    	}
    }
    function start {
    	parameter targetdirection.
    	print "start into heading " + targetdirection + "°".
    	ascentstep(1000,		targetdirection, 90).	
    	ascentstep(2000,		targetdirection, 80).	
    	ascentstep(5000,		targetdirection, 65).	
    	ascentstep(10000,	targetdirection, 45).	
    	ascentstep(20000,	targetdirection, 30).	
    	ascentstep(30000,	targetdirection, 25).
    	ascentstep(40000,	targetdirection, 20).	
    	Until ship:apoapsis > 71000 {
    		lock steering to heading(targetdirection, 0).
    		stagecheck().
    		wait .1.
    	}
    	set ship:control:pilotmainthrottle to 0.
    	sas on.
    	print "ascent complete".
    }
    start(90). //WORKARROUND I WANT TO DO THIS WITH CUSTOM PARAMETERS VIA THE CONSOLE!

     

    Edit:

    It's probably something small I don't get. The reason for making a new post is that I'm hoping to get a quick fix because thats the first set of scripts I wrote from 0 that actually (besides the drama) work out of the box without that horrible "somethings wrong" -sound from KOS. I'm really motivated to keep on working.

    If this is the wrong thread to ask for help I'd be glad if somebody can point me to a better location.

    Cheers.

  7. Thanks guys. So using my bootscript to run a "libary.ks" wich contains all my functions won't help.

    I think I got it now, if I understand it correctly:

    Bootscript to load the actual script and the actual script "runs" the functions script it needs first to make the functions available.

    I do love KOS, but I have no codin experience so I sometimes struggle a bit, but I'm making progress. thanks.

     

  8. I have a noobish question :s

    I wanted to play arround with KOS after a long time and I'm just too stupid I guess....

    I got my bootscript running:

    declare global function hudmessage {
    	parameter message.
    	hudtext ("KOS: " + message, 5, 2, 30, green, false). //40 is too big!
    }
    
    hudmessage("loading script").
    wait 1.
    copypath("0:/tourist.ks","1:/tourist.ks").
    wait 1.
    hudmessage("done").

    and I'm unable to access the function hudmessage from the script the bootscript loads....

    It just keeps throwing errors on me.

    All the script contains for now is:

    hudmessage("I'm tourist.ks").

    I thought since I declared the function in my bootscript and that script is on the drive it would be accessible for everyone.

    Do I need to declare it again outside the bootscript? If yes: why?

    Cheers.

×
×
  • Create New...