Jump to content

Monniasza

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by Monniasza

  1. 1. Parts could now have spaces in the name, and SMURFF could shrink a lot. 2. Yes, because scripts would have separate file format.
  2. The associated issue is located at https://github.com/sarbian/ModuleManager/issues/157 Overview Strings must be now explicitly stated either by single or double quotation marks, otherwise, they will be treated as variables, which might cause errors. To create a new key, you must place '+' or '$' before the setter All other existing syntax will be preserved Functions - getVar(variable) get a variable, starting here - getVarRoot(variable) - get a variable by the name, starting from root or key correspondingly. The first parameter is optional and is used to track the number of calls. - Variables belonging to the local node are obtained by simply typing their name. - To get variables from ancestors, use ##$...$ instead. - regexp(pattern,string) - run regexp expression on a string - sin, cos, tan, log10, ln, log2, expE, exp10, mod, exp, sec, csc, sqrt, curt, root, log - math functions - getKey(...) : - 2 inputs: name, index - get a single **key** by **index** - 1 input: name - get all **keys** by name - 1 input: key - get key's value - no inputs - get all keys under all names - getKeyValue(...): Like getKey(...), but gets values, not the keys themselves. - setKey(...) : - 3 inputs: key name, index, value - set given key at the given index to the given value - 2 inputs: key, value: sets given a key to a given value - 2 inputs: keys, value: sets all given keys to a single value - 2 inputs: keys, values: sets keys to the corresponding values - 2 inputs: key name, values: sets keys under given name to the corresponding values - 2 inputs: key name, value: sets keys under given name to a single value - If you want to set multiple keys to a list, use setKeyDuplicate function - setKeyDuplicate(...): - 2 inputs: key name, value: sets keys under given name to a single value - 2 inputs: keys, value: sets all given keys to a single value - call(func, inputs): calls a function with given list of inputs - getKey(...) : - 2 inputs: name, index - get a single **key** by **index** - 1 input: name - get all **keys** by name - 1 input: key - get key's value - no inputs - get all keys under all names - getNodeValue(...): Like getNode(...), but gets values, not the nodes themselves. - setNode(...) : - 3 inputs: node name, index, value - set given node at the given index to the given value - 2 inputs: node, value: sets given a node to a given value - 2 inputs: nodes, value: sets all given nodes to a single value - 2 inputs: nodes, values: sets nodes to the corresponding values - 2 inputs: node name, values: sets nodes under given name to the corresponding values - 2 inputs: node name, value: sets nodes under given name to a single value - If you want to set multiple nodes to a list, use setKeyDuplicate function - setNodeDuplicate(...): - 2 inputs: node name, value: sets nodes under given name to a single value - 2 inputs: nodes, value: sets all given nodes to a single value Setter prefixes '$' as a modifier - creates a temporary variable '$$' as a modifier - creates a long-term variable, but it is removed after all scripts finish. Basic data types String, node, key, number, boolean, list, anonymous function Advanced data types Achieved through specialized functions. Operators - \+ adddition - \- substraction - \* multiplication - / division - ^ exponent - | OR - ! NOT - & AND - \ XOR - !| NOR - !& NAND - !\ XNOR - = equal - \> more - < less - <= !> not more - \>= !< not less - <> != not equal Grouping - () parentheses - <% ... %> code sections (they do not start a new node). - [[...]] - list Where? It will need a new file format - which distinguishes it from simpler patches. Suggestions for file extension: - mm - from '**m**odule **m**anager' - akp - from '**a**dvanced **k**erbal **p**atch' - kscript - from '**k**erbal **script**' - kpscript - from '**k**erbal **p**atch **script**' Why? - KSP API is too complex for beginners - Existing capabilities are insufficient for extremely advanced users How? Existing patches should not be called 'scripts' - they will be more advanced form of data. Constructs - Define function: FUNCTIONDEF[...] <%...%>. Place inputs within square brackets, and in double curly brackets place code. The FUNCTIONDEF is a reserved name in this programming language (but not in CFG files). The first input names the function, following ones are input variable names. - Define anonymous function: FUNCTIONANONYM[...] <%...%>. Place inputs within square brackets, and in double curly brackets place code. The FUNCTIONANONYM is a reserved name in this programming language (but not in CFG files). - for($x = 0; #$x# < 10; @x += 1) - a 'for' loop - foreach($x = 0;@NODE[y]) <%...%> or foreach($x = 0;#key) <%...%>and - runs an action for every node or key - if(cond) <%...%> elseif(cond2) <%...%>} else <%...%>} - conditional statement - fornode(node) <%...%> - run given code for a given node - try <%...%> catch($exc) <%...%> - if first block throws an error or exception, call second block '-' with text "qwertyuiop" - 3 = "qwertyu" 3 - "qwertyuiop" = "rtyuiop" 3 - "qwertyuiop" - 3 = "rtyu" Remove the last instance: "anobnoa" -< "no" = "anoba" Remove last instance "anobnoa" >- "no" = "abnoa" Remove first instance "anobnoa" - "no" = "aba" Remove all instances
  3. This is why the new programming language has its own file format to distinguish it from regular patches. It's not exactly same as kOS, because it is designed to run on startup (as opposed to kOS in flight) and it shares some syntax with existing patches.
  4. @sarbianYou can work together with blowfish to develop that feature.
  5. @sarbian, please check out GitHub, i made suggestion at https://github.com/sarbian/ModuleManager/issues/157 for a new programming language for patch scripts
  6. @Kevin4DDo you want to have this mod on CKAN?: https://github.com/KSP-CKAN/NetKAN/issues/7952 On behalf of CKAN team.
  7. Please add recolour capabilities, not just graphical effects. That would be more helpful in designing beautiful spacecraft.
  8. @Manwith Noname, Google Drive will give error messages to CKAN for all packs. Please reupload at SpaceDock or GitHub. On behalf of CKAN team.
  9. Do you want to have this mod on CKAN: https://github.com/KSP-CKAN/NetKAN/issues/7961
  10. @baddzse233Do you want to have this mod on CKAN: https://github.com/KSP-CKAN/NetKAN/issues/7853? Asked on behalf of CKAN team
  11. Here is my update: Exclude parts with Interstellar Fuel Switch, Firespitter Fuel Switch or B9 Part Switch
  12. Logs: https://drive.google.com/open?id=1Xl44ZqRAe5HFllTginQ6H9EOipFU0iKz I have updated Firespitter to v7.15.0, but the game is still stuck loading.
  13. Please make bug-reporting and source code repository on GitHub for handling issues.
  14. Copying tanks works incorrectly: when original tank has customized contents, then copied tank has default contents.
  15. Please make Hyperdrive stabilizer scalable. Patch code: @PART[Hyperdrive inline] { #@TWEAKSCALEBEHAVIOR[Engine]/MODULE[TweakScale] { } %MODULE[TweakScale] { Type = stack defaultScale = 1 } }
  16. All of the included parts are avaliable under single R&D node, please make parts require different R&D nodes. Possible arrangement of R&D requirements for parts: Part : R&D node 1.0 Hyper engine : Heavy Rocketry 1.0 Interspace Hyper Engine : Heavier Rocketry 1.0 Charge Hyper Engine : Very Heavy Rocketry 1.0 Condensed Hyper Engine : Experimental Rocketry 2.0 Hyper Crystal Miner : Resource Exploitation 2.0 Ion fuel tank : Adv. Fuel Systems Condensed Ion Fuel Tank : Large Volume Containment ION Block : Specialized Control Hyperdrive Inline Stabilizer : Specialized Control Ion reactor : Resource Exploitation
×
×
  • Create New...