Function Applied to non-Function?

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

Function Applied to non-Function?

Postby Dakta » Sun Nov 01, 2009 1:52 am

I've been working on a bit of code that will check if a variable is larger or smaller than two other variables, and if it is, to incrementally change it back to within the constraints set by the two variables.

Code: Select all
//this goes in the spring length
{scene.my.mainArm}

//current/start length
scene.my.mainArm = 3.0

//min/max values
scene.my.mainArmMax = 4.5
scene.my.mainArmMin = 2.5

//checker
scene.my.checkMainArm = (scene.my.mainArmCheck)=>{scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm - 0.01}}}

//oncollide functions

//called every few m/s by a rotating box
(e)=>{scene.my.checkMainArm}

//called when you press [9]
(e)=>{scene.my.mainArm = scene.my.mainArm + 0.01}

//called when you press [6]
(e)=>{scene.my.mainArm = scene.my.mainArm - 0.01}



This should allow the user to modify the length (scene.my.mainArm), and once it is past the max/min, will adjust it back to within the constraints. It doesn't. Here's the error message.
Code: Select all
-- Warning: Exception Thrown: Function call applied to a non-Function: scene.my.mainArmMin(?)


Can anyone explain this? Or will I have to make the min and max lengths fixed in code?
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial. Image
a Mammoth wrote:be boring and interesting.

Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
I didn't know you could go up 3.1.3! Thanks Mystery person!
User avatar
Dakta
 
Posts: 417
Joined: Sat Sep 12, 2009 4:36 pm

Re: Function Applied to non-Function?

Postby standardtoaster » Sun Nov 01, 2009 1:56 am

Your script is fine. Don't use scene.my.mainArmCheck as the parameter. Use a variable such as N instead. Replace all scene.my.mainArmCheck's with N
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Function Applied to non-Function?

Postby Dakta » Sun Nov 01, 2009 3:18 pm

Ah, so I can't apply a function to a scene.my variable? Bizarre. Definitely something that needs fixing.
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial. Image
a Mammoth wrote:be boring and interesting.

Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
I didn't know you could go up 3.1.3! Thanks Mystery person!
User avatar
Dakta
 
Posts: 417
Joined: Sat Sep 12, 2009 4:36 pm

Re: Function Applied to non-Function?

Postby KarateBrot » Sun Nov 01, 2009 11:26 pm

you can't make it dependent from a variable that's already reserved by a value.

for example:

scene.my.var = 5
scene.my.function = (scene.my.var) => {blah}

that's like:
scene.my.function = (5) => {blah}

and that's no function because 5 is no variable but a constant. So just choose a variable that's not in use. you don't need scene.my.*. just anything you want, like "N" like standardtoaster said or "I_love_variables" etc.

but you don't need a variable for your function because it's not dependent from it. so you can also type in this:
Code: Select all
//checker
scene.my.checkMainArm = {scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm - 0.01}}}
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Function Applied to non-Function?

Postby Dakta » Mon Nov 09, 2009 2:48 am

Well, it still doesn't work. Is there any reason this might be?

For reference, here's the .phn
Code: Select all
// Algodoo scene created by Algodoo v1.6.0

