Thoughts about machinery
A new cowscript statment 'combine' could combine 2 objects into a third.
It would need:
combine in $loc $qty1 $target with $qty2 $second to make "a new object" special $owner;
The 'special' ID checks each object's owner and creator and if any matches the ID supplied then these are times together, else added together.
if the $owner is a string then check the 'class' of the objects that own and created them $target and $second for a match.
This would allow us to do something special of a nut was created by a tree as compared to being created by a player.
combine $target with $second secial "tree";
The numbers before $target and second (can be variales) and reflect how many are neded of each to make a new object so:
combine in $actor 3 "nuts" with 1 "jar" to make "a jar of nut paste" special "tree";
So if you have 6 nuts and 2 jars it should make 2 jars of nut paste.
If you only had 2 nuts and 2 jars it would make nothing
if you have 4 nuts and 2 jars it would make 1 jar of nut paste and leave 1 jar for later.
All values of 1 are increased to 2 when a special is matched so the timesing has more impact.
If you want to combine 3 things.. use the combine twice:
combine in $actor 1 "box" with 1 "ribbon" to make "a pretty box";
combine in $actor 1 "pretty box" with 1 "diamond" to make "a special present";
Note, if only the first 2 are present.. just a 'pretty box' will be made.
Since no 'special' was mentioned, the values will be added together.
Use of pocket variables will help object proclaim their needs and products:
set $actor's need1 to "3 nuts";
set $actor's need2 to "1 jar";
set $actor's produce to "jar of nut paste";
print "[$actor] needs $need1 and $need2 to make $produce";
combine $actor's need1 with $actor's need2 to make $actor's produce";