source code was in resource! weird

This commit is contained in:
Vivianne 2023-10-06 01:58:49 -07:00
parent d5591022f6
commit b953ba3897
2 changed files with 26 additions and 28 deletions

View file

@ -1,5 +1,6 @@
[gd_scene load_steps=11 format=3 uid="uid://byuqbh3u5cxqo"] [gd_scene load_steps=11 format=3 uid="uid://byuqbh3u5cxqo"]
[ext_resource type="Script" path="res://mean_dude.gd" id="1_1wbea"]
[ext_resource type="Script" path="res://addons/beehave/nodes/beehave_tree.gd" id="1_von5m"] [ext_resource type="Script" path="res://addons/beehave/nodes/beehave_tree.gd" id="1_von5m"]
[ext_resource type="Script" path="res://addons/beehave/nodes/composites/selector.gd" id="2_tmsoc"] [ext_resource type="Script" path="res://addons/beehave/nodes/composites/selector.gd" id="2_tmsoc"]
[ext_resource type="Script" path="res://addons/beehave/nodes/composites/sequence.gd" id="3_wl46j"] [ext_resource type="Script" path="res://addons/beehave/nodes/composites/sequence.gd" id="3_wl46j"]
@ -9,38 +10,11 @@
[ext_resource type="Script" path="res://addons/beehave/nodes/leaves/blackboard_set.gd" id="6_pjfxk"] [ext_resource type="Script" path="res://addons/beehave/nodes/leaves/blackboard_set.gd" id="6_pjfxk"]
[ext_resource type="Texture2D" uid="uid://belbhsx23yyd" path="res://bad-dude.png" id="8_67is2"] [ext_resource type="Texture2D" uid="uid://belbhsx23yyd" path="res://bad-dude.png" id="8_67is2"]
[sub_resource type="GDScript" id="GDScript_jijww"]
script/source = "class_name MeanDude
extends Node
@export var blackboard: Blackboard
var visible: Array[Node] = []
func _ready():
$BeehaveTree.blackboard = blackboard
func say_shit(shit):
print(self.name, \": \", shit)
func _on_eyes_body_entered(body):
# simplification of course
if body != get_parent():
visible.append(body)
func _on_eyes_body_exited(body):
if body != get_parent():
visible.erase(body)
"
[sub_resource type="CircleShape2D" id="CircleShape2D_tt36q"] [sub_resource type="CircleShape2D" id="CircleShape2D_tt36q"]
radius = 31.3847 radius = 31.3847
[node name="BadDude" type="RigidBody2D"] [node name="BadDude" type="RigidBody2D"]
script = SubResource("GDScript_jijww") script = ExtResource("1_1wbea")
[node name="BeehaveTree" type="Node" parent="."] [node name="BeehaveTree" type="Node" parent="."]
script = ExtResource("1_von5m") script = ExtResource("1_von5m")

24
mean_dude.gd Normal file
View file

@ -0,0 +1,24 @@
class_name MeanDude
extends Node
@export var blackboard: Blackboard
var visible: Array[Node] = []
func _ready():
$BeehaveTree.blackboard = blackboard
func say_shit(shit):
print(self.name, ": ", shit)
func _on_eyes_body_entered(body):
# simplification of course
if body != get_parent():
visible.append(body)
func _on_eyes_body_exited(body):
if body != get_parent():
visible.erase(body)