[Thyme][1.5.61]Thyme Command/Variables List

About advanced scenes, and the Thyme scripting language used in Algodoo.

[Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Tue Sep 01, 2009 10:46 am

This list contains all the variables and commands, based on a combination of mostly my memory, experimentation, and Emil's descriptions, so sorry if some of it is inaccurate, feel free to notify me of any mistakes or remind me of the effects of any variables/commands that I don't remember.

Red - Emil's only thyme spelling mistake (I don't think the variable works because of this),
Yellow - Things that I've forgotten the effects of,
Green - Operators (infixed operations)
  • App.
    • Background.
      • cloudOpacity - The opacity of the clouds - Default: 0.95 (float)
      • cuteClouds - Whether to use normal (false) or cute (true) clouds - Default: true (boolean)
      • drawClouds - Whether to show clouds (true) or not (false) - Default: true (boolean)
      • skyColor - Colour of the sky - Default: [0.45,0.55,1,1] ([Red(float), Green(float), Blue(float), Alpha(float)])
    • DPI - Dots per inch to render with - Default: 86(float)
    • GUI.
      • Forces.
        • airBuoyancy - Whether to show the visualisation for airBuoyancy (true) or not (false) - Default: true (boolean)
        • airBuoyancyText - The text to show accompanying the airBuoyancy visualisation - Default: -adg (string)
        • airFriction - Whether to show the visualisation for airFriction (true) or not (false) - Default: ture (boolean)
        • airFrictionText - The text to show accompanying the airFriction visualisation - Default: -fv (string)
        • attraction - Whether to show the visualisation for attraction (true) or not (false) - Default: true (boolean)
        • attractionText - The text to show accompanying the attraction attraction visualisation - Default: A (string)
        • contactCombinationDistance - The distance in screen centimetres(cm) distance before normal visualisation arrows join into one - Default: 1.2 (float)
        • drawForces - Whether to show all force visualisations (true) or not (false) - Default: false (boolean)
        • drawNames - Whether to show all force names (true) or not (false) - Default: true (boolean)
        • drawValues - Whether to show all force values (true) or not (false) - Default: false (boolean)
        • external - Whether to show the visualisation for external forces (true) or not (false) - Default: true (boolean)
        • externalText - The text to show accompanying the external forces visualisation - Default: ext (string)
        • forceScale - The scale of the arrow visualisation of foce visualisation - Default: 1 (float)
        • friction - Whether to show the visualisation for friction (true) or not (false) - Default: true (boolean)
        • frictionProjection - Whether to show friction from both directions (false) or the direction the force pushes(true) - Default: true (boolean)
        • frictionText - The text to show accompanying the friction visualisation - Default: T (string)
        • gravity - Whether to show the visualisation for gravity (true) or not (false) - Default: true (boolean)
        • gravityText - The text to show accompanying the gravity visualisation - Default: mg (string)
        • hinge - Whether to show the visualisation for the for the force of hinges (true) or not (false) - Default: true (boolean)
        • hingeText - The text to show accompanying the hinge visualisation - Default: H (string)
        • normal - Whether to show the visualisation for normal forces (true) or not (false) - Default: true (boolean)
        • normalText - The text to show accompanying the normal forces visualisation - Default: N (string)
        • spring - Whether to show the visualisation for spring forces (true) or not (false) - Default: true (boolean)
        • springText - The text to show accompanying the spring forces visualisation - Default: -kx-bv (string)
        • total - Whether to show the visualisation for the total force (true) or not (false) - Default: true
        • totalText - The text to show accompanying the total force visualisation - Default: (string)
        • velScale - The scale of the velocity visualisation - Default: 1 (float)
        • velocities - Whether to show the visualisation for velocities (true) or not (false) - Default: false (boolean)
      • Rebuild - Reload all the GUI.
      • alikeTolerance - The maximum number of differences to be selected by the "Select alike" command - Default: 0 (integer)
      • allowDrawSelect - Select by encircling on (true) or off (false) - Default: true (boolean)
      • dragUndo - Whether drag saves an undo step (true) or not (false) - Default: true (boolean)
      • drawDragLine - Whether to show the line from the point of dragging to the mouse (true) or not (false) - Default: true (boolean)
      • drawHingesWhenRunning - Whether to show hinges when running (true) or not (false) - Default: true (boolean)
      • geomGenMinArea - Not sure what this does - Default: 0.0009 (float)
      • geomGenShrink - Not sure what this does either - Default: 0.0033 (float)
      • geomGenTolerance - Not sure what this does either - Default: 1.2 (float)
      • level - The level of interface 1 (Simple), 2 (Medium) or 3 (Advanced) - Default: 1 (integer)
      • toolGestureSensitivity - How sensitive cancel gestures are - Default: 1 (float)
      • toolGestures - Whether to cancel a tool by shaking the mouse (true) or not (false) - Default: true (boolean)
      • toolSpecificCursors - Whether to show a different cursor for each tool (true) or not (false) - Default: true (boolean)
      • trapUser - Whether the user is able to quit, open ingame links and toggle fullscreen (false) or not (true) - Default: false (boolean)
      • useHSL - Use the old colour system (Hue Saturation Lightness)(true) as opposed to HSV (Hue Saturation Value)(false) - Default: false (boolean)
      • zoomFactor - How fast a user zooms in and out - Default: 0.2 (float)
    • Grid.
      • base - The base grid size (1m / base) - Default: 4 (integer)
      • grid - Whether the grid is on (true) or off (false) - Default: false (boolean)
      • numAxes - The number of axes on the grid - Default: 2
      • scale - The scale of the grid. A scale of 2 will have half as many grid squares in the same space as a scale of 1 - Default: 2 (float)
      • snap - Whether to snap to the grid (true) or not (false) - Default: true (boolean)
    • HQPolygons - Whether to store polygon distance maps in much larger textures (true) or not (false) - Default: false (boolean)
    • Redo - Execute a redo step
    • Undo - Execute an undo step
    • alwaysCalcContacts - Whether to calculate collisions every frame (true) or not (false) - Default: false (boolean)
    • autosaveEnable - Whether to autosave every set amount of time (true) or not (false) - Default: true (boolean)
    • autosaveTime - The time (in seconds) between each autosave - Default: 300 (float)
    • borderWidth - The size of polygon borders (screen cm) - Default: 0.1 (float)
    • chainDensityFactor - The multiplier of the default density for chains (2 is 4.0kg/m^2) - Default: 1 (float)
    • checkForUpdates - Whether to check for updates and news each "updateinterval" days (true) or not (false)- Default: true (boolean)
    • dragToolStrength - The strength of the drag tool - Default: 0.25 (float)
    • drawBCs - Whether to show a circle around a polygon (bounding circles?) (which I think is when it begins being tested for collisions)(true) or not(false) - Default: false (boolean)
    • drawBodyCenters - Whether to show the centre of gravity for all geometries (true) or not (false) - Default: false (boolean)
    • drawCables - Whether to show cables (true) or not (false) - Default: false (boolean)
    • drawCollisions - Whether to show collisions (and strengths) (true) or not (false) - Default: false (boolean)
    • drawMapOBBs - Whether to show the oriented bounding boxes map (true) or not (false) - Default: false (boolean)
    • drawOBBs - Whether to show the oriented bounding boxes (true) or not (false) - Default: false (boolean)
    • drawParticleCenters - Whether to mark the centres of particles with green dots(true) or not(false) - Default: false (boolean)
    • drawParticleNeighbors - Whether to connect neighbouring particles with green lines(true) or not(false) - Default: false (boolean)
    • drawScaleIndicator - Whether to show the scale (true) or not (false) - Default: true (boolean)
    • drawSelectionOBB - Whether to show the oriented bounding box of all objects selected (true) or not (false) - Default: false (boolean)
    • drawVelocityFactor - The multiplier for velocity lines (shown when BodyCenters are shown) - Default: 0.02 (float)
    • drawVerticies - Draw green dots at every vertex on a polygon - Default: false (boolean)
    • enableScriptMenu - Whether the script menu for each object is accessible (true) or not (false) - Default: true (boolean)
    • fadeColor - The colour objects fade into the background with - Default: [0,0,0] ([Red(float), Green(float), Blue(float)])
    • fadeRotate - The rotational offset objects fade into the background with - Default: 0 (float)
    • fadeScale - The scale objects fade into the background with - Default [0.95,0.95] ([X(float),Y(float)])
    • fadeTranslate - The distance between each fade step - Default [0,0] ([X(float),Y(float)])
    • forceVertexPolygonDrawing - Whether to force drawing of all verticies(true) or not (false) (this also upgrades collisions) - Default: false (boolean)
    • gpuWater - Whether to use hardware surface generation (true) or not (false) - Default: true (boolean)
    • language - The language of the GUI - Default: English (string)
    • laserBroadPhase - Whether to enable increased performance of lasers (true) or not (false) - Default: true (boolean)
    • laserEvents - Whether to enable onHitByLaser and onLaserHit (true) or not (false) - Default: true (boolean)
    • laserResolution - The quality for finite light speed - Default: 10 (float)
    • laserSuperBoost - Allows more ray splits - Default: 1 (float)
    • laserWaterBVH - Whether to increase laser performance against water using bounding volume hierarchies (true) or not (false) - Default: false (boolean)
    • laserWidth - Laser ray size relative to laser body - Default: 0.2 (float)
    • lineWidth - Width of the Polygon tool's line - Default: 3 (float)
    • marchingSquaresResolution - Not sure what this one's for - Default: 1 (float)
    • maxBorderArea - The maximum area relative to the geometry that can be taken up by the border - Default: 0.2 (float)
    • maxBorderAreaSpecial - The maximum area relative to the geometry that can be taken up by the selection border-Default:0.4(float)
    • maxCogs - The maximum number of cogs avaliable on each gear - Default: 128 (integer)
    • maxPointDist - The maximum distance between one vertex and another when drawing - Default: 0.5 (float)
    • maxPolygonBorderFactor - The width of a polygons border - Default: 0.75 (float)
    • maxSPHSpawn - The maximum number of particles able to be spawned using one liquify command - Default: 2000 (integer)
    • maxUndo - The maximum number of undo/redo steps - Default: 40 (integer)
    • metaCutoff - Meta-surface generation cutoff - Default: 0.5 (float)
    • metaWater - Whether meta-surface generation is on (true) or off (false) - Default: true (boolean)
    • minPointDist - The minimum distance between one vertex and another when drawing - Default: 0.15 (float)
    • mousePos - The position of the mouse.
    • numColorsInRainbow - The number of colours each ray splits into - Default: 12 (integer)
    • pointSize - The size of the the points (like vertex points and body centres) - Default: 3 (float)
    • polytoolPreviewColor - The color of the preview area of each polygon - Default: [1,0.5,1,0.4] ([Red(float),Green(float),Blue(float),Alpha(float)])
    • scaleGravityField - Whether to scale field arrows with gravity strength(true) or not(false) - Default: false (boolean)
    • sceneFadeInTime - How long it takes for a scene to fade in - Default: 1 (float)
    • screenshotsWithAlpha - Saves scenes with the alpha channel in tact (transparent screenshots) - Default: false (boolean)
    • showGravityField - Whether to show the gravity field for attraction(true) or not(false) - Default: false (boolean)
    • updateInterval - The news and update checking interval (days) - Default: 1 (integer)
    • waterColor - The color of the water - Default: [0.1,0.1,1,0.7] ([Red(float),Green(float),Blue(float),Alpha(float)])
    • waterElongation - The length a water droplet will extend to - Default: 0.05 (float)
    • waterRefractiveIndex - The reflective-ness of water - Default: 1.33 (float)
    • waterTracerLightness - How bright water tracers are in relation to the colour of the water - Default: 0.75 (float)
    • waterTracerSize - The size of the water tracers - Default: 0.015 (float)
    • waterTracers - The fraction of a water particle that should have a tracer - Default: 0 (integer)
  • Console.
    • clear - Clear the console.
    • color - The colour of the console pane - Default: [0.1,0.1,0.1,0.8] ([Red(float),Green(float),Blue(float),Alpha(float)])
    • delay - How long it takes the console to come down - Default: 0.3 (float)
    • fade - Whether the console should fade in transparency lengthways (true) or not(false) - Default: false (boolean)
    • print - Print to the console window
    • screenSize - How much of the screen for the console to take up - Default: 0.35 (float)
    • scroll - Whether the window scrolls in (true) or fades in (false) - Default: true (boolean)
  • Defaults.
    • borders - Whether to set borders on by default (true) or not (false) for new objects - Default: true (boolean)
    • glueToWorld - Whether to glue new geometries to the background (true) or not (false) - Default: false (boolean)
  • FileInfo.
    • author - Who made the scene - Default: (string)
    • description - A short description of the scene - Default: (string)
    • title - The title of the scene - Default: (string)
    • version - The version of the scene - Default: 6 (integer)
  • GUI.
    • bgColor - The color of the background of the Graphical User Interface - Default: [0.2,0.2,0.2,1] ([Red(float),Green(float),Blue(float),Alpha(float)])
    • clickTimeTolerance - How long (time) until a click becomes a hold - Default: 0.3 (float)
    • clickTolerance - How long (distance) until a click becomes a hold - Default: 5 (float)
    • crispFontFactor - How crisp fonts are - Default: 0.5 (float)
    • crispFonts - Whether to use crisper fonts(true) or not(false) - Default: false (boolean)
    • cursor - Whether to have the cursor on (true) or off (false) - Default: true (boolean)
    • cursorFPSLimit - The minimum FPS for non-O/S cursor - Default: 25 (float)
    • fgColor - The foreground colour of the Graphical User Interface - Default: [1,1,1,1]([Red(float),Green(float),Blue(float),Alpha(float)])
    • font - The default font to be used (language files override this) - Default: arial_black (string)
    • fontShadow - Whether to use drop shadow on font (true) or not (false) - Default: true (boolean)
    • forceOSCursor - Whether to always use the O/S cursor (true) or not (false) - Default: true (boolean)
    • opacity - The opacity of the Graphical User Interface - Default: 0.8 (float)
    • penInput - clickTolerance and clickTimeTolerance are changed - Default: false (boolean)
    • rightToLeft - Whether to reverse all text (true) or not (false) - Default: false (boolean)
    • scale - Scale of GUI - Default: 1.0 (float)
    • tooltips - Whether to have tooltips (true) or not (false) - Default: true (boolean)
  • Input.
    • touchScreenDetection - Detect if there is a touchscreen (don't know, assumption) - Default: true (boolean)
    • touchScreenDetectionGoodCutoff - Attempt to get a better switch (again, not sure) - Default: 30 (integer)
    • touchScreenDetectionRelCutoff - Movements larger than this number are marked errors (again, not sure) - Default: 50 (integer)
  • Keys.
    • bind - Bind a key to an action
    • unbind - Unbind a key from all actions
  • Reflection.
    • ExecuteCode - Execute specified code from [ROOT] scope
    • ExecuteFile - Execute plain text in thyme parsing from specified file in [ROOT] scope
  • Resources.
    • force16BitTextures - Force all rendering into 16-bit colours
    • loadAll - Load all resources
    • polyCount - The number of polygons that have been spawned in the current scene
    • polyEntCount - The number of polygons that have been spawned in the current scene
    • polyMeshCount - The number of different polygon meshes that have been spawned in the current scene
    • reloadAll - Reload all resources
    • reloadShaders - Reload just shaders
    • reloadTextures - Reload all textures
    • shaders - Whether anti-aliasing is on(true) or off(false) - Default: false (boolean)
    • snapshotCount - The number of screenshots taken (multi-session)
    • textureCount - The number of different textures loaded in the current session
    • textures - Whether textures (not currently in use) should be used(true) or not (false) - Default: true (boolean)
    • unloadAll - Unload all textures not currently in use
    • vramUsage - How many bytes of video RAM is being used on this scene.
  • SPH.
    • SetClassicSPH - Use the classic compressible model of water
    • SetNewSPH - Use the new incompressible model of water
    • bucketSize - (forgotten)
    • density - The density of water - Default: 1 (float - what a great joke :))
    • friction - The friction of water - Default: 0.01 (float)
    • geomFieldOffset - How far away from geometries the water has to be (anti-hydrophobic :)) - Default: 0.5 (float)
    • geomFriction - How much friction water has when in contact with geometries - Default: 0.001 (float)
    • geomMassMultiplier - This number multiplied with particle mass is the pretended mass of neighbouring geometries - Default: 2 (integer)
    • geometryFields - Better incompressability - Default: false (boolean)
    • incompressible - Better incompressability - Default: false (boolean)
    • influence - How much influence each particle has on its neighbours - Default: 2 (float)
    • jitter - How much particles randomly move around - Default: 0 (float)
    • kernelMultiplier - How close particles can be to each other - Default: 1 (float)
    • kernelNormalize - Not sure - Default: true (boolean)
    • lowMassCollisionRadiusFactor - How close a light object able to get to the water - Default: 0.4 (float)
    • maxNeighbors - The maximum neighbours for a single particle - Default: 64 (integer)
    • minMassFactor - Geometry fields will not be given to objects with lower mass than particle*this - Default: 3 (float)
    • nonPenetration - Not sure again - Default: true (boolean)
    • pressMultiplier - Pressure Multiplier - Default: 1 (float)
    • radius - The radius of a single particle - Default: 0.05 (float)
    • restitution - How bouncy water particles are - Default: 0 (float)
    • solveConst - How frequently solvings for water happen relating to geometries - Default: 1e+006 (float)
    • solveIters - How many iterations of solvings of water happen - Default: 1 (integer)
    • solveT - How frequently solvings for water happen - Default: 0.01 (float)
    • sort - Not sure - Default: false (boolean)
    • soundSpeed - Speed of Sound - Default: 20 (float)
    • specialPressure - Not sure again - Default: true (boolean)
    • spikyKernel - Not sure, keeps water stable - Default: false (boolean)
    • surfaceTension - Applies surface tension - Default: 0 (float)
    • unilateral - Whether to only apply separating forces (true) or not (false) - Default: true (boolean)
    • vaporizeTime - How long an idle particle will remain in the simulation - Default: +inf (float)
    • velocitySmoothing - Not sure, I would assume whether or not velocity is smoothed - Default: true (boolean)
    • viscMultiplier - Viscosity multiplier - Default: 1 (float)
    • viscosity - How viscous a liquid is - Default: 0.5 (float)
  • Scene.
    • Camera.
      • pan - How far from origin the camera is - Default: [0,0] ([X(float),Y(float)])
      • rotation - How rotated the camera is - Default: 0 (float)
      • smoothFactor - How smoothed movement is - Default: 0.9 (float)
      • smoothPan - Whether to smooth panning (true) or not (false) - Default: true (boolean)
      • smoothRotation - Whether to smooth rotation (true) or not (false) - Default: true (boolean)
      • smoothZoom - Whether to smooth zooming (true) or not (false) - Default: true (boolean)
      • trackRotation - Whether to track the rotation of followed objects (true) or not (false) - Default: false (boolean)
      • zoom - How far zoomed the camera is - Default: 150 (float)
    • clear - Clear the current scene (keep settings)
    • EraseWater - Remove all water from scene
    • MoveToOrigo -Move scene to origin
    • New - Start a new scene (new settings)
    • Open - Open a scene
    • SaveAs - Save current scene as
    • addBox - Add a box to the current scene
    • addCircle - Add a circle to the current scene
    • addFixjoint - Add a fixate to the current scene
    • addGroup - Group objects in the current scene
    • addHinge - Add a hinge to the current scene
    • addLaserPen - Add a laser to the current scene
    • addPen - Add a tracer to the current scene
    • addPlane - Add a plane to the current scene
    • addPolygon - Add a polygon to the current scene
    • addSpring - Add a polygon to the current scene
    • addWater - Add particles to the current scene
    • addWidget - Add a widget (element of GUI) to the current scene
    • author - Who made the scene - Default: (string)
    • description - A short description of the scene - Default: (string)
    • gravityRotationOffset - The rotational offset of gravity - Default: NaN (float)
    • importPhunlet - Import a phunlet to the current scene
    • loadScene - Load a scene
    • my - Scene.my.* class
    • setFilter - Layer filter (which layers are showing at the current point in time)
    • title - The title of the scene - Default: (string)
  • Sim.
    • adHocSolver - Whether to use a more primitive solver (true) or not (false) - Default: false (boolean)
    • airDensity - The density of air (heavier fall below) - Default: 0.01 (float)
    • airFrictionLinear - The air friction linear force - Default: 0.01 (float)
    • airFrictionMultiplier - The air friction force multiplier - Default: 1 (float)
    • airFrictionQuadratic - The air friction quadratic force - Default: 0 (float)
    • airSwitch - Whether air is on(true) or not (false) - Default: true (boolean)
    • blockedContactSolver - Whether objects with only a few contacts are solved directly (true) or not (false) -Default: false (boolean)
    • blockedContactSolver2N - Whether objects with only two contacts' normal forces will be solved directly(true) or not(false)- Default: true (boolean)
    • blockedContactSolver2NF - Whether objects with only two contacts' normal and friction forces will be solved directly(true) or not(false) - Default: false (boolean)
    • blockedContactSolver3N - Whether objects with only three contacts' normal forces will be solved directly(true) or not(false) - Default: true (boolean)
    • blockedContactSolver4N - Whether objects with only four contacts' normal forces will be solved directly(true) or not(false) - Default: false (boolean)
    • bodyCount - The number of bodies in the current scene (at the current point in time)
    • bruteColliderCutoff - Not sure - Default: 0 (integer)
    • cableAdaptiveSlack - Whether to adjust stiffness of hinges based on density (true) or not (false) - Default: false (boolean)
    • cableDistanceConstraint - Not sure - Default: true (boolean)
    • cableJacobianScale - How much the force is distributed through the entire object - Default: 1 (float)
    • cableLineConstraint - Whether to increase the strength of a hinge as it pulls further away from it's attatched object(true) or not (false) - Default: true (boolean)
    • cableLineInternalize - Whether to stiffen chains more (false) or not (true) - Default: false (boolean)
    • cableLineSmartChoice - Whether to stiffen chains more (true) or not (false) - Default: true (boolean)
    • cableMaxImpFactor - Not sure - Default: +inf (float)
    • cableMaxMassRation - Not sure - Default: 2 (float)
    • cableMaxSlack - The maximum distance of hinge from attatched object (desired) - Default: 0.1 (float)
    • cableMiliatryConstraint - Whether to use extremely stiff hinges (true) or not (false) - Default: false (boolean)
    • cableSafetyDistance - Not sure - Default: 0 (integer)
    • cables - Whether to use cables (true)(stiffer hinges) or not (false) - Default: true (boolean)
    • defaultBodyDensity - The default for newly spawned geometries' densities - Default: 2 (float)
    • defaultBodyFriction - The default for newly spawned geometries' friction - Default: 0.5 (float)
    • defaultBodyRestitution - The default for newly spawned geometries' restitutions (bounciness) - Default: 0.5 (float)
    • fastPolyAABB - Whether to do an estimation of the polygon axis aligned bounding box - Default: true (boolean)
    • forceContactCalculations - Whether to force all contact calculations to be carried out (true) or not (false) - Default: false (boolean)
    • frequency - The frequency at which the simulation simulates (Hz) - Default: 100 (float)
    • geomCount - The number of geometries in the current scene
    • gravityAngleOffset - The number of radians the scene's gravity is rotated - Default: 0 (float)
    • gravityStrength - The strength of gravity (m/s^2) - Default: 9.8 (float)
    • gravitySwitch - Whether gravity is on (true) or not (false) - Default: true (boolean)
    • largeOverlapTest - Whether to try to treat large overlaps of geometries seperately (true) or not (false) - Default: true (boolean)
    • maxPositionCorrection - Not sure - Default: +inf (float)
    • maxSpringStrength - Maximum recommended spring force - Default: 10 (float)
    • mutipleContactEventPerPair - Whether each contact should get two onCollide actions (true) or not (false) - Default: false (boolean)
    • nyquistFactor - Not sure - Default: 4 (float)
    • optimizeContactSet - Whether to attempt to reduce contact set to minimum value(true) or not (false) - Default: true (boolean)
    • particleCount - How many particles are in the current scene
    • polygonMeshSize - How high quality polygons are (when forcing rendering of all verticies, this is irrelevant) - Default: [128,128] ([(integer),(integer)])
    • rotFrictionLinear - Required force is Nm*this to rotate at desired speed - Default: 0.00314 (float)
    • running - Whether the simulation is running (true) or not (false) - Default: true (boolean)
    • skipDistance - The distance before areas are added to the skip list - Default: 0.15 (float)
    • solveAccFactor - The number of steps to use for solving acceleration - Default: 1 (float)
    • solveConstCables - The solving constant for cables - Default: 1e+008 (float)
    • solveConstant - The solving constant (for physics) - Default: 1e+008 (float)
    • solveDistFactor - The speed at which overlapping objects will exit each other - Default: 1 (float)
    • solveIter - The number of steps to use for solving iterations (stiffer hinges) - Default: 30 (integer)
    • solvePenetrationDamping - Whether to solve using Penetration Damping (true) or not (false) - Default: false (boolean)
    • solvePreSortConstraints - Not sure - Default: true (boolean)
    • solveRandomizeConstraints - Not sure - Default: true (boolean)
    • solveRegularizationFactor - How random constraint movement is - Default: 1 (float)
    • solveReverseConstraints - Whether to alternate order of constraint solving (true) or not (false) - Default: false (boolean)
    • solveStiffIter - How many steps to use for solving stiff hinge iterations - Default: 0 (integer)
    • solveTCables - Delta between cable solvings - Default: 0.05 (float)
    • solveTconstraints - Delta between constraint solvings - Default: 0.05 (float)
    • solveTcontacts - Delta between contact solvings (penetration reaction) - Default: 0.05 (float)
    • solveVelFactor - Solver for velocities - Default: 1 (float)
    • solver - Which solver to use - Default: gs (string)
    • solverSOR - The relaxation of the iteration solver - Default: [1,1,1] ([Beginning(float),Middle(float),End(float)])
    • sortBroadPhasePairs - Whether to sort broad-phase pairs first (true) or not (false) - Default: false (boolean)
    • springForce - The multiplier of the force of a spring - Default: 1000 (float)
    • targetPenetration - The level of penetration to attempt to reach - Default: 0.0001 (float)
    • time - The time the current scene has been running
    • timeFactor - The multiplier for the time that runs in the scene - Default: 1 (float)
    • useSkipLists - Skip testing collisions not close to possible collisions - Default: true (boolean)
    • warmStart - Whether to apply forces at start (false) or not (true) - Default: true (boolean)
    • warmStartFactor - How much warm start to apply - Default: 0.5 (float)
  • System.
    • antiAlias - How many antialiases to use - Default: 1 (integer)
    • depth - The colour depth - Default: 32 (integer)
    • exit - Close phun
    • fakeFullscreen - Whether to use fake fullscreen (true) or true fullscreen (false) - Default: true (boolean)
    • frame - Whether to use fullscreen in a frame (true) or normal fullscreen (false) - Default: true (boolean)
    • fullscreen - Whether phun is in fullscreen (true) or not in fullscreen(false) - Default: false (boolean)
    • maxFPS - The target maximum frames per second - Default: 60 (float)
    • maximized - Whether the window is maximized (true) or not (false) - Default: false (boolean)
    • minFPS - The target minimum frames per second - Default: 10 (float)
    • objectCurrent - Information about current object
    • objectTotal - Not sure
    • recreateWindow - Reload GUI and shaders of the window at the new resolution
    • regularScreenshots - Take a screenshot every interval - Default: 0 (integer)
    • resizable - Whether the window can be resized (true) or not (false) - Default: true (boolean)
    • resolution - The resolution of the window - Default: [800,600] ([X(Integer), Y(Integer)])
    • screenshot - Take a screenshot
    • time - The time phun has been running for
    • vSync - Whether vSync is on (true) or off (false) - Default: false (boolean)
  • Tablet. (assumption)
    • hasOrientation - Does the tablet detected have an accelorometer (true) or not (false)
    • hasPressure - Does the tablet detected have pressure sensitivity (true) or not (false)
    • hasTablet - Is there a tablet detected (true) or not (false)
    • improveClickTolerance - Whether to improve tolerance of distance and time of the mouse(true) or not(false)-Default:true(boolean)
    • orientation - What orientation the tablet is at
    • overrideMouseEvents - Whether to override mouse events (true) or not (false) - Default: true (boolean)
    • pressure - What pressure level the current push is at.
    • rightClickOverride - Not sure
  • Threading.
    • numThreads - The number of threads to run everything on - Default: 1 (integer)
  • WebCam.
    • flipHoriz - Whether to flip web camera horizontally (true) or not (false) - Default: false (boolean)
    • flipVert - Whether to flip web camera vertically (true) or not (false) - Default: false (boolean)
  • cos - Same as Math.cos
  • eval - Evaluate function in current scope
  • exit - Same as System.exit
  • if_then_else - If structure (True/False statement ? True action : False action)
  • math.
    • HSL2RGB - Convert Hue-Saturation-Lightness to Red-Green-Blue
    • HSV2RGB - Convert Hue-Saturation-Value to Red-Green-Blue
    • RGB2HSL - Convert Red-Green-Blue to Hue-Saturation-Lightness
    • RGB2HSV - Convert Red-Green-Blue to Hue-Saturation-Value
    • acos - Inverse cosine
    • add - Add value1 to value2 (+)
    • addlist - Add list1 to list2 (++)
    • and - Logical and (&&)
    • asin - Inverse sine
    • atan - Inverse tangent
    • boolnegate - Invert logical statement (!)
    • comp.
      • eq - Equal to (==)
      • g - Greater than (>)
      • ge - Greater than or equal to (>=)
      • l - Less than (<)
      • le - Less than or equal to (<=)
      • ne - Not equal to (!=)
    • cos - Cosine
    • divide - Divide value1 by value2 (/)
    • mod - Modulus (%)
    • multiply - Multiply value1 by value2 (*)
    • negate - Multiply by -1 (* (-1))
    • or - Logical or (||)
    • pi - Pi (3.1415926535897932384626433832795...)
    • posivate - Multiply by 1 (* 1)
    • pow - Power of (^)
    • sin - Sine
    • subtract - Subtract value2 from value1 (-)
    • tan - Tangent
    • toBool - Translate value to a true or false value (!= 0)
    • toFloat - Translate value to a float value
    • toInt - Translate value to an integer value
    • toString - Translate value to a string value ( + "")
  • print - Same as Console.print
  • quit - Same as exit & System.exit
  • sin - Same as Math.sin


