How it works: $g.employee_warehouse:schedule_events() is called by $g.shopper:return_from_shopping and $g.ewrench:Agent_Heartbeat is called by $g.employee_warehouse:schedule_events
Then $g.ewrench:Agent_Heartbeat refers to the agents on the $g.ewrench.hearts list and then checks the $g.heartbeat_flag (controlled by the $g:heartbeat toggle) and if the flag is 1, calls agent:heartbeat on every member on the list
NOTE: The farmhands directly descended from $g.employee are calling the wrong 'heartbeat' There are individual farmhands with their own 'heartbeat' functions, that should ALL inherit from $g.gen_farmhand
NOTE: to test a farmhand: 1) look at their .schedule property; 2) if the first item is {7, "get_to_work", {}, 5, 1} then 3) get their object number, say #5736, and call ;#5736:heartbeat(7, 167)
>#me => #14182 (brian.slator23) >@prop #14182.farmhandlist {} =>Property added with value {}. ;#14182.farmhandlist = {#5736, #7235, #7095, #7009, #7089} => {#5736, #7235, #7095, #7009, #7089}
;for farmhand in (#14182.farmhandlist) player:tell($string_utils:nn(farmhand), " home: ", farmhand.home, " parent: ", parent(farmhand), " props: ", toliteral(properties(farmhand))); endfor
farmhand_earl (#5736) home: #62 parent: #8416
props: {"friends", "path_to_town"}
farmhand_tomato (#7235) home: #62 parent: #1437
props: {"visitor_list", "path_farm_to_square"}
farmhand_mustard (#7095) home: #62 parent: #1437
props: {"visitor_list", "path_farm_to_square"}
farmhand_basil (#7009) home: #62 parent: #1437
props: {"visitor_list", "path_farm_to_square"}
Farmhand_Parsnips (#7089) home: #62 parent: #1437
props: {"visitors_list",
"path_farm_to_square"}
=> 0
The farmhands should be named for their product, capitalized, with an underscore, like Farmhand_Parsnips So, farmhand_earl, farmhand_willy, etc. should be changed.
>;properties($g.farmhand_earl) => {"friends", "path_to_town"} ;properties($g.farmhand_tomato) => {"visitor_list", "path_farm_to_square"} then look at their path_to_town (or, in many cases, path_farm_to_square): >;$g.farmhand_tomato.path_farm_to_square[1] => #6455 (TomatoFarm) >;$string_utils:na($g.farmhand_earl.path_to_town) => "Squash Farm (#5767), Eastern Farmland (#1264), Wagon Train Staging Area - ne corner (#913), Stars & Stripes Avenue - Wagon Train Staging Area (#904), Stars & Stripes Avenue (#901), Stars & Stripes Avenue - Gray Block (#898), Stars & Stripes Avenue (#895), Betsy Ross Street 100 block (#876), Wall Street 100 block (#865), Stars & Stripes Avenue (#247), Ash Street 100 block (#834), and Center Street 100 block (#701)" The first item on the list should be their home: farmhand_earl should have been named Farmhand_Squash! >;$g.farmhand_earl => #5736 (farmhand_earl) This works: >@rename #5736 to Farmhand_Squash Name of #5736 changed to "Farmhand_Squash", with aliases {"Farmhand_Squash"}. But this fails: >@rename $g.farmhand_earl to Farmhand_Squash Permission denied The $g.farmhand_earl value can only be changed by the wizard, but in this case I can just create a new $g name >;$g:add_dollarg_prop() Usage: add_dollarg_prop (property-name ,
Look for squash on $g using "dollarg"
>dollarg squash Candidates on $g: 1. $g.cart_squash #5738 2. $g.squash #5740 3. $g.squash_farm #5767 4. $g.garden_squash #5761 5. $g.shipment_squash #7155 >;$g:owntome($g.Farmhand_Squash) brian.slator23 are you sure you need to own this object? [Enter `yes' or `no'] >yes Okay, you got it. brian.slator23 is the new owner of farmhand_earl (#5736) formerly owned by XXXXXXXX (#XXXX) => 0 >@parent $g.Farmhand_Squash Farmhand_Squash(#5736) gen_employee(#1437) [...] >@chparent $g.Farmhand_Squash to $g.gen_farmhand Parent changed. >@parent $g.Farmhand_Squash Farmhand_Squash(#5736) generic_farmhand(#8416) gen_employee(#1437) [...]
;$g.Farmhand_Squash.home => #62 (The First Room) ;$g.Farmhand_Squash.home = $g.squash_farm => #5767 (Squash Farm)
NOTE: there is a 'heartbeat' function defined on 1) $g.employee; 2) $g.gen_farmhand, and 3) several of the farmhands. The farmhands should all become children of $g.gen_farmhand, and should execute the 'heartbeat' defined there.
Suppress the status messages by replacing 'player:tell' with '$g:inform'. Find out what functions your farmhands have defined.
>;verbs($g.Farmhand_Squash) => {"greet", "harvest", "close_shop", "get_to_work", "initialize", "move_home", "move_to_town", "set_up_shop"}
In the case of $g.Farmhand_Squash, use MacMoose to open "move_home" and "move_to_town", find all instances of 'player:tell' and replace with '$g:inform' but do not modify the calls to $g.interface_messages:speak
> ;verb_info(#5736, "move_home") => {#5203, "rxd", "move_home"} >;set_verb_info(#5736, "move_home", {#14182, "rxd", "move_home"}) #0:bf_set_verb_info, line 23: Permission denied You might need a wizard to do this step for you.
>: ;$g.Farmhand_Squash.schedule => {{7, "get_to_work", {}, 5, 1}, {8, "move_to_town", {}, 5, 1}, {9, "set_up_shop", {}, 5, 1}, {17, "close_shop", {}, 5, 1}, {18, "move_home", {}, 5, 1}} >: ;$g.Farmhand_Squash.schedule = {} => {} ;$g.Farmhand_Squash:initialize() => Farmhand_Squash (#5736) initializing a schedule.
>;for fh in (#14182.farmhandlist) player:tell($string_utils:nn(fh), " has ", toliteral(verbs(fh))); endfor Farmhand_Squash (#5736) has {"greet", "harvest", "close_shop", "get_to_work", "initialize", "move_home", "move_to_town", "set_up_shop"} >@list $g.Farmhand_Squash:greet >;$g.Farmhand_Squash:greet(#14182) #5736:greet, line 13: Permission denied >;verb_info(#5736, "greet") => {#5203, "rxd", "greet"} "Send this to the wizard "; >;set_verb_info(#5736, "greet", {#14182, "rxd", "greet"})
Put your accomplishments into a clear professional report and email it to the TA.
==========New/Revised Farmhand Roster (note *)============
1. Alhamadah Hadeel 1. $g.farmhand_parsley #6908 *2. $g.farmhand_zucchini (#5564) 2. Bernard Christian 3. $g.farmhand_turnip #5744 4. $g.farmhand_carrot #5743 3. Budke Emily 5. $g.farmhand_onion #5741 6. $g.farmhand_willy #5749 4. Erickson Andrew 7. $g.farmhand_sprouts #6909 *35. $g.farmhand_mustard #7095 5. Garcia Karmikael 9. $g.farmhand_jable #5689 10. $g.farmhand_frankie #6663 6. Hass Christopher 11. $g.farmhand_corn #5689 12. $g.farmhand_schell #6928 7. Konsor Andrew 13. $g.farmhand_billy #6929 14. $g.farmhand_joebob #6941 8. Mack Nicholas 15. $g.farmhand_pete #5400 16. $g.Farmhand_Dayton #6960 9. Malloy Harrison 17. $g.farmhand_manuel #5387 18. $g.farmhand_Bob #5735 10. Murphy Quinn 19. $g.farmhand_Spanky #6993 20. $g.farmhand_mikecole #6907 11. Pirillis Allan 21. $g.farmhand_rhubarb #7013 22. $g.Farmhand_Billy_Bob #5688 12. Schoepp Blake 23. $g.Farmhand_Joe #5388 24. $g.farmhand_celery #5751 13. Solem Matthew 25. $g.farmhand_jimbo #5774 26. $g.Farmhand_ChokeCherries #5552 14. Swanson Reilly 27. $g.farmhand_zeke #7032 28. $g.Farmhand_Lettuce #6944 15. Terwilliger Alec 29. $g.farmhand_raspberries #7091 30. $g.farmhand_cucumber #6839 16. Vagle Maxwell 31. $g.Farmhand_Derek #5565 *36. $g.farmhand_tomato #7235 17. Winningham Jakob 33. $g.farmhand_sue #7105 34. $g.farmhand_asparagus #7105 18. Slator Brian *35. $g.farmhand_earl #5736 => Farmhand.Squash *36. $g.farmhand_basil #7009 *37. $g.Farmhand_Parsnips #7089 *38. my_farmHand (#7148) *39, Farmhand_Steven (#7030)
Contact: Brian.Slator@ndsu.edu; Modified: 25feb2019