FileInfo -> {
    title = "cat/scene";
    author = "Dakta";
    description = "Simple step up linear movement system.";
    version = 6
};
Sim -> {
    gravityAngleOffset = 0.0;
    gravityStrength = 9.8;
    gravitySwitch = true;
    airSwitch = true;
    airFrictionMultiplier = 1.0;
    airFrictionLinear = 0.01;
    airFrictionQuadratic = 0.0;
    rotFrictionLinear = 0.00314;
    airDensity = 0.01;
    timeFactor = 1.0
};
App -> {
    laserEvents = true;
    numColorsInRainbow = 12;
    laserSuperBoost = 1.0;
    laserResolution = 10.0;
    waterColor = [0.1, 0.1, 1.0, 0.7];
    fadeColor = [0.0, 0.0, 0.0]
};
App.GUI -> {drawHingesWhenRunning = true};
Scene -> {gravityRotationOffset = NaN};
SPH -> {
    vaporizeTime = +inf;
    viscosity = 0.0
};
Scene.my.mainArm := 3.0;
Scene.my.mainArmMax := 4.5;
Scene.my.checkMainArm := {scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin(?)({scene.my.mainArm = scene.my.mainArm - 0.01})}};
App.Grid -> {
    grid = false;
    base = 8;
    numAxes = 2;
    scale = 1.0;
    snap = true
};
App.GUI.Forces -> {
    normalText = "N";
    totalText = "";
    airFrictionText = "-fv";
    attraction = false;
    gravityText = "mg";
    airBuoyancyText = "-adg";
    airFriction = true;
    airBuoyancy = true;
    total = false;
    attractionText = "A";
    externalText = "ext";
    friction = true;
    drawValues = true;
    drawNames = true;
    external = true;
    normal = true;
    velScale = 1.0;
    frictionText = "T";
    springText = "-kx-bv";
    forceScale = 1.0;
    drawForces = false;
    gravity = true;
    contactCombinationDistance = 1.2;
    spring = true;
    velocities = false;
    frictionProjection = true;
    hingeText = "H";
    hinge = true
};
Scene.Camera -> {
    pan = [-7.188117, 16.934443];
    rotation = 0.0;
    trackRotation = false;
    zoom = 265.69135
};
App.Background -> {
    cloudOpacity = 0.95;
    drawClouds = true;
    cuteClouds = true;
    skyColor = [0.45, 0.55, 1.0, 1.0]
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 10;
    zDepth = 0.0;
    geomID = 12;
    pos = [-1000.0, -0.0];
    angle = 0.0;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 11;
    zDepth = 1.0;
    geomID = 13;
    pos = [-0.0, -1000.0];
    angle = 1.5707964;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 12;
    zDepth = 2.0;
    geomID = 14;
    pos = [1000.0, 0.0];
    angle = -3.1415925;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 13;
    zDepth = 3.0;
    geomID = 15;
    pos = [-0.0, 1000.0];
    angle = -1.5707964;
    body = 0
};
Scene.addBox {
    color = [0.99468565, 0.8890118, 0.64002705, 1.0];
    collideSet = 2;
    entityID = 14;
    zDepth = 4.0;
    geomID = 16;
    pos = [-7.279367, 16.277395];
    angle = 0.0062836995;
    size = [0.13, 0.655]
};
Scene.addBox {
    color = [0.99468565, 0.8890118, 0.64002705, 1.0];
    collideSet = 2;
    entityID = 15;
    zDepth = 5.0;
    geomID = 17;
    pos = [-6.618398, 16.256378];
    angle = 0.006284141;
    size = [0.13, 0.655]
};
Scene.addBox {
    color = [0.04453665, 0.33847988, 0.78251296, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm + 0.01};
    entityID = 16;
    zDepth = 8.0;
    geomID = 18;
    pos = [-7.53688, 16.337406];
    angle = 0.0;
    body = 0;
    size = [0.125, 0.58]
};
Scene.addBox {
    color = [0.04453665, 0.33847988, 0.78251296, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm - 0.01};
    entityID = 17;
    zDepth = 9.0;
    geomID = 19;
    pos = [-6.8759165, 16.31639];
    angle = 0.0;
    body = 0;
    size = [0.125, 0.58]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    density = 0.001;
    entityID = 18;
    zDepth = 14.0;
    geomID = 20;
    pos = [-7.32908, 16.578503];
    angle = 3.0257144;
    size = [0.13999999, 0.01999998]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    onCollide = (e)=>{scene.my.checkMainArm};
    density = 0.001;
    entityID = 19;
    zDepth = 15.0;
    geomID = 21;
    pos = [-7.3237243, 16.80335];
    angle = 3.0257144;
    size = [0.13999999, 0.01999998]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    density = 0.001;
    entityID = 20;
    zDepth = 16.0;
    geomID = 22;
    pos = [-6.668116, 16.557486];
    angle = -3.061395;
    size = [0.13999999, 0.01999998]
};
Scene.addCircle {
    color = [0.497, 0.172, 0.262, 1.0];
    collideSet = 2;
    entityID = 21;
    zDepth = 20.0;
    geomID = 23;
    pos = [-7.4677963, 16.50179];
    angle = -1.4601413;
    body = 0;
    radius = 0.04
};
Scene.addCircle {
    color = [0.497, 0.172, 0.262, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm - 0.01};
    collideSet = 2;
    entityID = 22;
    zDepth = 21.0;
    geomID = 24;
    pos = [-6.8067026, 16.480583];
    angle = -1.4601413;
    body = 0;
    radius = 0.04
};
Scene.addPlane {
    immortal = true;
    texture = "/Users/dakota/Desktop/caterpillar-345c-l.gif";
    color = [1.0, 1.0, 1.0, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 23;
    zDepth = 24.0;
    geomID = 25;
    pos = [1006.2202, 2.9650154];
    angle = 3.1415925;
    body = 0
};
Scene.addBox {
    color = [1.0, 1.0, 1.0, 1.0];
    textureMatrix = [0.05, 0.0, 0.5, 0.0, 0.22321428, 0.5, 0.0, 0.0, 1.0];
    texture = "/Users/dakota/Desktop/caterpillar-345c-l.gif";
    collideSet = 0;
    entityID = 24;
    zDepth = 25.0;
    geomID = 26;
    pos = [-14.703304, 13.453465];
    angle = 0.0;
    body = 0;
    size = [20.0, 4.48]
};
Scene.addBox {
    color = [0.72051084, 0.83417094, 0.5614896, 1.0];
    heteroCollide = true;
    entityID = 25;
    zDepth = 26.0;
    geomID = 27;
    pos = [-15.377466, 14.021657];
    angle = 0.41779882;
    body = 35;
    size = [5.58, 0.5500002]
};
Scene.addBox {
    color = [0.81588906, 0.8443649, 0.28744173, 1.0];
    heteroCollide = true;
    entityID = 26;
    zDepth = 27.0;
    geomID = 28;
    pos = [-11.982925, 14.534834];
    angle = -0.2617994;
    body = 35;
    size = [5.4000006, 0.3800001]
};
Scene.addBox {
    color = [0.1597776, 0.049155146, 0.0009520054, 1.0];
    heteroCollide = true;
    entityID = 27;
    zDepth = 28.0;
    geomID = 29;
    pos = [-16.426039, 12.384146];
    angle = -0.17634282;
    body = 38;
    size = [5.55, 0.3699999]
};
Scene.addBox {
    color = [0.99203897, 0.9398812, 0.07181835, 1.0];
    heteroCollide = true;
    entityID = 28;
    zDepth = 29.0;
    geomID = 30;
    pos = [-17.740044, 12.37022];
    angle = 0.0;
    body = 38;
    size = [0.5300007, 1.5200005]
};
Scene.addBox {
    color = [0.34737352, 0.11870369, 0.2522592, 1.0];
    heteroCollide = true;
    entityID = 29;
    zDepth = 30.0;
    geomID = 31;
    pos = [-14.356167, 13.41411];
    angle = 0.0;
    body = 41;
    size = [2.13, 0.19999981]
};
Scene.addBox {
    color = [0.2800451, 0.17985326, 0.308342, 1.0];
    heteroCollide = true;
    entityID = 30;
    zDepth = 31.0;
    geomID = 32;
    pos = [-13.341717, 12.83911];
    angle = 0.0;
    body = 41;
    size = [0.3199997, 1.3500004]
};
Scene.addBox {
    color = [0.93736285, 0.8681074, 0.91242474, 1.0];
    heteroCollide = true;
    entityID = 31;
    zDepth = 32.0;
    geomID = 33;
    pos = [-13.508021, 12.261497];
    angle = 0.5235988;
    body = 41;
    size = [1.0799999, 0.3199997]
};
Scene.addBox {
    color = [0.17277604, 0.19023016, 0.7390346, 1.0];
    heteroCollide = true;
    entityID = 32;
    zDepth = 33.0;
    geomID = 34;
    pos = [-14.146507, 11.794724];
    angle = -0.5235988;
    size = [1.25, 0.22000027]
};
Scene.addBox {
    color = [0.68084085, 0.9156018, 0.53324014, 1.0];
    heteroCollide = true;
    entityID = 33;
    zDepth = 34.0;
    geomID = 35;
    pos = [-13.501716, 11.92761];
    angle = 1.1171296;
    size = [1.0335503, 0.22000027]
};
Scene.addBox {
    color = [0.52515244, 0.14250004, 0.80997366, 1.0];
    onCollide = (e)=>{scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin(?)({scene.my.mainArm = scene.my.mainArm - 0.01})}};
    density = 0.001;
    entityID = 34;
    zDepth = 49.0;
    geomID = 36;
    pos = [-7.404401, 16.816591];
    angle = 0.0;
    body = 0;
    size = [0.11000013, 0.10499954]
};
Scene.addHinge {
    geom0 = 16;
    geom0pos = [0.009055257, -0.2681609];
    geom1 = 0;
    geom1pos = [-7.2686214, 16.009296];
    motorTorque = 1100.0;
    motorSpeed = 2.6;
    color = [0.49685076, 0.02263081, 0.9055634, 1.0];
    entityID = 35;
    zDepth = 6.0;
    size = 0.10901655;
    buttonBack = "[9]"
};
Scene.addHinge {
    geom0 = 17;
    geom0pos = [0.009055257, -0.2681609];
    geom1 = 0;
    geom1pos = [-6.607658, 15.98828];
    motorTorque = 1100.0;
    motorSpeed = 2.6;
    color = [0.49685076, 0.02263081, 0.9055634, 1.0];
    entityID = 36;
    zDepth = 7.0;
    size = 0.10901655;
    buttonBack = "[6]"
};
Scene.addFixjoint {
    geom0 = 18;
    geom0pos = [-0.011863351, -0.2540545];
    geom1 = 0;
    geom1pos = [-7.5487432, 16.083353];
    color = [0.71219754, 0.01439929, 0.95983756, 1.0];
    entityID = 37;
    zDepth = 10.0;
    size = 0.10901655
};
Scene.addFixjoint {
    geom0 = 19;
    geom0pos = [-0.011863351, -0.2540545];
    geom1 = 0;
    geom1pos = [-6.8877797, 16.062336];
    color = [0.71219754, 0.01439929, 0.95983756, 1.0];
    entityID = 38;
    zDepth = 11.0;
    size = 0.10901655
};
Scene.addSpring {
    geom0 = 16;
    geom0pos = [0.017281175, 0.29708445];
    geom1 = 0;
    geom1pos = [-7.0925784, 16.574543];
    color = [0.75225776, 0.80464685, 0.9723907, 1.0];
    constant = 17.029999;
    length = 0.16951829;
    legacyMode = 2;
    entityID = 39;
    zDepth = 12.0;
    size = 0.0719241
};
Scene.addSpring {
    geom0 = 17;
    geom0pos = [0.017281175, 0.29708445];
    geom1 = 0;
    geom1pos = [-6.431615, 16.553526];
    color = [0.75225776, 0.80464685, 0.9723907, 1.0];
    constant = 17.029999;
    length = 0.16951829;
    legacyMode = 2;
    entityID = 40;
    zDepth = 13.0;
    size = 0.0719241
};
Scene.addHinge {
    geom0 = 20;
    geom0pos = [0.0, 0.0];
    geom1 = 16;
    geom1pos = [-0.04782498, 0.30141366];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 41;
    zDepth = 17.0;
    size = 0.009851851
};
Scene.addHinge {
    geom0 = 21;
    geom0pos = [0.0, 0.0];
    geom1 = 0;
    geom1pos = [-7.3237286, 16.80335];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 42;
    zDepth = 18.0;
    size = 0.009851851
};
Scene.addHinge {
    geom0 = 22;
    geom0pos = [0.0, 0.0];
    geom1 = 17;
    geom1pos = [-0.04782498, 0.30141366];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 43;
    zDepth = 19.0;
    size = 0.009851851
};
Scene.addFixjoint {
    geom0 = 23;
    geom0pos = [0.0041577816, 0.01014483];
    geom1 = 0;
    geom1pos = [-7.4570813, 16.498438];
    color = [0.55598253, 0.05140382, 0.40813425, 1.0];
    entityID = 44;
    zDepth = 22.0;
    size = 0.050990567
};
Scene.addFixjoint {
    geom0 = 24;
    geom0pos = [0.0041577816, 0.01014483];
    geom1 = 0;
    geom1pos = [-6.796118, 16.47742];
    color = [0.55598253, 0.05140382, 0.40813425, 1.0];
    entityID = 45;
    zDepth = 23.0;
    size = 0.050990567
};
Scene.addFixjoint {
    geom0 = 28;
    geom0pos = [-1.4013758, -0.010644913];
    geom1 = 27;
    geom1pos = [2.2140656, -0.03583908];
    color = [0.36310434, 0.2627615, 0.24251461, 1.0];
    entityID = 46;
    zDepth = 35.0;
    size = 0.49991745
};
Scene.addFixjoint {
    geom0 = 30;
    geom0pos = [-0.028759003, 0.22845936];
    geom1 = 29;
    geom1pos = [-1.3596077, -0.02435875];
    color = [0.6025893, 0.049631476, 0.8628243, 1.0];
    entityID = 47;
    zDepth = 36.0;
    size = 0.49991745
};
Scene.addFixjoint {
    geom0 = 32;
    geom0pos = [-0.086174965, 0.5716448];
    geom1 = 31;
    geom1pos = [0.9282751, -0.0033550262];
    color = [0.28094983, 0.2424013, 0.32119715, 1.0];
    entityID = 48;
    zDepth = 37.0;
    size = 0.49991745
};
Scene.addHinge {
    geom0 = 30;
    geom0pos = [-0.028759003, 0.5975847];
    geom1 = 27;
    geom1pos = [-2.613246, 0.007080078];
    color = [0.1142869, 0.40067697, 0.5557709, 1.0];
    entityID = 49;
    zDepth = 38.0;
    size = 0.49991745
};
Scene.addHinge {
    geom0 = 34;
    geom0pos = [-0.5294361, -0.008160114];
    geom1 = 29;
    geom1pos = [1.8469429, -0.007882118];
    color = [0.20151223, 0.018654644, 0.25901788, 1.0];
    entityID = 50;
    zDepth = 39.0;
    size = 0.49991745
};
Scene.addHinge {
    geom0 = 35;
    geom0pos = [-0.43647957, 0.0007266998];
    geom1 = 34;
    geom1pos = [0.52173805, 0.002014637];
    color = [0.6551469, 0.24575815, 0.208413, 1.0];
    entityID = 51;
    zDepth = 40.0;
    size = 0.49991745
};
Scene.addHinge {
    geom0 = 35;
    geom0pos = [0.4419489, 0.018375397];
    geom1 = 33;
    geom1pos = [0.19460249, -0.02989769];
    color = [0.6268379, 0.06059867, 0.15083176, 1.0];
    entityID = 52;
    zDepth = 41.0;
    size = 0.49991745
};
Scene.addFixjoint {
    geom0 = 33;
    geom0pos = [0.4224, 0.12841988];
    geom1 = 32;
    geom1pos = [0.13529491, -0.25519753];
    color = [0.37832987, 0.31551203, 0.12894905, 1.0];
    entityID = 53;
    zDepth = 42.0;
    size = 0.49991745
};
Scene.addHinge {
    geom0 = 33;
    geom0pos = [-0.34403467, -0.07694435];
    geom1 = 29;
    geom1pos = [2.6806707, 0.1106863];
    color = [0.15567744, 0.19096865, 0.51077414, 1.0];
    entityID = 54;
    zDepth = 43.0;
    size = 0.49991745
};
Scene.addHinge {
    geom0 = 28;
    geom0pos = [2.5067272, -0.04876995];
    geom1 = 26;
    geom1pos = [5.129072, 0.3854742];
    color = [0.27090865, 0.33888233, 0.628472, 1.0];
    entityID = 55;
    zDepth = 44.0;
    size = 0.49991745
};
Scene.addFixjoint {
    geom0 = 26;
    geom0pos = [-4.6896553, 1.6404991];
    geom1 = 0;
    geom1pos = [-19.39296, 15.093964];
    color = [0.38795352, 0.17214203, 0.22771586, 1.0];
    entityID = 56;
    zDepth = 45.0;
    size = 0.49991745
};
Scene.addSpring {
    geom0 = 29;
    geom0pos = [-2.608158, 0.028217316];
    geom1 = 28;
    geom1pos = [-2.49333, 0.005797386];
    color = [0.37182835, 0.07455677, 0.6579809, 1.0];
    dampingFactor = 2.0;
    constant = 1200.0;
    length = 5.149366;
    legacyMode = 2;
    entityID = 57;
    zDepth = 46.0;
    size = 0.37886575
};
Scene.addSpring {
    geom0 = 28;
    geom0pos = [-1.309206, 0.12614441];
    geom1 = 26;
    geom1pos = [4.1627855, -0.22591782];
    color = [0.34739706, 0.019594371, 0.78728956, 1.0];
    dampingFactor = 2.0;
    constant = 20484.0;
    length = {scene.my.mainarm};
    legacyMode = 2;
    entityID = 58;
    zDepth = 47.0;
    size = 0.37886575
};
Scene.addSpring {
    geom0 = 35;
    geom0pos = [-0.43545628, 0.0038604736];
    geom1 = 30;
    geom1pos = [-0.0738163, -0.6309099];
    color = [0.17601883, 0.26407352, 0.4360568, 1.0];
    dampingFactor = 2.0;
    constant = 1200.0;
    length = 4.122752;
    legacyMode = 2;
    entityID = 59;
    zDepth = 48.0;
    size = 0.37886575
};
Scene.addFixjoint {
    geom0 = 36;
    geom0pos = [-0.027025223, 0.017532349];
    geom1 = 0;
    geom1pos = [-7.431426, 16.834124];
    color = [0.20650825, 0.32835644, 0.41002902, 1.0];
    entityID = 60;
    zDepth = 50.0;
    size = 0.04735837
};
Scene.addGroup {
    name = "selected";
    entityIDs = [19]
};
Scene.addWidget {
    widgetID = "SpringOptions";
    entityIDs = [58];
    minimized = false;
    pos = [365.75, 200.0];
    size = [208.75, 146.0];
    title = "Main Arm"
};
Scene.addWidget {
    widgetID = "SpringOptions";
    entityIDs = [57];
    minimized = false;
    pos = [641.75, 159.0];
    size = [208.75, 146.0];
    title = "Mid Arm"
};
Scene.addWidget {
    widgetID = "SpringOptions";
    entityIDs = [59];
    minimized = false;
    pos = [962.75, 154.0];
    size = [208.75, 146.0];
    title = "bucket"
}
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial. Image
a Mammoth wrote:be boring and interesting.

Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
I didn't know you could go up 3.1.3! Thanks Mystery person!
User avatar
Dakta
 