--
Grady

This took much longer than I thought it would, and I think it has every single function/variable in 1.5.61 (intrinsic functions only).

Involved in corrections:

Tatt61880 - Reminded me of the actual function of Scene.setFilter .

:mrgreen: Hope you guys have fun with these, they took quite a while to get.

Also, I haven't had a chance to check out the newest version yet, so, I haven't verified these all as accurate yet :).

EDIT: Modified (should contain indent now)
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Versieon » Tue Sep 01, 2009 5:18 pm

I know this will be extreemly helpfull to many scripters, I hope it doesn't get burried like it did in the old forum..(at least I though it did).

Mabey this should be stickied, if thats possible.

Im not sure if you had this, but lazers have diferent subs then I thought, its e.lazer and e.geom for something it hits.
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Conundrumer » Tue Sep 01, 2009 5:51 pm

What's the speed of sound for? >_>
User avatar
Conundrumer
 
Posts: 344
Joined: Mon Aug 31, 2009 5:55 pm
Location: NYC

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Versieon » Tue Sep 01, 2009 8:04 pm

i belive its for calculating how water interacts with itself, pressure waves, for instance
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby cdh473 » Wed Sep 02, 2009 1:45 am

err...
for new thymers, i would have added scene.my in there, with a little explanation(short summary).
Please excuse my posts. I am extremely stupid.
User avatar
cdh473
 
Posts: 816
Joined: Tue Sep 01, 2009 12:37 am
Location: Yes

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Wed Sep 02, 2009 2:24 pm

cdh473 wrote:err...
for new thymers, i would have added scene.my in there, with a little explanation(short summary).

This is from memory, so, sorry if I miss one :D .

Scene.my->{}
Scene.my.*
  • The Scene.my scope is used to declare variables that will stay with the scene when saved.

Scene.addBox{}
  • airFrictionMult
  • angle
  • angvel
  • attraction
  • body
  • buttonDestroy
  • buttonMirror
  • collideSet
  • collideWater
  • color
  • controllerAcc
  • controllerInvertX
  • controllerInvertY
  • controllerReverseXY
  • density
  • drawBorder
  • entityID
  • friction
  • geomID
  • heteroCollide
  • immortal
  • killer
  • materialVelocity
  • onCollide
    • normal
    • pos
    • this.
      • Liquify
      • airFrictionMult
      • attraction
      • collideSet
      • collideWater
      • color
      • controllerAcc
      • controllerInvertX
      • controllerInvertY
      • density
      • drawBorder
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • refractiveIndex
      • restitution
      • ruler
      • text
      • textColor
      • textScale
      • texture
      • textureMatrix
  • onHitByLaser
    • normal
    • pos
    • geom.
      • Liquify
      • airFrictionMult
      • attraction
      • collideSet
      • collideWater
      • color
      • controllerAcc
      • controllerInvertX
      • controllerInvertY
      • controllerReverseXY
      • density
      • drawBorder
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • refractiveIndex
      • restitution
      • ruler
      • text
      • textColor
      • textScale
      • texture
      • textureMatrix
  • opaqueBorders
  • pos
  • refractiveIndex
  • restitution
  • ruler
  • size
  • text
  • textColor
  • textScale
  • texture
  • textureMatrix
  • vel
  • zDepth

