instinct/GameFroot — Issue #295: Robot editor x velocity = 0 error
Author: thornyd
Created: 2012-02-17 00:31:27+00:00
State: open
Labels: RobotEditor

I created a robot that sends a message to itself to set x velocity to zero if its facing away from the player, but when I update the workspace through the view source window, it removes all slots underneath the set velocity slot and changes the value to blank.
Here are before and after screenshots and underneath is the source code.

http://i42.tinypic.com/157kuf9.png

http://i44.tinypic.com/30jiljt.png

http://i40.tinypic.com/2eyaoes.png

http://i44.tinypic.com/316qkoz.png

{
"robot": "0.9",
"properties": {
"displayName": "Unnamed Robot",
"description": "Describe your robot here.",
"health": "100",
"maxhealth": "100",
"immortal": true,
"solid": true,
"physics": true,
"name": "Unnamed-Robot"
},
"behavior": [
{
"event": "onSpawn",
"__eventsheet": {
"position": {
"top": 140,
"left": 163
}
},
"commands": [
{
"action": "messageSelf",
"message": "facin"
}
]
},
{
"event": "onMessage",
"__eventsheet": {
"position": {
"top": 108,
"left": 477
}
},
"commands": [
{
"action": "ifElse",
"condition": {
"token": "faceObject",
"objinstance": {
"token": "player"
}
},
"onTrue": [
{
"action": "changeXvelocity",
"delta": 1
}
],
"onFalse": [
{
"action": "messageSelf",
"message": "facin away"
}
]
},
{
"action": "messageSelfAfterDelay",
"message": "facin",
"delay": 1000
}
],
"messageName": "facin"
},
{
"event": "onMessage",
"__eventsheet": {
"position": {
"top": 146,
"left": 849
}
},
"commands": [
{
"action": "setXvelocity",
"velocity": 0
},
{
"action": "faceObject",
"objinstance": {
"token": "player"
}
},
{
"action": "messageSelfAfterDelay",
"message": "facin",
"delay": 1000
}
],
"messageName": "facin away"
}
],
"variables": {},
"kinds": {}
}