My problem is that i can't get the shuttle’s location by referencing it from the
given key of allocate task in coordinated task sequence ,maybe there still have other problems.
/**Custom Code*/ Object current = param(1); Object item = param(2); int port = param(3); treenode destination = param(4); double priority = param(5); int preempt = param(6); treenode dispatcher = current.centerObjects[1]; treenode lift=Model.find("Elevator1"); treenode ts = createcoordinatedtasksequence(dispatcher); int opkey = insertallocatetask(ts, dispatcher, 0, 0); int liftkey = insertallocatetask(ts, lift, 0, 0); int oploc=insertproxytask(ts,opkey,TASKTYPE_TRAVEL,liftkey,NULL );//3 int liftloc=insertproxytask(ts,liftkey,TASKTYPE_TRAVEL,opkey,NULL );//3 insertsynctask(ts,liftloc);//6 insertsynctask(ts,oploc);//5 int opload=insertproxytask(ts,liftkey,TASKTYPE_LOAD,opkey,liftkey);// 7 insertsynctask(ts,opload);//8 int moveupdes1=insertproxytask(ts,liftkey,TASKTYPE_TRAVELTOLOC,NULL,NULL,xloc(lift),yloc(lift),vectorprojectz(up(item),xloc(item),yloc(item),zloc(item),model())); insertsynctask(ts,moveupdes1);//11 int loadupdes1=insertproxytask(ts,opkey,TASKTYPE_FRLOAD,item,NULL);//18 insertsynctask(ts,loadupdes1);//11 int moveupdes2=insertproxytask(ts,liftkey,TASKTYPE_TRAVELTOLOC,NULL,NULL,xloc(lift),yloc(lift),item.level-1); insertsynctask(ts,moveupdes2); int opmoveout=insertproxytask(ts,liftkey,TASKTYPE_MOVEOBJECT,opkey,model()); //13 insertsynctask(ts,opmoveout); insertdeallocatetask(ts,liftkey); insertproxytask(ts,opkey,TASKTYPE_SENDMESSAGE,opkey,item,1,0,0); insertproxytask(ts,opkey,TASKTYPE_TRAVELTOLOC,NULL,NULL,-0.31+0.6*(item.bay)+1.25,0.72,item.level-1); insertproxytask(ts,opkey,TASKTYPE_UNLOAD,item,destination);//20 insertdeallocatetask(ts,opkey); dispatchcoordinatedtasksequence(ts); return 0;