Scene.addCircle{}
  • airFrictionMult
  • angle
  • angvel
  • attraction
  • body
  • buttonDestroy
  • buttonMirror
  • collideSet
  • collideWater
  • color
  • controllerAcc
  • controllerInvertX
  • controllerInvertY
  • controllerReverseXY
  • density
  • drawBorder
  • drawCake
  • entityID
  • friction
  • geomID
  • heteroCollide
  • immortal
  • killer
  • onCollide
    • normal
    • pos
    • this.
      • Liquify
      • airFrictionMult
      • attraction
      • collideSet
      • collideWater
      • color
      • controllerAcc
      • controllerInvertX
      • controllerInvertY
      • controllerReverseXY
      • density
      • drawBorder
      • drawCake
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • protractor
      • refractiveIndex
      • restitution
      • texture
      • textureMatrix
  • onHitByLaser
    • normal
    • pos
    • geom.
      • Liquify
      • airFrictionMult
      • attraction
      • collideSet
      • collideWater
      • color
      • controllerAcc
      • controllerInvertX
      • controllerInvertY
      • controllerReverseXY
      • density
      • drawBorder
      • drawCake
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • protractor
      • refractiveIndex
      • restitution
      • texture
      • textureMatrix
  • opaqueBorders
  • pos
  • radius
  • refractiveIndex
  • restitution
  • protractor
  • texture
  • textureMatrix
  • vel
  • zDepth

