Arc Forumnew | comments | leaders | submitlogin
2 points by bOR_ 5979 days ago | link | parent

From another beginner ;). Isnt this what templates are for? Here is a template I am using:

  ; Template of a creature
  (deftem creature 
   symbol #\@
   dir '(1 1) 
   pos '(0 0)

   ;memory bits
   stm (n-of 7 nil)
   oltm (table) ; ltm - the objects associated with a
   altm (table) ; ltm - the actions associated with a
   cltm (table) ; ltm - the emotions associations with a
   ltmsize 25

   s2ltm 3

   ;list of behaviours/ actions
   action (list act_bite)

   ; observations:
   fov 110  ; fov not being exactl fov, but half-fov
   range 7
   hunger 0
   )
and now I can just call an instance of this template, including its default values. I basically use that as my objects.

  (= craa (inst 'creature))


2 points by EliAndrewC 5979 days ago | link

Does this give you any kind of "this" object in your object methods? That's a large part of what I'm looking for, since that lets me say "(p!until 30)" in my example, or something like "(craa!act_bite)" in your example.

-----