Skip to content

Instantly share code, notes, and snippets.

@cha0s
Created August 18, 2012 19:01
Show Gist options
  • Save cha0s/3389049 to your computer and use it in GitHub Desktop.
Save cha0s/3389049 to your computer and use it in GitHub Desktop.
{
"traits": [
{
"type": "Existence"
},
{
"type": "Interactive",
"state": {
"rule": {
"name": "Interaction rule",
"C": [
"and",
{
"C": [
"is",
{
"I": [
"main-entity:direction",
[]
]
},
{
"I": [
"main-entity:directionToward",
[
{
"I": [
"entity:self",
[]
]
}
]
]
}
]
},
{
"C": [
"<",
{
"I": [
"entity:location:cartesianDistance",
[
{
"I": [
"main-entity:location",
[]
]
}
]
]
},
{
"V": [
50
]
}
]
}
],
"A": [
{
"I": [
"entity:setRoutine",
[
{
"V": [
"interact"
]
},
{
"V": [
0
]
}
]
]
}
]
}
}
},
{
"type": "Combatant"
},
{
"type": "Physical"
},
{
"type": "Mobility",
"state": {
"movingSpeed": 50
}
},
{
"type": "Visibility",
"state": {
"animations": {
"environment-initial": {
"offset": [
12,
22
]
},
"environment-moving": {
"offset": [
12,
22
]
}
}
}
},
{
"type": "Behavior",
"state": {
"rules": [
{
"name": "Become curious when main entity approaches",
"C": [
"and",
{
"C": [
"isnt",
{
"I": [
"entity:currentRoutineIndex"
]
},
{
"V": [
"interact"
]
}
]
},
{
"C": [
"<",
{
"I": [
"entity:location:cartesianDistance",
[
{
"I": [
"main-entity:location"
]
}
]
]
},
{
"V": [
50
]
}
]
}
],
"A": [
{
"I": [
"entity:setRoutine",
[
{
"V": [
"curious"
]
},
{
"V": [
0
]
}
]
]
},
{
"I": [
"entity:signal",
[
{
"V": [
"becameIdle"
]
}
]
]
}
]
},
{
"name": "Wander when main entity departs",
"C": [
"and",
{
"C": [
">",
{
"I": [
"entity:location:cartesianDistance",
[
{
"I": [
"main-entity:location"
]
}
]
]
},
{
"V": [
70
]
}
]
}
],
"A": [
{
"I": [
"entity:setRoutine",
[
{
"V": [
"wandering"
]
},
{
"V": [
0
]
}
]
]
}
]
}
],
"routines": [
{
"name": "wandering",
"actions": [
{
"I": [
"entity:setDirection",
[
{
"I": [
"global:randomNumber",
[
{
"V": [
0
]
},
{
"V": [
3
]
}
]
]
}
]
]
},
{
"I": [
"entity:moveForward",
[
{
"V": [
20
]
},
{
"V": [
30
]
}
]
]
},
{
"I": [
"entity:waitTime",
[
{
"V": [
250
]
},
{
"V": [
500
]
}
]
]
}
]
},
{
"name": "curious",
"actions": [
{
"I": [
"entity:setDirection",
[
{
"I": [
"entity:directionToward",
[
{
"I": [
"main-entity:self",
[]
]
}
]
]
}
]
]
}
]
},
{
"name": "interact",
"actions": [
{
"I": [
"entity:startDialogue",
[
{
"V": [
"default"
]
}
]
]
},
{
"I": [
"entity:setRoutine",
[
{
"V": [
"curious"
]
},
{
"V": [
0
]
}
]
]
}
]
}
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment