FILES ----- dungeon_worlds.config instance_worlds.config behaviors\npc\combat.behavior behaviors\npc\npcblink.behavior behaviors\npc\play.behavior behaviors\npc\sleep.behavior [NEW] dungeons\other\challengetrials\fire\challengetrials_fire.dungeon [NEW] dungeons\other\challengetrials\fire\endchamber_left.json [NEW] dungeons\other\challengetrials\fire\endchamber_right.json [NEW] dungeons\other\challengetrials\fire\entrance_left.json [NEW] dungeons\other\challengetrials\fire\entrance_right.json [NEW] dungeons\other\challengetrials\fire\room1_lavapit.json [NEW] dungeons\other\challengetrials\template\challengetrials.dungeon [NEW] dungeons\other\challengetrials\template\endchamber_left.json [NEW] dungeons\other\challengetrials\template\endchamber_right.json [NEW] dungeons\other\challengetrials\template\entrance_left.json [NEW] dungeons\other\challengetrials\template\entrance_right.json [NEW] dungeons\other\challengetrials\template\room1_waterpit.json monsters\monster.lua npcs\bmain.lua scripts\behavior.lua scripts\actions\movement.lua scripts\actions\reaction.lua scripts\behavior\bdata.lua DIFFS ----- dungeon_worlds.config 213a214,239 > "challengetrials" : { > "primaryDungeon" : "challengetrials", > "threatLevel" : 7, > "gravity" : 80, > "worldSize" : [2000, 2000], > "dungeonBaseHeight" : 1000, > "dungeonSurfaceHeight" : 810, > "ambientLightLevel" : [32, 32, 32], > "ambientNoises" : "/sfx/environmental/space_loop4.ogg", > "musicTrack" : "/music/event-horizon.ogg", > "environmentStatusEffects" : ["dontstarve"] > }, > > "challengetrials_fire" : { > "primaryDungeon" : "challengetrials_fire", > "threatLevel" : 7, > "gravity" : 80, > "worldSize" : [2000, 2000], > "dungeonBaseHeight" : 1000, > "dungeonSurfaceHeight" : 810, > "ambientLightLevel" : [32, 32, 32], > "ambientNoises" : "/sfx/environmental/space_loop4.ogg", > "musicTrack" : "/music/scorian-flow.ogg", > "environmentStatusEffects" : ["dontstarve"] > }, > instance_worlds.config 733a734,793 > "challengetrials" : { > "type" : "FloatingDungeon", > "dungeonWorld" : "challengetrials", > "spawningEnabled" : false, > "beamUpRule" : "AnywhereWithWarning", > "disableDeathDrops" : true, > > "skyParameters" : { > "dayLength" : 10000, > "surfaceLevel" : 1000, > "spaceLevel" : 3000, > "seed" : -5288806180628666923, > > "skyType" : "barren", > "skyColoring" : { > "mainColor" : [200, 200, 255], > > "morningColors" : [[200, 200, 255], [200, 200, 255]], > "dayColors" : [[200, 200, 255], [200, 200, 255]], > "eveningColors" : [[200, 200, 255], [200, 200, 255]], > "nightColors" : [[200, 200, 255], [200, 200, 255]], > > "morningLightColor" : [200, 200, 200], > "dayLightColor" : [200, 200, 200], > "eveningLightColor" : [200, 200, 200], > "nightLightColor" : [200, 200, 200] > } > } > }, > > "challengetrials_fire" : { > "type" : "FloatingDungeon", > "dungeonWorld" : "challengetrials_fire", > "spawningEnabled" : false, > "beamUpRule" : "AnywhereWithWarning", > "disableDeathDrops" : true, > > "skyParameters" : { > "dayLength" : 10000, > "surfaceLevel" : 1000, > "spaceLevel" : 3000, > "seed" : -5288806180628666923, > > "skyType" : "barren", > "skyColoring" : { > "mainColor" : [200, 200, 255], > > "morningColors" : [[200, 200, 255], [200, 200, 255]], > "dayColors" : [[200, 200, 255], [200, 200, 255]], > "eveningColors" : [[200, 200, 255], [200, 200, 255]], > "nightColors" : [[200, 200, 255], [200, 200, 255]], > > "morningLightColor" : [200, 200, 200], > "dayLightColor" : [200, 200, 200], > "eveningLightColor" : [200, 200, 200], > "nightLightColor" : [200, 200, 200] > } > } > }, > behaviors\npc\combat.behavior 8,9c8 < "/scripts/behavior.lua", < "/scripts/behavior/bdata.lua" --- > "/scripts/behavior.lua" 103,105c102,104 < "title": "group", < "type": "action", < "name": "group", --- > "title": "sequence", > "type": "composite", > "name": "sequence", 107,114c106,151 < "behavior": "combatcoordinator", < "goal": "target", < "goalType": "entity", < "groupId": "combat", < "maxMembers": 8, < "minMembers": 1, < "parameters": "" < } --- > "type": "sliding", > "state": "off", > "fromEntity": "attackTarget", > "toEntity": "fleeTarget" > }, > "children": [ > { > "title": "group", > "type": "action", > "name": "group", > "parameters": { > "behavior": "combatcoordinator", > "goal": "target", > "goalType": "entity", > "groupId": "combat", > "maxMembers": 8, > "minMembers": 1, > "parameters": "" > } > }, > { > "title": "isValidTarget", > "type": "action", > "name": "isValidTarget", > "parameters": { > "entity": "target" > } > }, > { > "title": "controlEntity", > "type": "action", > "name": "controlEntity", > "parameters": { > "entity": "target" > }, > "output": { > "entity": "combatTarget" > } > }, > { > "title": "controlAggressive", > "type": "action", > "name": "controlAggressive", > "parameters": {} > } > ] 117c154 < "title": "cleanup", --- > "title": "parallel", 119,120c156,160 < "name": "cleanup", < "parameters": {}, --- > "name": "parallel", > "parameters": { > "fail": -1, > "success": -1 > }, 132c172 < "title": "isValidTarget", --- > "title": "hasShield", 134,137c174,175 < "name": "isValidTarget", < "parameters": { < "entity": "target" < } --- > "name": "hasShield", > "parameters": {} 140c178 < "title": "setEntity", --- > "title": "altFire", 142,148c180,181 < "name": "setEntity", < "parameters": { < "entity": "target" < }, < "output": { < "entity": "combatTarget" < } --- > "name": "altFire", > "parameters": {} 151c184 < "title": "controlAggressive", --- > "title": "runner", 153c186 < "name": "controlAggressive", --- > "name": "runner", 155c188,196 < }, --- > } > ] > }, > { > "title": "dynamic", > "type": "composite", > "name": "dynamic", > "parameters": {}, > "children": [ 161c202 < "fail": -1, --- > "fail": 1, 166,192c207,210 < "title": "parallel", < "type": "composite", < "name": "parallel", < "parameters": { < "fail": 1, < "success": -1 < }, < "children": [ < { < "title": "hasShield", < "type": "action", < "name": "hasShield", < "parameters": {} < }, < { < "title": "altFire", < "type": "action", < "name": "altFire", < "parameters": {} < }, < { < "title": "runner", < "type": "action", < "name": "runner", < "parameters": {} < } < ] --- > "title": "hasMeleePrimary", > "type": "action", > "name": "hasMeleePrimary", > "parameters": {} 195,253c213,227 < "title": "dynamic", < "type": "composite", < "name": "dynamic", < "parameters": {}, < "children": [ < { < "title": "parallel", < "type": "composite", < "name": "parallel", < "parameters": { < "fail": 1, < "success": -1 < }, < "children": [ < { < "title": "hasMeleePrimary", < "type": "action", < "name": "hasMeleePrimary", < "parameters": {} < }, < { < "title": "cooldown", < "type": "decorator", < "name": "cooldown", < "parameters": { < "cooldown": 2, < "onFail": true, < "onSuccess": false < }, < "child": { < "title": "parallel", < "type": "composite", < "name": "parallel", < "parameters": { < "fail": 1, < "success": -1 < }, < "children": [ < { < "title": "task", < "type": "action", < "name": "task", < "parameters": { < "groupId": "combat", < "taskId": "melee", < "minMembers": 1, < "maxMembers": 8 < } < }, < { < "title": "NPC Melee", < "type": "module", < "name": "meleecombat", < "parameters": {} < } < ] < } < } < ] --- > "title": "cooldown", > "type": "decorator", > "name": "cooldown", > "parameters": { > "cooldown": 2, > "onFail": true, > "onSuccess": false > }, > "child": { > "title": "parallel", > "type": "composite", > "name": "parallel", > "parameters": { > "fail": 1, > "success": -1 255,285c229,238 < { < "title": "parallel", < "type": "composite", < "name": "parallel", < "parameters": { < "fail": 1, < "success": -1 < }, < "children": [ < { < "title": "hasRangedPrimary", < "type": "action", < "name": "hasRangedPrimary", < "parameters": {} < }, < { < "title": "task", < "type": "action", < "name": "task", < "parameters": { < "groupId": "combat", < "taskId": "ranged", < "minMembers": 1, < "maxMembers": 8 < } < }, < { < "title": "NPC Ranged", < "type": "module", < "name": "rangedcombat", < "parameters": {} --- > "children": [ > { > "title": "task", > "type": "action", > "name": "task", > "parameters": { > "groupId": "combat", > "taskId": "melee", > "minMembers": 1, > "maxMembers": 8 287,294d239 < ] < }, < { < "title": "optional", < "type": "decorator", < "name": "optional", < "parameters": { < "shouldRun": "" 296,328c241,245 < "child": { < "title": "parallel", < "type": "composite", < "name": "parallel", < "parameters": { < "fail": 1, < "success": -1 < }, < "children": [ < { < "title": "hasMeleePrimary", < "type": "action", < "name": "hasMeleePrimary", < "parameters": {} < }, < { < "title": "task", < "type": "action", < "name": "task", < "parameters": { < "groupId": "combat", < "taskId": "meleeStandby", < "minMembers": 1, < "maxMembers": 8 < } < }, < { < "title": "NPC Melee Standby", < "type": "module", < "name": "meleestandby", < "parameters": {} < } < ] --- > { > "title": "NPC Melee", > "type": "module", > "name": "meleecombat", > "parameters": {} 330,337c247,248 < }, < { < "title": "runner", < "type": "action", < "name": "runner", < "parameters": {} < } < ] --- > ] > } 339a251,332 > }, > { > "title": "parallel", > "type": "composite", > "name": "parallel", > "parameters": { > "fail": 1, > "success": -1 > }, > "children": [ > { > "title": "hasRangedPrimary", > "type": "action", > "name": "hasRangedPrimary", > "parameters": {} > }, > { > "title": "task", > "type": "action", > "name": "task", > "parameters": { > "groupId": "combat", > "taskId": "ranged", > "minMembers": 1, > "maxMembers": 8 > } > }, > { > "title": "NPC Ranged", > "type": "module", > "name": "rangedcombat", > "parameters": {} > } > ] > }, > { > "title": "optional", > "type": "decorator", > "name": "optional", > "parameters": { > "shouldRun": "" > }, > "child": { > "title": "parallel", > "type": "composite", > "name": "parallel", > "parameters": { > "fail": 1, > "success": -1 > }, > "children": [ > { > "title": "hasMeleePrimary", > "type": "action", > "name": "hasMeleePrimary", > "parameters": {} > }, > { > "title": "task", > "type": "action", > "name": "task", > "parameters": { > "groupId": "combat", > "taskId": "meleeStandby", > "minMembers": 1, > "maxMembers": 8 > } > }, > { > "title": "NPC Melee Standby", > "type": "module", > "name": "meleestandby", > "parameters": {} > } > ] > } > }, > { > "title": "runner", > "type": "action", > "name": "runner", > "parameters": {} 342,350d334 < }, < { < "title": "unset", < "type": "action", < "name": "unset", < "parameters": { < "type": "entity", < "key": "combatTarget" < } behaviors\npc\npcblink.behavior 37,126c37,92 < "title": "cleanup", < "type": "composite", < "name": "cleanup", < "parameters": {}, < "children": [ < { < "title": "sequence", < "type": "composite", < "name": "sequence", < "parameters": { < "type": "sliding", < "state": "off", < "fromEntity": "attackTarget", < "toEntity": "fleeTarget" < }, < "children": [ < { < "title": "addEphemeralEffect", < "type": "action", < "name": "addEphemeralEffect", < "parameters": { < "name": "camouflage0", < "duration": 1 < } < }, < { < "title": "addEphemeralEffect", < "type": "action", < "name": "addEphemeralEffect", < "parameters": { < "name": "blinkout" < } < }, < { < "title": "timer", < "type": "action", < "name": "timer", < "parameters": { < "time": 0.5 < } < }, < { < "title": "setPosition", < "type": "action", < "name": "setPosition", < "parameters": { < "footPosition": false, < "position": "targetPosition" < } < }, < { < "title": "timer", < "type": "action", < "name": "timer", < "parameters": { < "time": 0.25 < } < } < ] < }, < { < "title": "sequence", < "type": "composite", < "name": "sequence", < "parameters": { < "type": "sliding", < "state": "off", < "fromEntity": "attackTarget", < "toEntity": "fleeTarget" < }, < "children": [ < { < "title": "removeEphemeralEffect", < "type": "action", < "name": "removeEphemeralEffect", < "parameters": { < "name": "camouflage0" < } < }, < { < "title": "addEphemeralEffect", < "type": "action", < "name": "addEphemeralEffect", < "parameters": { < "name": "blinkin" < } < } < ] < } < ] --- > "title": "addEphemeralEffect", > "type": "action", > "name": "addEphemeralEffect", > "parameters": { > "name": "camouflage0", > "duration": 1 > } > }, > { > "title": "addEphemeralEffect", > "type": "action", > "name": "addEphemeralEffect", > "parameters": { > "name": "blinkout" > } > }, > { > "title": "timer", > "type": "action", > "name": "timer", > "parameters": { > "time": 0.5 > } > }, > { > "title": "setPosition", > "type": "action", > "name": "setPosition", > "parameters": { > "footPosition": false, > "position": "targetPosition" > } > }, > { > "title": "timer", > "type": "action", > "name": "timer", > "parameters": { > "time": 0.25 > } > }, > { > "title": "removeEphemeralEffect", > "type": "action", > "name": "removeEphemeralEffect", > "parameters": { > "name": "camouflage0" > } > }, > { > "title": "addEphemeralEffect", > "type": "action", > "name": "addEphemeralEffect", > "parameters": { > "name": "blinkin" > } behaviors\npc\play.behavior 291c291 < "title": "cleanup", --- > "title": "parallel", 293,294c293,297 < "name": "cleanup", < "parameters": {}, --- > "name": "parallel", > "parameters": { > "fail": 1, > "success": 1 > }, 296a300,310 > "title": "npcToyPlay", > "type": "action", > "name": "npcToyPlay", > "parameters": { > "entity": "playTarget" > }, > "output": { > "influences": "influences" > } > }, > { 308,326d321 < "title": "npcToyPlay", < "type": "action", < "name": "npcToyPlay", < "parameters": { < "entity": "playTarget" < } < }, < { < "title": "npcToyInfluence", < "type": "action", < "name": "npcToyInfluence", < "parameters": { < "target": "playTarget" < }, < "output": { < "list": "influences" < } < }, < { 389,396d383 < }, < { < "title": "npcToyEndPlay", < "type": "action", < "name": "npcToyEndPlay", < "parameters": { < "entity": "playTarget" < } behaviors\npc\sleep.behavior 5d4 < "/scripts/behavior.lua", 6a6 > "/scripts/behavior.lua", 21c21 < "title": "cleanup", --- > "title": "Sleep", 23c23 < "name": "cleanup", --- > "name": "sequence", 27d26 < "title": "setFlag", 29c28 < "name": "setFlag", --- > "name": "findLoungable", 31c30,35 < "name": "nochat" --- > "position": "spawn", > "range": 50, > "orientation": "lay" > }, > "output": { > "entity": "bed" 35c39 < "title": "Sleep", --- > "title": "", 37,38c41,45 < "name": "sequence", < "parameters": {}, --- > "name": "parallel", > "parameters": { > "fail": 1, > "success": -1 > }, 40a48 > "title": "controlFlag", 42,64c50 < "name": "findLoungable", < "parameters": { < "position": "spawn", < "range": 50, < "orientation": "lay" < }, < "output": { < "entity": "bed" < } < }, < { < "type": "action", < "name": "entityPosition", < "parameters": { < "entity": "bed" < }, < "output": { < "position": "bed" < } < }, < { < "type": "action", < "name": "groundPosition", --- > "name": "controlFlag", 66,69c52 < "position": "bed" < }, < "output": { < "position": "bed" --- > "name": "nochat" 73c56 < "title": "", --- > "title": "Sleep", 75,79c58,59 < "name": "parallel", < "parameters": { < "fail": 1, < "success": -1 < }, --- > "name": "sequence", > "parameters": {}, 83c63 < "name": "moveToPosition", --- > "name": "entityPosition", 85c65 < "position": "bed" --- > "entity": "bed" 88c68 < "direction": "direction" --- > "position": "bed" 92d71 < "title": "faceDirection", 94c73 < "name": "faceDirection", --- > "name": "groundPosition", 96c75,78 < "direction": "direction" --- > "position": "bed" > }, > "output": { > "position": "bed" 100,102c82,84 < "title": "entityExists", < "type": "action", < "name": "entityExists", --- > "title": "", > "type": "composite", > "name": "parallel", 104,115c86,126 < "entity": "bed" < } < }, < { < "type": "decorator", < "name": "inverter", < "parameters": {}, < "child": { < "type": "action", < "name": "loungableOccupied", < "parameters": { < "entity": "bed" --- > "fail": 1, > "success": -1 > }, > "children": [ > { > "type": "action", > "name": "moveToPosition", > "parameters": { > "position": "bed" > }, > "output": { > "direction": "direction" > } > }, > { > "title": "faceDirection", > "type": "action", > "name": "faceDirection", > "parameters": { > "direction": "direction" > } > }, > { > "title": "entityExists", > "type": "action", > "name": "entityExists", > "parameters": { > "entity": "bed" > } > }, > { > "type": "decorator", > "name": "inverter", > "parameters": {}, > "child": { > "type": "action", > "name": "loungableOccupied", > "parameters": { > "entity": "bed" > } > } 117,144c128 < } < } < ] < }, < { < "title": "", < "type": "composite", < "name": "parallel", < "parameters": { < "fail": 1, < "success": -1 < }, < "children": [ < { < "title": "entityExists", < "type": "action", < "name": "entityExists", < "parameters": { < "entity": "bed" < } < }, < { < "title": "lounge", < "type": "action", < "name": "lounge", < "parameters": { < "entity": "bed" < } --- > ] 147c131 < "title": "dynamic", --- > "title": "", 149,150c133,137 < "name": "dynamic", < "parameters": {}, --- > "name": "parallel", > "parameters": { > "fail": 1, > "success": -1 > }, 153c140 < "title": "", --- > "title": "entityExists", 155c142 < "name": "withinTimeRange", --- > "name": "entityExists", 157c144 < "range": "" --- > "entity": "bed" 161,163c148,158 < "title": "failer", < "type": "decorator", < "name": "failer", --- > "title": "lounge", > "type": "action", > "name": "lounge", > "parameters": { > "entity": "bed" > } > }, > { > "title": "dynamic", > "type": "composite", > "name": "dynamic", 165,177c160,164 < "child": { < "title": "cooldown", < "type": "decorator", < "name": "cooldown", < "parameters": { < "cooldown": 30, < "onFail": true, < "onSuccess": true < }, < "child": { < "title": "sequence", < "type": "composite", < "name": "sequence", --- > "children": [ > { > "title": "", > "type": "action", > "name": "withinTimeRange", 179,194c166,181 < "type": "sliding", < "state": "off", < "fromEntity": "attackTarget", < "toEntity": "fleeTarget" < }, < "children": [ < { < "title": "setInfluence", < "type": "action", < "name": "setInfluence", < "parameters": { < "influence": "sleep" < }, < "output": { < "influence": "sleep" < } --- > "range": "" > } > }, > { > "title": "failer", > "type": "decorator", > "name": "failer", > "parameters": {}, > "child": { > "title": "cooldown", > "type": "decorator", > "name": "cooldown", > "parameters": { > "cooldown": 30, > "onFail": true, > "onSuccess": true 196,199c183,186 < { < "title": "chooseReaction", < "type": "action", < "name": "chooseReaction", --- > "child": { > "title": "sequence", > "type": "composite", > "name": "sequence", 201c188,191 < "influence": "sleep" --- > "type": "sliding", > "state": "off", > "fromEntity": "attackTarget", > "toEntity": "fleeTarget" 203,213c193,224 < "output": { < "reaction": "sleepReaction" < } < }, < { < "title": "playSimpleReaction", < "type": "action", < "name": "playSimpleReaction", < "parameters": { < "reaction": "sleepReaction" < } --- > "children": [ > { > "title": "setInfluence", > "type": "action", > "name": "setInfluence", > "parameters": { > "influence": "sleep" > }, > "output": { > "influence": "sleep" > } > }, > { > "title": "chooseReaction", > "type": "action", > "name": "chooseReaction", > "parameters": { > "influence": "sleep" > }, > "output": { > "reaction": "sleepReaction" > } > }, > { > "title": "playSimpleReaction", > "type": "action", > "name": "playSimpleReaction", > "parameters": { > "reaction": "sleepReaction" > } > } > ] 215c226,232 < ] --- > } > }, > { > "title": "runner", > "type": "action", > "name": "runner", > "parameters": {} 217,223c234 < } < }, < { < "title": "runner", < "type": "action", < "name": "runner", < "parameters": {} --- > ] 230,237d240 < }, < { < "title": "unsetFlag", < "type": "action", < "name": "unsetFlag", < "parameters": { < "name": "nochat" < } monsters\monster.lua 9a10 > require "/scripts/actions/movement.lua" 131a133 > self.moving = false 133a136 > BData:clearControls() 142a146,147 > BData:update() > 154c159 < runWorkers() --- > movement() npcs\bmain.lua 7a8 > require "/scripts/actions/movement.lua" 151a153,154 > self.playing = false > self.moving = false 152a156 > BData:clearControls() 179a184,189 > if not self.playing and self.playTarget then > world.callScriptedEntity(self.playTarget, "npcToy.notifyNpcPlayEnd", entity.id()) > self.playTarget = nil > end > > BData:update() 188c198 < runWorkers() --- > movement() scripts\behavior.lua 724,763c724 < end < < function addWorker(taskFunction) < if not self.workerTasks then self.workerTasks = {} end < < local task = { < coroutine = coroutine.create(taskFunction) < } < runTask(task) < local handle = function() < return task.lastResult < end < self.workerTasks[handle] = task < < return handle < end < < function removeWorker(handle) < self.workerTasks[handle] = nil < end < < function runTask(task) < local status, result = coroutine.resume(task.coroutine) < if status then < task.lastResult = result < else < sb.logInfo("Worker error: %s", result) < end < end < < function runWorkers() < if not self.workerTasks then self.workerTasks = {} end < for handle,task in pairs(self.workerTasks) do < if coroutine.status(task.coroutine) ~= "dead" then < runTask(task) < else < removeWorker(handle) < end < end < end --- > end \ No newline at end of file scripts\actions\movement.lua 4a5,28 > function movement() > if self.moving then > if self.move and coroutine.status(self.move) ~= "dead" then > local status, result = coroutine.resume(self.move) > if status then > self.moveResult = result > else > error("Movement error: %s", result) > end > end > else > self.move = nil > end > end > > function setMovementCoroutine(cor) > self.move = cor > self.moving = true > movement() > end > > -- > -- > 96c120 < local handle = addWorker(function() --- > local moveFunc = coroutine.create(function() 162,164d185 < node.onClear = function() < removeWorker(handle) < end 165a187 > setMovementCoroutine(moveFunc) 167c189,194 < coroutine.yield(handle()) --- > self.moving = true > if self.move == moveFunc then > coroutine.yield(self.moveResult) > else > return false > end 295c322 < local handle = addWorker(function() --- > local moveFunc = coroutine.create(function() 334,336d360 < node.onClear = function() < removeWorker(handle) < end 337a362 > setMovementCoroutine(moveFunc) 339c364,369 < coroutine.yield(handle()) --- > self.moving = true > if self.move == moveFunc then > coroutine.yield(self.moveResult) > else > return false > end scripts\actions\reaction.lua 185,202d184 < -- output list < function npcToyInfluence(args, output) < args = parseArgs(args, { < target = "" < }) < < local target = BData:getEntity(args.target) < if target == nil then return false end < < local influences = world.callScriptedEntity(target, "npcToy.getInfluence") < if influences == nil then return false end < if output.list then < BData:setList(output.list, influences) < end < return true < end < < -- param target 311a294 > -- output influences 323,324c306 < return true < end --- > self.playTarget = target 326,330c308,310 < -- param entity < function npcToyEndPlay(args, output) < args = parseArgs(args, { < entity = "" < }) --- > local influences = world.callScriptedEntity(target, "npcToy.getInfluence") > if influences == nil then return false end > BData:setList(output.influences, influences) 332,334c312,319 < local target = BData:getEntity(args.entity) < if target == nil then return false end < world.callScriptedEntity(target, "npcToy.notifyNpcPlayEnd", entity.id()) --- > -- keep calling until no longer playing > -- entity must call npcToy.notifyNpcPlayEnd on self.playTarget when self.playing > -- is no longer being set to true > while true do > self.playing = true > > coroutine.yield() > end scripts\behavior\bdata.lua 0a1,2 > require "/scripts/util.lua" > 14a17 > controls = {}, -- controls 38a42,65 > function BData:control(typeName, key, value) > self.controls[typeName] = self.controls[typename] or {} > self.controls[typeName][key] = true > return self:set(typeName, key, value) > end > > function BData:clearControls() > for typeName,controls in pairs(self.controls) do > self.controls[typeName] = util.map(controls, function() return false end) > end > end > > function BData:update() > -- remove controls set to false from the board > for typeName,controls in pairs(self.controls) do > for k,v in pairs(controls) do > if v == false then > self:set(typeName, k, nil) > controls[k] = nil > end > end > end > end > 208a236,241 > function controlFlag(args, output) > args = parseArgs(args, {}) > BData:control("bool", args.name, true) > return true > end > 364a398,404 > return true > end > > function controlEntity(args, output) > args = parseArgs(args, {}) > sb.logInfo("%s %s", output.entity, BData:getEntity(args.entity)) > BData:control("entity", output.entity, BData:getEntity(args.entity))