Posts: 417
Joined: Sat Sep 12, 2009 4:36 pm

Re: Function Applied to non-Function?

Postby KarateBrot » Mon Nov 09, 2009 3:07 am

Search for
Code: Select all
Scene.my.checkMainArm := {scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin(?)({scene.my.mainArm = scene.my.mainArm - 0.01})}};

It's relatively near to the top.

now look at the second line of the code i posted. it says:

scene.my.mainArmMin(?)({scene.my.mainArm =

The red part is the mistake. sometimes this happens if you forget a bracket or you don't type in if statements correctly (that's what you did). if statements need to be typed in completely:

scene.my.blabla == 2 ? {do this} : { otherwise do this!!! }

Open the console and copy this corrected code in.
Code: Select all
Scene.my.checkMainArm := {scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm - 0.01} : {} }};


does it work now?
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Function Applied to non-Function?

Postby Dakta » Mon Nov 09, 2009 3:39 am

Nope... But it's not your fault. I think it's like the e.angvel problem. You can't read it directly from an object, or even send it from the object directly. In this case, I think it's that we can't reference scene.my.mainArmMin and scene.my.mainArmMax as variables to check against for some reason or another.

Here's the entire scene file as it stands now. The spring length can be adjusted with the 9 and 6 numpad keys, but when you go past the max (4.5) or below the in (2.5), nothing happens.