Scene.addFixjoint{}
  • buttonDestroy
  • buttonMirror
  • color
  • entityID
  • geom0
  • geom1
  • geom1pos
  • opaqueBorders
  • size
  • world0pos
  • world1pos
  • zDepth

Scene.addGroup{}
  • entityIDs
  • name
  • particleIDs

Scene.addHinge{}
  • autoBrake
  • buttonDestroy
  • buttonMirror
  • ccw
  • color
  • distanceLimit
  • entityID
  • geom0
  • geom1
  • geom1pos
  • impulseLimit
  • motor
  • motorTorque
  • opaqueBorders
  • size
  • world0pos
  • world1pos
  • zDepth

Scene.addLaserPen{}
  • buttonDestroy
  • buttonMirror
  • collideSet
  • collideWater
  • color
  • cutter
  • entityID
  • fadeDist
  • geom
  • maxRays
  • onLaserHit
    • laser.
      • collideSet
      • collideWater
      • color
      • cutter
      • fadeDist
      • maxRays
      • onLaserHit
      • opaqueBorders
      • showLaserBodyAttrib
      • size
      • velocity
    • normal
    • pos
  • opaqueBorders
  • relpoint
  • rotation
  • showLaserBodyAttrib
  • size
  • velocity

Scene.addPen{}
  • buttonDestroy
  • buttonMirror
  • color
  • entityID
  • fadeTime
  • geom
  • opaqueBorders
  • pos
  • rotation
  • size
  • zDepth

