Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9243 in orxonox.OLD for branches/scripting/src


Ignore:
Timestamp:
Jul 6, 2006, 4:10:39 PM (18 years ago)
Author:
snellen
Message:

update

Location:
branches/scripting/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/scripting/src/lib/script_engine/script.cc

    r9242 r9243  
    5959void Script::loadParams(const TiXmlElement* root)
    6060{
    61   //printf("Loading params for %p \n",this);
     61  //printf(("Loading params for %p \n",this);
    6262  BaseObject::loadParams(root);
    6363
     
    8787   if(currentFile.length() != 0)
    8888   {
    89      PRINT(1)("SCRIPT %s : ERROR: Could not load %s because an other file is already loaded: %s\n",currentFile.c_str(),filename.c_str(), currentFile.c_str());
     89     printf("SCRIPT %s : ERROR: Could not load %s because an other file is already loaded: %s\n",currentFile.c_str(),filename.c_str(), currentFile.c_str());
    9090     return false;
    9191    }
     
    104104     else
    105105     {
    106        PRINT(1)("SCRIPT %s : ERROR: while loading file %s: \n",currentFile.c_str(),filename.c_str());
     106       printf("SCRIPT %s : ERROR: while loading file %s: \n",currentFile.c_str(),filename.c_str());
    107107       reportError(error);
    108108     }
     
    111111   else
    112112   {
    113      PRINT(1)("SCRIPT %s : ERROR: while loading file %s: \n",currentFile.c_str(),filename.c_str());
     113     printf("SCRIPT %s : ERROR: while loading file %s: \n",currentFile.c_str(),filename.c_str());
    114114     reportError(error);
    115115   }
     
    121121 void Script::addObject(const std::string& className, const std::string& objectName)
    122122 {
    123    //printf("Script %s: I am about to add %s of class %s\n",this->getName(),objectName.c_str(),className.c_str());
     123   //printf(("Script %s: I am about to add %s of class %s\n",this->getName(),objectName.c_str(),className.c_str());
    124124
    125125   BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS);
    126   // printf("The script class for %s is at %p \n",className.c_str(),scriptClass);
     126  // printf(("The script class for %s is at %p \n",className.c_str(),scriptClass);
    127127   WorldObject tmpObj;
    128128   if (scriptClass != NULL)
     
    135135
    136136     BaseObject* object = ClassList::getObject(objectName, className);
    137     // printf("%s is at %p \n",objectName.c_str(),object);
     137    // printf(("%s is at %p \n",objectName.c_str(),object);
    138138     if (object != NULL && !objectIsAdded(objectName))
    139139     {
     
    183183   }
    184184   else
    185      PRINT(1)("SCRIPT %s : ERROR: There is an other function active ( %s ) or there are unremoved return values on the stack. Please remove them first.\n",currentFile.c_str(),currentFunction.c_str());
     185     printf("SCRIPT %s : ERROR: There is an other function active ( %s ) or there are unremoved return values on the stack. Please remove them first.\n",currentFile.c_str(),currentFunction.c_str());
    186186   return false;
    187187 }
     
    195195    if(error != 0)
    196196    {
    197       PRINT(1)("SCRIPT %s : ERROR: Failed to execute function %s: \n",currentFile.c_str(),currentFunction.c_str());
     197      printf("SCRIPT %s : ERROR: Failed to execute function %s: \n",currentFile.c_str(),currentFunction.c_str());
    198198     reportError(error);
    199199     //clean up
     
    210210   }
    211211   else
    212      PRINT(1)("SCRIPT %s : ERROR: no function selected.\n",currentFile.c_str());
     212     printf("SCRIPT %s : ERROR: no function selected.\n",currentFile.c_str());
    213213
    214214   return false;
     
    227227   else
    228228   {
    229      PRINT(1)("SCRIPT %s : ERROR: Couldn't add parameter because the wrong function is selected: %s instead of %s\n",currentFile.c_str(), currentFunction.c_str(), toFunction.c_str());
     229     printf("SCRIPT %s : ERROR: Couldn't add parameter because the wrong function is selected: %s instead of %s\n",currentFile.c_str(), currentFunction.c_str(), toFunction.c_str());
    230230    return false;
    231231   }
     
    244244   else
    245245   {
    246      PRINT(1)("SCRIPT %s : ERROR: Couldn't add parameter because the wrong function is selected: %s instead of %s\n",currentFile.c_str(), currentFunction.c_str(), toFunction.c_str());
     246     printf("SCRIPT %s : ERROR: Couldn't add parameter because the wrong function is selected: %s instead of %s\n",currentFile.c_str(), currentFunction.c_str(), toFunction.c_str());
    247247     return false;
    248248   }
     
    260260   else
    261261   {
    262      PRINT(1)("SCRIPT %s : ERROR: Couldn't add parameter because the wrong function is selected: %s instead of %s\n",currentFile.c_str(), currentFunction.c_str(), toFunction.c_str());
     262     printf("SCRIPT %s : ERROR: Couldn't add parameter because the wrong function is selected: %s instead of %s\n",currentFile.c_str(), currentFunction.c_str(), toFunction.c_str());
    263263     return false;
    264264   }
     
    295295     }
    296296     else
    297        PRINT(1)("SCRIPT %s : ERROR: Trying to retreive non bolean value\n",this->currentFile.c_str());
     297       printf("SCRIPT %s : ERROR: Trying to retreive non bolean value\n",this->currentFile.c_str());
    298298   }
    299299   return returnValue;
     
    347347  const char *msg = lua_tostring(luaState, -1);
    348348  if (msg == NULL) msg = "(error with no message)\n";
    349   PRINT(1)("ERROR: %s\n", msg);
     349  printf("ERROR: %s\n", msg);
    350350  lua_pop(luaState, 1);
    351351 }
     
    368368 {
    369369   BaseObject* scriptClass = ClassList::getObject(className, CL_SCRIPT_CLASS);
    370    //printf("The script class for %s is at %p \n",className.c_str(),scriptClass);
     370   //printf(("The script class for %s is at %p \n",className.c_str(),scriptClass);
    371371   WorldObject tmpObj;
    372372   if (scriptClass != NULL)
  • branches/scripting/src/world_entities/npcs/gate.cc

    r9241 r9243  
    1313   ### File Specific
    1414   main-programmer: Patrick Boenzli
    15    co-programmer:
     15   co-programmer: Silvan Nellen
    1616*/
    1717#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
     
    6666  this->scale = 1.0f;
    6767  this->actionRadius = 1.0;
     68  this->destroyed = false;
    6869
    6970  if( root != NULL)
     
    151152void Gate::open()
    152153{
    153   if( this->bLocked)
     154  if( this->bLocked || this->destroyed)
    154155    return;
    155156
     
    164165void Gate::close()
    165166{
     167 
     168  if( this->destroyed)
     169    return;
     170 
    166171  this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE);
    167172  this->bOpen = false;
     
    171176void Gate::destroy()
    172177{
     178  if( this->destroyed)
     179    return;
     180 
    173181  this->setAnimation(GATE_DIE, MD2_ANIM_ONCE);
    174182
    175   Explosion::explode(this, Vector(10,10,10));
     183  Explosion::explode(this, Vector(this->getScaling()/160,this->getScaling()/160,this->getScaling()/160));
     184 
     185 
     186  this->destroyed = true;
    176187}
    177188
  • branches/scripting/src/world_entities/npcs/gate.h

    r9235 r9243  
    5050
    5151  private:
     52    bool           destroyed;         //!< true if the door is destroyed
    5253    bool           bOpen;             //!< true if the door is open
    5354    bool           bLocked;           //!< true if this door is locked
  • branches/scripting/src/world_entities/projectiles/guided_missile.cc

    r9235 r9243  
    4343  this->lifeSpan = 4.0;
    4444  this->agility = 3.5;
    45   this->maxVelocity = 75;
     45  this->maxVelocity = 100;
    4646
    4747  this->emitter = new DotEmitter(100, 5, M_2_PI);
  • branches/scripting/src/world_entities/space_ships/spacecraft_2d.cc

    r9235 r9243  
    498498    this->bForward = event.bPressed; //this->shiftCoor(0,.1,0);
    499499  else if( event.type == KeyMapper::PEV_BACKWARD)
    500     this->bBackward = event.bPressed; //this->shiftCoor(0,-.1,0);
     500  {this->bBackward = event.bPressed; printf(" %f, %f, %f \n",getAbsCoorX(),getAbsCoorY(),getAbsCoorZ());} //this->shiftCoor(0,-.1,0);
    501501  else if( event.type == EV_MOUSE_MOTION)
    502502  {
  • branches/scripting/src/world_entities/weapons/aiming_system.cc

    r9235 r9243  
    115115  if( this->owner != killer)
    116116  {
    117     PRINTF(0)("real hit: %s\n", killer->getClassName());
     117    //PRINTF(0)("real hit: %s\n", killer->getClassName());
    118118    this->selectionList.push_back(killer);
    119119  }
  • branches/scripting/src/world_entities/world_entity.h

    r9235 r9243  
    129129
    130130  /* --- Character Attribute Block --- */
     131  /** @returns the scaling of the model */
     132  float getScaling(){return this->scaling;}
    131133  /** @returns the damage dealt by this world entity */
    132134  float getDamage() const { return this->damage; }
Note: See TracChangeset for help on using the changeset viewer.