Open it up with Algodoo and see how it works out for you. Maybe the solution will be more obvious if you're looking at the whole picture, not just a few metaphorical pixels.

Code: Select all
// Algodoo scene created by Algodoo v1.6.0

FileInfo -> {
    title = "cat/scene";
    author = "Dakta";
    description = "Simple step up linear movement system.";
    version = 6
};
Sim -> {
    gravityAngleOffset = 0.0;
    gravityStrength = 9.8;
    gravitySwitch = true;
    airSwitch = true;
    airFrictionMultiplier = 1.0;
    airFrictionLinear = 0.01;
    airFrictionQuadratic = 0.0;
    rotFrictionLinear = 0.00314;
    airDensity = 0.01;
    timeFactor = 1.0
};
App -> {
    laserEvents = true;
    numColorsInRainbow = 12;
    laserSuperBoost = 1.0;
    laserResolution = 10.0;
    waterColor = [0.1, 0.1, 1.0, 0.7];
    fadeColor = [0.0, 0.0, 0.0]
};
App.GUI -> {drawHingesWhenRunning = true};
Scene -> {gravityRotationOffset = NaN};
SPH -> {
    vaporizeTime = +inf;
    viscosity = 0.0
};
Scene.my.mainArm := 3.0;
Scene.my.mainArmMax := 4.5;
Scene.my.checkMainArm := {scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm - 0.01} : {} }};
App.Grid -> {
    grid = false;
    base = 8;
    numAxes = 2;
    scale = 1.0;
    snap = true
};
App.GUI.Forces -> {
    normalText = "N";
    totalText = "";
    airFrictionText = "-fv";
    attraction = false;
    gravityText = "mg";
    airBuoyancyText = "-adg";
    airFriction = true;
    airBuoyancy = true;
    total = false;
    attractionText = "A";
    externalText = "ext";
    friction = true;
    drawValues = true;
    drawNames = true;
    external = true;
    normal = true;
    velScale = 1.0;
    frictionText = "T";
    springText = "-kx-bv";
    forceScale = 1.0;
    drawForces = false;
    gravity = true;
    contactCombinationDistance = 1.2;
    spring = true;
    velocities = false;
    frictionProjection = true;
    hingeText = "H";
    hinge = true
};
Scene.Camera -> {
    pan = [-7.2685437, 16.906424];
    rotation = 0.0;
    trackRotation = false;
    zoom = 76.299614
};
App.Background -> {
    cloudOpacity = 0.95;
    drawClouds = true;
    cuteClouds = true;
    skyColor = [0.45, 0.55, 1.0, 1.0]
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 10;
    zDepth = 0.0;
    geomID = 12;
    pos = [-1000.0, -0.0];
    angle = 0.0;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 11;
    zDepth = 1.0;
    geomID = 13;
    pos = [-0.0, -1000.0];
    angle = 1.5707964;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 12;
    zDepth = 2.0;
    geomID = 14;
    pos = [1000.0, 0.0];
    angle = -3.1415925;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 13;
    zDepth = 3.0;
    geomID = 15;
    pos = [-0.0, 1000.0];
    angle = -1.5707964;
    body = 0
};
Scene.addBox {
    color = [0.99468565, 0.8890118, 0.64002705, 1.0];
    collideSet = 2;
    entityID = 14;
    zDepth = 4.0;
    geomID = 16;
    pos = [-7.279367, 16.277395];
    angle = 0.0062836995;
    size = [0.13, 0.655]
};
Scene.addBox {
    color = [0.99468565, 0.8890118, 0.64002705, 1.0];
    collideSet = 2;
    entityID = 15;
    zDepth = 5.0;
    geomID = 17;
    pos = [-6.618398, 16.256378];
    angle = 0.006284141;
    size = [0.13, 0.655]
};
Scene.addBox {
    color = [0.04453665, 0.33847988, 0.78251296, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm + 0.01};
    entityID = 16;
    zDepth = 8.0;
    geomID = 18;
    pos = [-7.53688, 16.337406];
    angle = 0.0;
    body = 0;
    size = [0.125, 0.58]
};
Scene.addBox {
    color = [0.04453665, 0.33847988, 0.78251296, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm - 0.01};
    entityID = 17;
    zDepth = 9.0;
    geomID = 19;
    pos = [-6.8759165, 16.31639];
    angle = 0.0;
    body = 0;
    size = [0.125, 0.58]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    density = 0.001;
    entityID = 18;
    zDepth = 14.0;
    geomID = 20;
    pos = [-7.32908, 16.578503];
    angle = 3.0257144;
    size = [0.13999999, 0.01999998]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    onCollide = (e)=>{scene.my.checkMainArm};
    density = 0.001;
    entityID = 19;
    zDepth = 15.0;
    geomID = 21;
    pos = [-7.3237243, 16.80335];
    angle = 3.0257144;
    size = [0.13999999, 0.01999998]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    density = 0.001;
    entityID = 20;
    zDepth = 16.0;
    geomID = 22;
    pos = [-6.668116, 16.557486];
    angle = -3.061395;
    size = [0.13999999, 0.01999998]
};
Scene.addCircle {
    color = [0.497, 0.172, 0.262, 1.0];
    collideSet = 2;
    entityID = 21;
    zDepth = 20.0;
    geomID = 23;
    pos = [-7.4678006, 16.501793];
    angle = -1.4601413;
    body = 0;
    radius = 0.04
};
Scene.addCircle {
    color = [0.497, 0.172, 0.262, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm - 0.01};
    collideSet = 2;
    entityID = 22;
    zDepth = 21.0;
    geomID = 24;
    pos = [-6.8067026, 16.480583];
    angle = -1.4601413;
    body = 0;
    radius = 0.04
};
Scene.addPlane {
    immortal = true;
    texture = "/Users/dakota/Desktop/caterpillar-345c-l.gif";
    color = [1.0, 1.0, 1.0, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 23;
    zDepth = 24.0;
    geomID = 25;
    pos = [1006.2202, 2.9650154];
    angle = 3.1415925;
    body = 0
};
Scene.addBox {
    color = [1.0, 1.0, 1.0, 1.0];
    textureMatrix = [0.05, 0.0, 0.5, 0.0, 0.22321428, 0.5, 0.0, 0.0, 1.0];
    texture = "/Users/dakota/Desktop/caterpillar-345c-l.gif";
    collideSet = 0;
    entityID = 24;
    zDepth = 25.0;
    geomID = 26;
    pos = [-14.703304, 13.453465];
    angle = 0.0;
    body = 0;
    size = [20.0, 4.48]
};
Scene.addBox {
    color = [0.81588906, 0.8443649, 0.28744173, 1.0];
    heteroCollide = true;
    entityID = 26;
    zDepth = 26.0;
    geomID = 28;
    pos = [-11.982925, 14.534834];
    angle = -0.2617994;
    size = [5.4000006, 0.3800001]
};
Scene.addBox {
    color = [0.52515244, 0.14250004, 0.80997366, 1.0];
    onCollide = (e)=>{scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin(?)({scene.my.mainArm = scene.my.mainArm - 0.01})}};
    density = 0.001;
    entityID = 34;
    zDepth = 30.0;
    geomID = 36;
    pos = [-7.404401, 16.816591];
    angle = 0.0;
    body = 0;
    size = [0.11000013, 0.10499954]
};
Scene.addHinge {
    geom0 = 16;
    geom0pos = [0.009055257, -0.2681609];
    geom1 = 0;
    geom1pos = [-7.2686214, 16.009296];
    motorTorque = 1100.0;
    motorSpeed = 2.6;
    color = [0.49685076, 0.02263081, 0.9055634, 1.0];
    entityID = 35;
    zDepth = 6.0;
    size = 0.10901655;
    buttonBack = "[9]"
};
Scene.addHinge {
    geom0 = 17;
    geom0pos = [0.009055257, -0.2681609];
    geom1 = 0;
    geom1pos = [-6.607658, 15.98828];
    motorTorque = 1100.0;
    motorSpeed = 2.6;
    color = [0.49685076, 0.02263081, 0.9055634, 1.0];
    entityID = 36;
    zDepth = 7.0;
    size = 0.10901655;
    buttonBack = "[6]"
};
Scene.addFixjoint {
    geom0 = 18;
    geom0pos = [-0.011863351, -0.2540545];
    geom1 = 0;
    geom1pos = [-7.5487432, 16.083353];
    color = [0.71219754, 0.01439929, 0.95983756, 1.0];
    entityID = 37;
    zDepth = 10.0;
    size = 0.10901655
};
Scene.addFixjoint {
    geom0 = 19;
    geom0pos = [-0.011863351, -0.2540545];
    geom1 = 0;
    geom1pos = [-6.8877797, 16.062336];
    color = [0.71219754, 0.01439929, 0.95983756, 1.0];
    entityID = 38;
    zDepth = 11.0;
    size = 0.10901655
};
Scene.addSpring {
    geom0 = 16;
    geom0pos = [0.017281175, 0.29708445];
    geom1 = 0;
    geom1pos = [-7.0925784, 16.574543];
    color = [0.75225776, 0.80464685, 0.9723907, 1.0];
    constant = 17.029999;
    length = 0.16951829;
    legacyMode = 2;
    entityID = 39;
    zDepth = 12.0;
    size = 0.0719241
};
Scene.addSpring {
    geom0 = 17;
    geom0pos = [0.017281175, 0.29708445];
    geom1 = 0;
    geom1pos = [-6.431615, 16.553526];
    color = [0.75225776, 0.80464685, 0.9723907, 1.0];
    constant = 17.029999;
    length = 0.16951829;
    legacyMode = 2;
    entityID = 40;
    zDepth = 13.0;
    size = 0.0719241
};
Scene.addHinge {
    geom0 = 20;
    geom0pos = [0.0, 0.0];
    geom1 = 16;
    geom1pos = [-0.04782498, 0.30141366];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 41;
    zDepth = 17.0;
    size = 0.009851851
};
Scene.addHinge {
    geom0 = 21;
    geom0pos = [0.0, 0.0];
    geom1 = 0;
    geom1pos = [-7.3237286, 16.80335];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 42;
    zDepth = 18.0;
    size = 0.009851851
};
Scene.addHinge {
    geom0 = 22;
    geom0pos = [0.0, 0.0];
    geom1 = 17;
    geom1pos = [-0.04782498, 0.30141366];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 43;
    zDepth = 19.0;
    size = 0.009851851
};
Scene.addFixjoint {
    geom0 = 23;
    geom0pos = [0.0041577816, 0.01014483];
    geom1 = 0;
    geom1pos = [-7.4570813, 16.498438];
    color = [0.55598253, 0.05140382, 0.40813425, 1.0];
    entityID = 44;
    zDepth = 22.0;
    size = 0.050990567
};
Scene.addFixjoint {
    geom0 = 24;
    geom0pos = [0.0041577816, 0.01014483];
    geom1 = 0;
    geom1pos = [-6.796118, 16.47742];
    color = [0.55598253, 0.05140382, 0.40813425, 1.0];
    entityID = 45;
    zDepth = 23.0;
    size = 0.050990567
};
Scene.addHinge {
    geom0 = 28;
    geom0pos = [2.5067272, -0.04876995];
    geom1 = 26;
    geom1pos = [5.129072, 0.3854742];
    color = [0.27090865, 0.33888233, 0.628472, 1.0];
    entityID = 55;
    zDepth = 27.0;
    size = 0.49991745
};
Scene.addFixjoint {
    geom0 = 26;
    geom0pos = [-4.6896553, 1.6404991];
    geom1 = 0;
    geom1pos = [-19.39296, 15.093964];
    color = [0.38795352, 0.17214203, 0.22771586, 1.0];
    entityID = 56;
    zDepth = 28.0;
    size = 0.49991745
};
Scene.addSpring {
    geom0 = 28;
    geom0pos = [-1.309206, 0.12614441];
    geom1 = 26;
    geom1pos = [4.1627855, -0.22591782];
    color = [0.34739706, 0.019594371, 0.78728956, 1.0];
    dampingFactor = 2.0;
    constant = 20484.0;
    length = {scene.my.mainarm};
    legacyMode = 2;
    entityID = 58;
    zDepth = 29.0;
    size = 0.37886575
};
Scene.addFixjoint {
    geom0 = 36;
    geom0pos = [-0.027025223, 0.017532349];
    geom1 = 0;
    geom1pos = [-7.431426, 16.834124];
    color = [0.20650825, 0.32835644, 0.41002902, 1.0];
    entityID = 60;
    zDepth = 31.0;
    size = 0.04735837
};
Scene.addGroup {name = "selected"};
Scene.addWidget {
    widgetID = "SpringOptions";
    entityIDs = [58];
    minimized = false;
    pos = [365.75, 200.0];
    size = [208.75, 146.0];
    title = "Main Arm"
}
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial. Image
a Mammoth wrote:be boring and interesting.

Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
I didn't know you could go up 3.1.3! Thanks Mystery person!
User avatar
Dakta
 
Posts: 417
Joined: Sat Sep 12, 2009 4:36 pm

Re: Function Applied to non-Function?

Postby standardtoaster » Mon Nov 09, 2009 3:49 am

I found the problem with your scene. You haven't declared scene.my.mainArmMin! :lol:
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Function Applied to non-Function?

Postby Dakta » Mon Nov 09, 2009 4:26 am

I didn't? Really? You're kidding right? ...(checks the file... bangs his head into the table upsetting the coffee and spilling it all over his keyboard which is now sticky and totally ruined) Awe snap... you're right! Man, thanks a billion! You just saved my day!

Now, time to test this thing out...
Last edited by Dakta on Mon Nov 09, 2009 4:51 am, edited 1 time in total.
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial. Image
a Mammoth wrote:be boring and interesting.

Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
I didn't know you could go up 3.1.3! Thanks Mystery person!
User avatar
Dakta
 
Posts: 417
Joined: Sat Sep 12, 2009 4:36 pm

Re: Function Applied to non-Function?

Postby Dakta » Mon Nov 09, 2009 4:51 am

Well, everyone should be happy to know that the below scene works 100%!
Code: Select all
// Algodoo scene created by Algodoo v1.6.0

FileInfo -> {
    title = "cat/scene";
    author = "Dakta";
    description = "Simple step up linear movement system.";
    version = 6
};
Sim -> {
    gravityAngleOffset = 0.0;
    gravityStrength = 9.8;
    gravitySwitch = true;
    airSwitch = true;
    airFrictionMultiplier = 1.0;
    airFrictionLinear = 0.01;
    airFrictionQuadratic = 0.0;
    rotFrictionLinear = 0.00314;
    airDensity = 0.01;
    timeFactor = 1.0
};
App -> {
    laserEvents = true;
    numColorsInRainbow = 12;
    laserSuperBoost = 1.0;
    laserResolution = 10.0;
    waterColor = [0.1, 0.1, 1.0, 0.7];
    fadeColor = [0.0, 0.0, 0.0]
};
App.GUI -> {drawHingesWhenRunning = true};
Scene -> {gravityRotationOffset = NaN};
SPH -> {
    vaporizeTime = +inf;
    viscosity = 0.0
};
Scene.my.mainArm := 3.0;
Scene.my.mainArmMax := 4.5;
Scene.my.mainArmMin := 2.8;
Scene.my.checkMainArm := {scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMax ? {scene.my.mainArm = scene.my.mainArm - 0.01} : {} }};
App.Grid -> {
    grid = false;
    base = 8;
    numAxes = 2;
    scale = 1.0;
    snap = true
};
App.GUI.Forces -> {
    normalText = "N";
    totalText = "";
    airFrictionText = "-fv";
    attraction = false;
    gravityText = "mg";
    airBuoyancyText = "-adg";
    airFriction = true;
    airBuoyancy = true;
    total = false;
    attractionText = "A";
    externalText = "ext";
    friction = true;
    drawValues = true;
    drawNames = true;
    external = true;
    normal = true;
    velScale = 1.0;
    frictionText = "T";
    springText = "-kx-bv";
    forceScale = 1.0;
    drawForces = false;
    gravity = true;
    contactCombinationDistance = 1.2;
    spring = true;
    velocities = false;
    frictionProjection = true;
    hingeText = "H";
    hinge = true
};
Scene.Camera -> {
    pan = [-7.2685437, 16.906424];
    rotation = 0.0;
    trackRotation = false;
    zoom = 76.299614
};
App.Background -> {
    cloudOpacity = 0.95;
    drawClouds = true;
    cuteClouds = true;
    skyColor = [0.45, 0.55, 1.0, 1.0]
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 10;
    zDepth = 0.0;
    geomID = 12;
    pos = [-1000.0, -0.0];
    angle = 0.0;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 11;
    zDepth = 1.0;
    geomID = 13;
    pos = [-0.0, -1000.0];
    angle = 1.5707964;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 12;
    zDepth = 2.0;
    geomID = 14;
    pos = [1000.0, 0.0];
    angle = -3.1415925;
    body = 0
};
Scene.addPlane {
    immortal = true;
    color = [0.1, 0.1, 0.1, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 13;
    zDepth = 3.0;
    geomID = 15;
    pos = [-0.0, 1000.0];
    angle = -1.5707964;
    body = 0
};
Scene.addBox {
    color = [0.99468565, 0.8890118, 0.64002705, 1.0];
    collideSet = 2;
    entityID = 14;
    zDepth = 4.0;
    geomID = 16;
    pos = [-7.279367, 16.277395];
    angle = 0.0062836995;
    size = [0.13, 0.655]
};
Scene.addBox {
    color = [0.99468565, 0.8890118, 0.64002705, 1.0];
    collideSet = 2;
    entityID = 15;
    zDepth = 5.0;
    geomID = 17;
    pos = [-6.618398, 16.256378];
    angle = 0.006284141;
    size = [0.13, 0.655]
};
Scene.addBox {
    color = [0.04453665, 0.33847988, 0.78251296, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm + 0.01};
    entityID = 16;
    zDepth = 8.0;
    geomID = 18;
    pos = [-7.53688, 16.337406];
    angle = 0.0;
    body = 0;
    size = [0.125, 0.58]
};
Scene.addBox {
    color = [0.04453665, 0.33847988, 0.78251296, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm - 0.01};
    entityID = 17;
    zDepth = 9.0;
    geomID = 19;
    pos = [-6.8759165, 16.31639];
    angle = 0.0;
    body = 0;
    size = [0.125, 0.58]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    density = 0.001;
    entityID = 18;
    zDepth = 14.0;
    geomID = 20;
    pos = [-7.32908, 16.578503];
    angle = 3.0257144;
    size = [0.13999999, 0.01999998]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    onCollide = (e)=>{scene.my.checkMainArm};
    density = 0.001;
    entityID = 19;
    zDepth = 15.0;
    geomID = 21;
    pos = [-7.3237243, 16.80335];
    angle = 3.0257144;
    size = [0.13999999, 0.01999998]
};
Scene.addBox {
    color = [0.7441687, 0.88816524, 0.6963062, 1.0];
    density = 0.001;
    entityID = 20;
    zDepth = 16.0;
    geomID = 22;
    pos = [-6.668116, 16.557486];
    angle = -3.061395;
    size = [0.13999999, 0.01999998]
};
Scene.addCircle {
    color = [0.497, 0.172, 0.262, 1.0];
    collideSet = 2;
    entityID = 21;
    zDepth = 20.0;
    geomID = 23;
    pos = [-7.4678006, 16.501793];
    angle = -1.4601413;
    body = 0;
    radius = 0.04
};
Scene.addCircle {
    color = [0.497, 0.172, 0.262, 1.0];
    onCollide = (e)=>{scene.my.mainArm = scene.my.mainArm - 0.01};
    collideSet = 2;
    entityID = 22;
    zDepth = 21.0;
    geomID = 24;
    pos = [-6.8067026, 16.480583];
    angle = -1.4601413;
    body = 0;
    radius = 0.04
};
Scene.addPlane {
    immortal = true;
    texture = "/Users/dakota/Desktop/caterpillar-345c-l.gif";
    color = [1.0, 1.0, 1.0, 1.0];
    collideSet = 127;
    killer = true;
    entityID = 23;
    zDepth = 24.0;
    geomID = 25;
    pos = [1006.2202, 2.9650154];
    angle = 3.1415925;
    body = 0
};
Scene.addBox {
    color = [1.0, 1.0, 1.0, 1.0];
    textureMatrix = [0.05, 0.0, 0.5, 0.0, 0.22321428, 0.5, 0.0, 0.0, 1.0];
    texture = "/Users/dakota/Desktop/caterpillar-345c-l.gif";
    collideSet = 0;
    entityID = 24;
    zDepth = 25.0;
    geomID = 26;
    pos = [-14.703304, 13.453465];
    angle = 0.0;
    body = 0;
    size = [20.0, 4.48]
};
Scene.addBox {
    color = [0.81588906, 0.8443649, 0.28744173, 1.0];
    heteroCollide = true;
    entityID = 26;
    zDepth = 26.0;
    geomID = 28;
    pos = [-11.982925, 14.534834];
    angle = -0.2617994;
    size = [5.4000006, 0.3800001]
};
Scene.addBox {
    color = [0.52515244, 0.14250004, 0.80997366, 1.0];
    onCollide = (e)=>{scene.my.mainArm <= scene.my.mainArmMin ? {scene.my.mainArm = scene.my.mainArm + 0.01} : {scene.my.mainArm >= scene.my.mainArmMin(?)({scene.my.mainArm = scene.my.mainArm - 0.01})}};
    density = 0.001;
    entityID = 34;
    zDepth = 30.0;
    geomID = 36;
    pos = [-7.404401, 16.816591];
    angle = 0.0;
    body = 0;
    size = [0.11000013, 0.10499954]
};
Scene.addHinge {
    geom0 = 16;
    geom0pos = [0.009055257, -0.2681609];
    geom1 = 0;
    geom1pos = [-7.2686214, 16.009296];
    motorTorque = 1100.0;
    motorSpeed = 2.6;
    color = [0.49685076, 0.02263081, 0.9055634, 1.0];
    entityID = 35;
    zDepth = 6.0;
    size = 0.10901655;
    buttonBack = "[9]"
};
Scene.addHinge {
    geom0 = 17;
    geom0pos = [0.009055257, -0.2681609];
    geom1 = 0;
    geom1pos = [-6.607658, 15.98828];
    motorTorque = 1100.0;
    motorSpeed = 2.6;
    color = [0.49685076, 0.02263081, 0.9055634, 1.0];
    entityID = 36;
    zDepth = 7.0;
    size = 0.10901655;
    buttonBack = "[6]"
};
Scene.addFixjoint {
    geom0 = 18;
    geom0pos = [-0.011863351, -0.2540545];
    geom1 = 0;
    geom1pos = [-7.5487432, 16.083353];
    color = [0.71219754, 0.01439929, 0.95983756, 1.0];
    entityID = 37;
    zDepth = 10.0;
    size = 0.10901655
};
Scene.addFixjoint {
    geom0 = 19;
    geom0pos = [-0.011863351, -0.2540545];
    geom1 = 0;
    geom1pos = [-6.8877797, 16.062336];
    color = [0.71219754, 0.01439929, 0.95983756, 1.0];
    entityID = 38;
    zDepth = 11.0;
    size = 0.10901655
};
Scene.addSpring {
    geom0 = 16;
    geom0pos = [0.017281175, 0.29708445];
    geom1 = 0;
    geom1pos = [-7.0925784, 16.574543];
    color = [0.75225776, 0.80464685, 0.9723907, 1.0];
    constant = 17.029999;
    length = 0.16951829;
    legacyMode = 2;
    entityID = 39;
    zDepth = 12.0;
    size = 0.0719241
};
Scene.addSpring {
    geom0 = 17;
    geom0pos = [0.017281175, 0.29708445];
    geom1 = 0;
    geom1pos = [-6.431615, 16.553526];
    color = [0.75225776, 0.80464685, 0.9723907, 1.0];
    constant = 17.029999;
    length = 0.16951829;
    legacyMode = 2;
    entityID = 40;
    zDepth = 13.0;
    size = 0.0719241
};
Scene.addHinge {
    geom0 = 20;
    geom0pos = [0.0, 0.0];
    geom1 = 16;
    geom1pos = [-0.04782498, 0.30141366];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 41;
    zDepth = 17.0;
    size = 0.009851851
};
Scene.addHinge {
    geom0 = 21;
    geom0pos = [0.0, 0.0];
    geom1 = 0;
    geom1pos = [-7.3237286, 16.80335];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 42;
    zDepth = 18.0;
    size = 0.009851851
};
Scene.addHinge {
    geom0 = 22;
    geom0pos = [0.0, 0.0];
    geom1 = 17;
    geom1pos = [-0.04782498, 0.30141366];
    motorTorque = +inf;
    motor = true;
    motorSpeed = 62.831856;
    color = [0.5126682, 0.0029171705, 0.03677943, 1.0];
    entityID = 43;
    zDepth = 19.0;
    size = 0.009851851
};
Scene.addFixjoint {
    geom0 = 23;
    geom0pos = [0.0041577816, 0.01014483];
    geom1 = 0;
    geom1pos = [-7.4570813, 16.498438];
    color = [0.55598253, 0.05140382, 0.40813425, 1.0];
    entityID = 44;
    zDepth = 22.0;
    size = 0.050990567
};
Scene.addFixjoint {
    geom0 = 24;
    geom0pos = [0.0041577816, 0.01014483];
    geom1 = 0;
    geom1pos = [-6.796118, 16.47742];
    color = [0.55598253, 0.05140382, 0.40813425, 1.0];
    entityID = 45;
    zDepth = 23.0;
    size = 0.050990567
};
Scene.addHinge {
    geom0 = 28;
    geom0pos = [2.5067272, -0.04876995];
    geom1 = 26;
    geom1pos = [5.129072, 0.3854742];
    color = [0.27090865, 0.33888233, 0.628472, 1.0];
    entityID = 55;
    zDepth = 27.0;
    size = 0.49991745
};
Scene.addFixjoint {
    geom0 = 26;
    geom0pos = [-4.6896553, 1.6404991];
    geom1 = 0;
    geom1pos = [-19.39296, 15.093964];
    color = [0.38795352, 0.17214203, 0.22771586, 1.0];
    entityID = 56;
    zDepth = 28.0;
    size = 0.49991745
};
Scene.addSpring {
    geom0 = 28;
    geom0pos = [-1.309206, 0.12614441];
    geom1 = 26;
    geom1pos = [4.1627855, -0.22591782];
    color = [0.34739706, 0.019594371, 0.78728956, 1.0];
    dampingFactor = 2.0;
    constant = 20484.0;
    length = {scene.my.mainarm};
    legacyMode = 2;
    entityID = 58;
    zDepth = 29.0;
    size = 0.37886575
};
Scene.addFixjoint {
    geom0 = 36;
    geom0pos = [-0.027025223, 0.017532349];
    geom1 = 0;
    geom1pos = [-7.431426, 16.834124];
    color = [0.20650825, 0.32835644, 0.41002902, 1.0];
    entityID = 60;
    zDepth = 31.0;
    size = 0.04735837
};
Scene.addGroup {name = "selected"};
Scene.addWidget {
    widgetID = "SpringOptions";
    entityIDs = [58];
    minimized = false;
    pos = [365.75, 200.0];
    size = [208.75, 146.0];
    title = "Main Arm"
}
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial. Image
a Mammoth wrote:be boring and interesting.

Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
I didn't know you could go up 3.1.3! Thanks Mystery person!
User avatar
Dakta
 
Posts: 417
Joined: Sat Sep 12, 2009 4:36 pm

Re: Function Applied to non-Function?

Postby KarateBrot » Mon Nov 09, 2009 1:09 pm

Yeah finally :thumbup:
Ok, that's why your code got screwed up at the point I corrected. standardtoaster ftw, I woudn't have noticed the declaration miss :D
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 8 guests