Scene.addPlane{}
  • angle
  • attraction
  • body
  • buttonDestroy
  • buttonMirror
  • collideSet
  • collideWater
  • color
  • drawBorder
  • entityID
  • friction
  • geomID
  • heteroCollide
  • immortal
  • killer
  • materialVelocity
  • onCollide
    • normal
    • pos
    • this.
      • attraction
      • collideSet
      • collideWater
      • color
      • drawBorder
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • refractiveIndex
      • restitution
      • texture
      • textureMatrix
  • onHitByLaser
    • normal
    • pos
    • geom.
      • attraction
      • collideSet
      • collideWater
      • color
      • drawBorder
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • refractiveIndex
      • restitution
      • texture
      • textureMatrix
  • opaqueBorders
  • pos
  • refractiveIndex
  • restitution
  • texture
  • textureMatrix
  • zDepth

Scene.addPolygon{}
  • airFrictionMult
  • angle
  • angvel
  • attraction
  • buttonDestroy
  • buttonMirror
  • collideSet
  • collideWater
  • color
  • controllerAcc
  • controllerInvertX
  • controllerInvertY
  • controllerReverseXY
  • density
  • drawBorder
  • entityID
  • friction
  • geomID
  • heteroCollide
  • immortal
  • killer
  • materialVelocity
  • onCollide
    • normal
    • pos
    • this.
      • Liquify
      • airFrictionMult
      • attraction
      • collideSet
      • collideWater
      • color
      • controllerAcc
      • controllerInvertX
      • controllerInvertY
      • controllerReverseXY
      • density
      • drawBorder
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • refractiveIndex
      • restitution
      • texture
      • textureMatrix
  • onHitByLaser
    • normal
    • pos
    • geom.
      • Liquify
      • airFrictionMult
      • attraction
      • collideSet
      • collideWater
      • color
      • controllerAcc
      • controllerInvertX
      • controllerInvertY
      • controllerReverseXY
      • density
      • drawBorder
      • friction
      • heteroCollide
      • immortal
      • killer
      • materialVelocity
      • onCollide
      • onHitByLaser
      • opaqueBorders
      • refractiveIndex
      • restitution
      • texture
      • textureMatrix
  • opaqueBorders
  • pos
  • refractiveIndex
  • restitution
  • surfaces
  • texture
  • textureMatrix
  • vel
  • zDepth

Scene.addSpring{}
  • geom1
  • geom1pos
  • world1pos
  • entityID
  • world0pos
  • opaqueBorders
  • size
  • zDepth
  • color
  • geom0
  • dampingFactor
  • length
  • strengthFactor

Scene.addWidget{}
  • widgetID
  • minimized
  • pos
  • size
  • title

Scene.addWater{}
  • vecs
  • vels
  • version

