How To Do Equivalent Of Mob Force Mob Oload Aylor-321 Etc

In the old mobprog system, 'mob force' forces the target to execute a MUD command. This works fine in the Lua force also. The exception is 'mob force mob ...' - In the old system this causes the mob being forced to execute an arbitrary line of mobprog code within its own space. Because Lua is a completely separate environment integrated back in to the mud, you cannot simply force a mob to execute a lua statement.

The workaround for this is more flexible, but a little more complex. Using the v2 mobprog example below, the mob loads a new mob, then forces it to load and wield a sword:

   --- Create a new mob : forge worker.
   mob mload aylor-20
   --- Force it to load an aylorian sword on itself
   mob force worker mob oload aylor-321
   --- Force it to wield it. No 'mob force mob' here - regular MUD command.
   mob force wield wield sword

Because the Lua call allows you to change the actors (including self), and because mload returns a CH variable for the mob created, you can combine these to achieve the same results.

You would split this into two progs, then call the second prog changing the 'self' actor to the mob that was just loaded:

   --- Create a new mob
   local newmob = mload("aylor-20")

   --- Call the second prog, as the new mob. Imagine the new prog is aylor-50.
   --- We're only changing self to newmob in the call so put nil in the other
   --- variable positions. Think of this as "execute aylor-50 as the newmob"
   call("aylor-50",nil,nil,nil,newmob)

   --- Aylor-50 prog: now being executed as the new mob is simply:
   oload("aylor-321")
   mdo("wield sword")