Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 3, 2006, 1:35:40 PM (18 years ago)
Author:
snellen
Message:

added some methods to generic npcs scriptable

Location:
branches/single_player_map/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/npcs/generic_npc.cc

    r9020 r9031  
    4040                        ->addMethod("turnTo", ExecutorLua1<GenericNPC,float>(&GenericNPC::turnTo))
    4141                        ->addMethod("finalGoalReached", ExecutorLua0ret<GenericNPC,bool>(&GenericNPC::finalGoalReached))
     42                        // Animation and sound
     43                        ->addMethod("playAnimation", ExecutorLua2<GenericNPC,int,int>(&GenericNPC::playAnimation))
     44                        //->addMethod("playSound", ExecutorLua1<GenericNPC,const std::string&>(&GenericNPC::playSound))
    4245                        // Display
    4346                        ->addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
  • branches/single_player_map/src/world_entities/playable.h

    r8724 r9031  
    5656
    5757  // Player Settup
     58  bool hasPlayer(){return !(this->currentPlayer == NULL);}
    5859  bool setPlayer(Player* player);
    5960  Player* getCurrentPlayer() const { return this->currentPlayer; };
  • branches/single_player_map/src/world_entities/space_ships/space_ship.cc

    r9008 r9031  
    5555
    5656CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP);
    57 
     57#include "script_class.h"
     58CREATE_SCRIPTABLE_CLASS(SpaceShip, CL_SPACE_SHIP,
     59                        addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
     60                       );
    5861
    5962/**
Note: See TracChangeset for help on using the changeset viewer.