Scene.setFilter{} (thanks tatt :thumbup: )
  • mask
  • rest

  • airFrictionMult - The air friction multiplier (float).
  • angle - The angle of an object (float).
  • angvel - The angular velocity of an object (float).
  • attraction - The attractive force factor of an object (float).
  • autoBrake - Whether auto brake is on (true) or not (false) (boolean).
  • body - The group of objects (stuck together) this object is part of (integer).
  • buttonDestroy - The button to press to destroy an object (string).
  • buttonMirror - The button to press to mirror an object (sting).
  • ccw - Whether to run the motor counter-clockwise (true) or not (false) (boolean).
  • collideSet - The collision group (binary) of an object (integer).
  • collideWater - Whether to collide with water (true) or not (false) (boolean).
  • color - The colour of an object ([Red(float),Green(float),Blue(float),Alpha(float)]).
  • controllerAcc - The force (m/s^2) of the geometry controller (float).
  • controllerInvertX - Whether to invert the X axis (L = "R"; R = "L") (true) or not (false) (boolean).
  • controllerInvertY - Whether to invert the Y axis (U = "D"; D = "U") (true) or not (false) (boolean).
  • controllerReverseXY - Whether to invert the axis (X = "D" "U"; Y = "R" "L" ) (true) or not (false) (boolean).
  • cutter - Whether the laser is a cutter (true) or not (false) (boolean).
  • dampingFactor - The factor for strength of damping on springs (float).
  • density - The density (kg/m^2) of an object (float).
  • distanceLimit - The limit of a constraint before it will break (float).
  • drawBorder - Whether to draw the polygon border (true) or not (false) (boolean).
  • drawCake-Whether to draw the cake of a circle (different coloured part) (true) or not (false) (boolean).
  • entityID - The entity identification number of an object (integer).
  • entityIDs - Entity IDs to be included in a group (array of integers).
  • fadeDist - The distance (m) a laser will fade to (float).
  • fadeTime - How long a tracer trail will last (s) (float).
  • friction - The friction coefficient of an object (float).
  • geom - The geometry an object is attached to (integer).
  • geom0 - The first geometry an object is attached to (ID) (integer).
  • geom1 - The second geometry an object is attached to (ID) (integer).
  • geom1pos - The position of attachment for world-body attachments ([x(float),y(float)]).
  • geomID - The geometry identification number of an object (integer).
  • heteroCollide - Whether an object collides with identical collide sets (false) or not(true) (boolean).
  • immortal - Whether an object is affected by killers and cutters (false) or not (true) (boolean).
  • impulseLimit - The maximum impulse force before a constraint will break (float).
  • killer - Whether an object will kill mortal objects on contact (true) or not (false) (boolean).
  • length - How long a spring will attempt to extend to (float).
  • Liquify - Liquify an object.
  • mask - Which layers to hide (integer).
  • materialVelocity - The force added to an object contacting the surface of this object (float).
  • maxRays - The maximum refractions of a laser (integer).
  • minimized - Whether the widget is minimized (true) or not (false) (boolean).
  • motor - Whether to run a motor (true) or not (false) (boolean).
  • motorTorque - How strong a motor will run (float).
  • name - The name of a group (string).
  • onCollide - A script executed when a collision takes place (sends class object as argument into onCollide on impact and executes).
  • onHitByLaser - A script executed when an object is touched by a laser (sends class object as an argument into onHitByLaser on impact and executes).
  • onLaserHit - A script executed when a laser ray is touched by an object (sends class object as an argument into onLaserHit on impact and executes).
  • opaqueBorders - Whether borders will show regardless of the opacity of an object (true) or not (false) (boolean).
  • particleIDs - The particles in a group (array of integers).
  • pos - The position of an object ([x(float), y(float)]).
  • protractor - Whether to draw a protractor on circles (true) or not (false) (boolean).
  • radius - The radius of a circle (float).
  • refractiveIndex - The level of refraction (how much light it reflects) an object has (float).
  • relpoint - Not sure (I assume it's for phunlets :)) ([x(float),y(float)]).
  • rest - Whether those not in the mask group are hidden (false) or not (true) (boolean).
  • restitution - The restitution (bounciness) coefficient of an object (float).
  • rotation - The angle of an object (float).
  • ruler - Whether to show a ruler (true) or not (false) (boolean).
  • showLaserBodyAttrib - Whether to show the laser's body (true) or not (false) (boolean).
  • size - How big a box is ([x(float),y(float)])/ How big an object is (float).
  • strengthFactor - The factor for how much force a spring will add to get back to it's desired length (float).
  • surfaces - The surfaces of an object (verticies) (array of: [x(float),y(float)]).
  • text - Text to display on a box (string).
  • textColor - Colour of text to display on a box ([Red(float),Green(float),Blue(float),Alpha(float)]).
  • textScale - How big the text is on a box (float).
  • texture - The texture to display on an object (string).
  • textureMatrix - The texture matrix (how to show textures) ([x-scale(float),x-rotation(float),x-offset(float), y-rotation(float),y-scale(float),y-offset(float),(forget)(float),(forget)(float),(forget)(float)]).
  • title - The title of a widget (string).
  • vecs - The positions of particles (array of: [x(float),y(float)]).
  • vel - The velocity of an object (float).
  • vels - The velocities of particles (array of: [x(float),y(float)]).
  • velocity - The speed of light (float).
  • widgetID - The type of widget (string).
  • world0pos - The position of the first geometry ([x(float),y(float)])
  • world1pos - The position of the second geometry ([x(float),y(float)])
  • zDepth - The placement of the object visually (integer).

onCollide specifics
  • normal - The normal of the contact.
  • pos - The position of the contact.


Hope it helps :).

EDIT: Added onCollide Structures :).
EDIT2: Added Water related variables.
Last edited by gradyfitz on Sat Sep 12, 2009 3:41 pm, edited 3 times in total.
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Blazemann » Thu Sep 03, 2009 11:24 pm

My god, thank you. On the creating a box in scene.my, do you put all of them in a value set with semicolons inbetween?
User avatar
Blazemann
 
Posts: 151
Joined: Tue Sep 01, 2009 1:19 am

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby cdh473 » Fri Sep 04, 2009 1:22 am

:D i didn't know about scene.addwidget!
>:D now i can make my own stuff >:D SWEEHEET
Please excuse my posts. I am extremely stupid.
User avatar
cdh473
 
Posts: 816
Joined: Tue Sep 01, 2009 12:37 am
Location: Yes

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby niffirg1 » Fri Sep 04, 2009 2:10 am

Thank you this is infinently helpful
User avatar
niffirg1
 
Posts: 376
Joined: Mon Aug 31, 2009 10:31 pm
Location: The Great American South!

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby tatt61880 » Fri Sep 04, 2009 1:53 pm

Versieon wrote:I know this will be extreemly helpfull to many scripters, I hope it doesn't get burried like it did in the old forum..(at least I though it did).

Mabey this should be stickied, if thats possible.

I thought it did, too. (I always searched the Grady's signature which has the link for it. =) )
I think this list should be in Wiki. And then everyone can edit and maintain it.

There is old one.
http://www.phunland.com/wiki/App.
I think there is no need to separate variables into some pages, btw. ;)
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1148
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Fri Sep 04, 2009 4:46 pm

