Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 3, 2014, 3:59:48 PM (10 years ago)
Author:
samuezu
Message:

created scriptcontroller header and *.cc file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController/src/orxonox/controllers/ScriptController.cc

    r10014 r10020  
    3434    RegisterClass(ScriptController);
    3535
    36     ScriptController::ScriptController(Context* context) : ArtificialController(context)
     36    ScriptController::ScriptController(Context* context, ControllableEntity CE) : ArtificialController(context)
    3737    {
    3838        RegisterObject(ScriptController);
     39        set_controlled(CE);
    3940    }
    4041
    41     bool ScriptController::execute(bool bTriggered, BaseObject* trigger)
     42    void set_luasrc(string lsrc)
    4243    {
    43         orxout(verbose)<<"hello universe"<<endl;
    44         return true;
     44        this->luasrc=lsrc;
    4545    }
    4646
    47 
     47    void set_controlled(&ControllableEntity toControl)
     48    {
     49        this->controlled=toControl;
     50    }
     51   
    4852    void ScriptController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    4953    {
    50         XMLPortEventSink(ScriptController, BaseObject, "execute", execute, xmlelement, mode);
     54        XMLPort(ScriptController, BaseObject, "lsrc", set_luasrc, xmlelement, mode);
    5155
    5256    }
    5357
     58    void ScriptController::moveToPosition(const Vector3& target)
     59    {
     60
     61
     62    }
     63    /* TO DO
     64                in the constuctor: make accessible functions such as moveToPosition.. in LUA
     65            ->tolua++ example: http://usefulgamedev.weebly.com/tolua-example.html*/
     66
     67    //function to execute the luafile
    5468
    5569
Note: See TracChangeset for help on using the changeset viewer.