Here is what I get when I attempt to use that code:
CLIPS> (defrule restore_original_speed
(?f <- (entity_walk_speed_override ?entity_id ?speed_override))
=>
(bind ?old_speed (walk_speed ?entity_id))
(retract ?f)
(bind ?new_speed (walk_speed ?entity_id)))
[PRNTUTIL2] Syntax Error: Check appropriate syntax for the first field of a pattern.
ERROR:
(defrule MAIN::restore_original_speed
(?f
Note the error message at the end; the syntax of your rule antecedent is incorrect.
Can you try without wrapping the (?f <- (entity_walk_speed_override ?entity_id ?speed_override)) in parenthesis? Additionally, the code you used does not use the `deftemplate` as defined in Gary's code.
Here's what I got working.
CLIPS> (defrule restore_original_speed
?f <- (entity_walk_speed_override (id ?entity_id) (speed ?speed_override))
=>
(bind ?old_speed (walk_speed ?entity_id))
(retract ?f)
(bind ?new_speed (walk_speed ?entity_id))
(println "?old_speec: " ?old_speed " ?new_speed: " ?new_speed))
CLIPS> (run)
?old_speec: 6 ?new_speed: 5