I have updated the last post (the post with creation functions' parameters,) with onCollide, onLaserHit and onHitByLaser codes :D . I thought this was probably the easiest way to organise all the functions into the right place without too much trouble.
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Paradigm 29 » Fri Sep 04, 2009 7:16 pm

Grady. Can you elaborate on the "eval" function? I don't know how to use it, or what it does.
Image
User avatar
Paradigm 29
 
Posts: 284
Joined: Tue Sep 01, 2009 12:06 am
Location: Houston, Tx

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Sat Sep 05, 2009 4:22 am

Paradigm 29 wrote:Grady. Can you elaborate on the "eval" function? I don't know how to use it, or what it does.

Easily :D .

Eval is a like a protected version of Reflection.executeCode, it wont declare new variables outside the scope. The reason for using eval for me (over Reflection.executeCode) is for local variables as opposed to [ROOT] variables (it's like an action execution). The main reason I use Reflection.executeCode is that you can modify what action you want to take using direct link to variables, instead of 50 or so if structures, you may be able to build a function for each of your expected inputs, which will save a lot of power (for example, if I have one hundred thousand expected inputs, if I used if structures to check @ 100Hz, then I would have quite a laggy scene, whereas, if I use eval or Reflection.executeCode, I could probably run hundreds of the same code).

Example 1: eval
Code: Select all
Scene.my.ErrorCode = (name)=>{eval("Scene.my.ActionsCode" + name)};

Scene.my.ActionsCodeError7 = {Scene.my.Display = "You have a problem in your code"};
Scene.my.ActionsCodeWarning6 = {Scene.my.Display = "WARNING: Enemies approach"};
Scene.my.ActionsCodeWarning2 = {Scene.my.Display = "WARNING: Energy Low"};
... (one thousand more Scene.my.ActionsCode*)


Ok, so, in this example, entering the code (in the console):
Code: Select all
Scene.my.ErrorCode("Error7")

Would modify Scene.my.Display to display "You have a problem in your code".

Whereas, if you wanted to build the same thing in if structures (you have ~50 loop limit for the default loop (you'd be able to get to millions and millions of recursions if you used one of my custom if structures :)), I'm going to use a full repeat structure (it's going to do all if structures as opposed to just up to the depth of finished)).

Example 2: If structure
Code: Select all
Scene.my.ErrorCode = (name)=>{name == "Error1" ? {Scene.my.ActionsCodeError1} : {};name == "Error2" ? {Scene.my.ActionsCodeError2} : {};name == "Error3" ? {Scene.my.ActionsCodeError3} : {}...};


Now, there is benefit of using an if structure over eval or Reflection.executeCode, which is that if you send a non-existent code to the if structure, it can easily be dealt with (by printing something in the console like: "Invalid code, please contact the scene author").

Also, I haven't yet shown an example of the difference of eval and Reflection.executeCode, and here it is:

Example 3: Reflection.executeCode & eval differences (NOTE: Reflection.executeCode will declare a variable, if you do not know how to remove it manually (unless you have nothing important in your config file), you might not want to run this code)
Code: Select all
Scene.my.ExampleEval = (name)=>{eval("Variable" + name)};
Scene.my.ExampleExecuteCode = (name)=>{Reflection.executeCode("Variable" + name)};

Scene.my.RunExample = {print("Attempt to define a variable through eval structure ");Scene.my.ExampleEval("DefinedAttemptEval =  6");print(VariableDefinedAttemptEval);Scene.my.ExampleExecuteCode("DefinedAttemptExecuteCode = 6");print(VariableDefinedAttemptExecuteCode)};


In this example, just run Scene.my.RunExample, and manually delete the variable after you're done :D .

I hope this explained it thoroughly enough :D .
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Sniperkasa » Mon Sep 07, 2009 2:51 pm

I seem to have some problems with dividing.. how exactly ? I've got this code = {working on calculator}
(e)=>{scene.my.addsub == "/" ? {scene.my.total = scene.my.num / scene.my.num2} : {}}

Is there something wrong with it???
Edit : It seems like... sometimes it works.. sometimes not??
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Paradigm 29 » Mon Sep 07, 2009 7:15 pm

Thank you Grady. Your wisdom is indispensable.
Image
User avatar
Paradigm 29
 
Posts: 284
Joined: Tue Sep 01, 2009 12:06 am
Location: Houston, Tx

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby KarateBrot » Mon Sep 07, 2009 9:12 pm

wow this list is awesome! :clap:

what is scene.setFilter{} used for or how can i use it?
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Tue Sep 08, 2009 9:07 am

KarateBrot wrote:wow this list is awesome! :clap:

what is scene.setFilter{} used for or how can i use it?

Thanks :D .

Options -> Layers -> *.

You can use it to hide specific layers (in early beta 5, you were able to still see these layers, but, they are completely hidden from view now (which has it's ups and downs)), these layers are no longer affected by tool modification, which basically allows you to work on your creation without breaking your previous part, then join them both together afterward.



Just so you know, I'm working on the new version of my tutorial and it's about 25.8% complete (rough estimate, most likely very much earlier in) :D .
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby KarateBrot » Tue Sep 08, 2009 11:46 am

cool sounds great :thumbup:
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Sniperkasa » Tue Sep 08, 2009 5:44 pm

Sheesh! Am I invisible or something!? Nobody replies to my scenes, nobody replies to my questions... WHY!?
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby KarateBrot » Tue Sep 08, 2009 8:15 pm

Sniperkasa wrote:Sheesh! Am I invisible or something!? Nobody replies to my scenes, nobody replies to my questions... WHY!?


i don't know but maybe it's because of the " "-signs.

Code: Select all
(e)=>{scene.my.addsub == / ? {scene.my.total = scene.my.num / scene.my.num2} : {}}
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Sniperkasa » Tue Sep 08, 2009 8:27 pm

Nope, cause its like this in the other code :
Code: Select all
{scene.my.addsub  ="/";}  (=>)
{scene.my.addsub == "/" ? {scene.my.total = scene.my.num / scene.my.num2} : {}}
..
or am i wrong?
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Mystery » Wed Sep 09, 2009 10:18 am

Grady your so awesome. Any one that spends time around you will so become addicted to your awesomeness. i used to laugh and kile because he was obsessed with you now i laugh at every who isn't obsessed with you.

How the f**k do you figure this shit out. Did you help make it or something?
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby KarateBrot » Wed Sep 09, 2009 10:19 pm

Sniperkasa wrote:Nope, cause its like this in the other code :
Code: Select all
{scene.my.addsub  ="/";}  (=>)
{scene.my.addsub == "/" ? {scene.my.total = scene.my.num / scene.my.num2} : {}}
..
or am i wrong?


hmm i donÄt know sorry :/
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby gradyfitz » Thu Sep 10, 2009 8:46 am

Sniperkasa wrote:Nope, cause its like this in the other code :
Code: Select all
{scene.my.addsub  ="/";}  (=>)
{scene.my.addsub == "/" ? {scene.my.total = scene.my.num / scene.my.num2} : {}}
..
or am i wrong?

Well, that's your problem, not sure what you are trying to do..... But I assume you want:
Code: Select all
Scene.my.AddSub1 = (addsub)=>{addsub == "/" ? {Scene.my.total = Scene.my.num / Scene.my.num2} : {}}


But I wasn't sure what you were attempting to do in your code :).
Mechanisms: 18 Mechanisms.
Thyme: Tutorial - Variables/Commands List.
Thymechanic
gradyfitz
 
Posts: 174
Joined: Tue Sep 01, 2009 8:33 am
Location: Victoria, Australia

Re: [Thyme][1.5.61]Thyme Command/Variables List

Postby Sniperkasa » Thu Sep 10, 2009 12:20 pm

Okay :
if scene.my.addsub = "/" it means that scene.my.num1 is divided by scene.my.num2
meaning : (e)=>{scene.my.addsub == "/" ? {scene.my.total = scene.my.num / scene.my.num2} : {}}
or did I get something wrong???
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Next

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron