Replace imps with rigged swamp demon and adapt gait and activities

This commit is contained in:
JariKo
2026-10-28 23:04:47 +02:00
parent 8ee99c0ea0
commit f51f3f6449
20 changed files with 465 additions and 95 deletions
+4 -4
View File
@@ -123,11 +123,11 @@ func move_imp(imp,target,dt):
if other.root!=imp.root:actors.append(other.root.position)
for position in actors:
var delta=imp.root.position-position;delta.y=0
if delta.length_squared()<.52*.52:
desired_velocity+=(delta.normalized() if delta.length_squared()>.0001 else Vector3.RIGHT)*1.4*(1-delta.length()/.52)
if delta.length_squared()<.72*.72:
desired_velocity+=(delta.normalized() if delta.length_squared()>.0001 else Vector3.RIGHT)*1.4*(1-delta.length()/.72)
imp.velocity=imp.get("velocity",Vector3.ZERO).move_toward(desired_velocity.limit_length(1.35),step_dt*5)
var before=imp.root.position;var desired=before+imp.velocity*step_dt
w.mesh_walking.move_actor(imp.root,desired-imp.root.position,.20,1.0)
w.mesh_walking.move_actor(imp.root,desired-imp.root.position,.34,1.18)
imp.root.position.x=clampf(imp.root.position.x,-7.1,w.walk_right());imp.root.position.z=clampf(imp.root.position.z,-4.8,5.6)
face_motion(imp,imp.root.position-before,step_dt)
if imp.root.position.distance_to(next)<.12 and not imp.path.is_empty():imp.path.remove_at(0)
@@ -147,7 +147,7 @@ func move_neighbour(imp,target,dt):
var desired=(target-imp.root.position).normalized()*1.15;desired.y=0
imp.velocity=imp.velocity.move_toward(desired,dt*4)
var before=imp.root.position
g.workshop.mesh_walking.move_actor(imp.root,imp.velocity*dt,.20,1.0)
g.workshop.mesh_walking.move_actor(imp.root,imp.velocity*dt,.34,1.18)
imp.root.position.x=clampf(imp.root.position.x,imp.origin.x-7.1,imp.origin.x+7.1)
imp.root.position.z=clampf(imp.root.position.z,imp.origin.z-5.5,imp.origin.z+5.5)
face_motion(imp,imp.root.position-before,dt)