Coding Field
-
Can there be another field that won't have to function on a certain event? i ran into this when i was building an arm, which had a receiver that calculated and processed everything, but the ontouch and ontick fields require an event to trigger them. Can there be a simple field for code like: if getVar('sens')==1 then setVar('claw',0.6);end
if a==1 then setVar('claw',0);end? -
...ontick does it fine, but there can't be 2 ends, one should be elsif.
-
Actually there can be as many ends as you want. But in this case, there could be a conflict, so you may as well use elsif. Also, onTick works fine and doesn't need an event to trigger it; it's a 'frame' event, occuring every frame or every rate frame. Next version there should be global script, which'd be perfect for this.
-
if getVar('sens')==1 then setVar('claw',0.6);elseif joybutton("a")==1 then setVar("claw",0);end;
-
I think thats it...
-
You don't need the first 'then'... but yeah
-
the second time you use setVar("claw"), should be getSetVar.
-
If it's going in onTick, what's the point?
-
yeah, you're right
Advertisement