RigsofRods
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GameScriptClass.h
Go to the documentation of this file.
1 /*
2 This source file is part of Rigs of Rods
3 
4 For more information, see http://www.rigsofrods.org/
5 
6 Rigs of Rods is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 3, as
8 published by the Free Software Foundation.
9 
10 Rigs of Rods is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
17 */
18 // created on 23th May 2011 by neorej16
19 
20 namespace Script2Game {
21 
36 {
37 public:
38  // PLEASE maintain the same order as in GameScript.h and GameScriptAngelscript.cpp!
39 
42 
47  void log(string message);
48 
53  double getTime();
54 
61  float rangeRandom(float from, float to);
62 
66  int useOnlineAPI(const string apiquery, const dictionary dict, string result);
67 
72  void getFPS();
73 
78  void getAvgFPS();
79 
83  void backToMenu();
84 
88  void quitGame();
89 
94  bool pushMessage(MsgType type, dictionary@ dict);
95 
101  bool checkResourceExists(const string &in filename, const string &in resource_group);
102 
107  bool deleteResource(const string &in filename, const string &in resource_group);
108 
115  std::string loadTextResourceAsString(const string &in filename, const string &in resource_group);
116 
126  bool createTextResourceFromString(const string &in, const string &in filename, const string &in resource_group, bool overwrite=false);
127 
132 
136  void openUrlInDefaultBrowser(const std::string& url);
137 
141  void fetchUrlAsStringAsync(const std::string& url, const std::string& display_filename);
142 
144 
147 
155  void flashMessage(string message, float time, float charHeight);
156 
164  void message(string txt, string icon, float timeMilliseconds, bool forceVisible);
165 
171  int getChatFontSize();
172 
178  void setChatFontSize(int size);
179 
193  void showMessageBox(string mTitle, stringmText, bool button1, stringmButton1, bool AllowClose, bool button2, stringmButton2);
194 
211  void showChooser(string type, string instance, string box);
212 
219  void updateDirectionArrow(string text, vector3 position);
220 
225  void hideDirectionArrow();
226 
232  bool getScreenPosFromWorldPos(const vector3&in, vector2&out);
233 
237  vector2 getDisplaySize();
238 
242  Ogre::Vector2 getMouseScreenPosition();
243 
245 
248 
253  void registerForEvent(int eventValue);
254 
259  void unRegisterEvent(int eventValue);
260 
265  BitMask_t getRegisteredEventsMask(ScriptUnitId_t nid);
266 
272  void setRegisteredEventsMask(ScriptUnitId_t nid, BitMask_t eventMask);
273 
280  ScriptRetCode addScriptFunction(const string func, ScriptUnitId_t nid = -2);
281 
288  ScriptRetCode scriptFunctionExists(const string func, ScriptUnitId_t nid = -2);
289 
296  ScriptRetCode deleteScriptFunction(const string func, ScriptUnitId_t nid = -2);
297 
304  ScriptRetCode addScriptVariable(const string var, ScriptUnitId_t nid = -2);
305 
312  ScriptRetCode scriptVariableExists(const string var, ScriptUnitId_t nid = -2);
313 
320  ScriptRetCode deleteScriptVariable(const string var, ScriptUnitId_t nid = -2);
321 
329  ScriptRetCode getScriptVariable(const string&in varName, ?&ref, ScriptUnitId_t nid = -2);
330 
334  void clearEventCache();
335 
339  int sendGameCmd(const string& message);
340 
344  array<int> getRunningScripts();
345 
354  dictionary@ getScriptDetails(int nid);
355 
357 
360 
369  void loadTerrain(string terrain);
370 
376  int getLoadedTerrain(string result);
377 
382 
387  bool getCaelumAvailable();
388 
393  string getCaelumTime();
394 
399  void setCaelumTime(float value);
400 
405  float getGravity();
406 
411  void setGravity(float value);
412 
417  float getWaterHeight();
418 
424  float getGroundHeight(vector3 position);
425 
430  void setWaterHeight(float value);
431 
441  void spawnObject(const string objectName, const string instanceName, vector3 pos, vector3 rot, const string eventhandler, bool uniquifyMaterials);
442 
449  void moveObjectVisuals(const string instanceName, const vector3 pos);
450 
456  void destroyObject(const string instanceName);
457 
461  array<TerrainEditorObjectClassPtr@>@ getEditorObjects();
462 
463 
469  bool getMousePositionOnTerrain(vector3 &out);
470 
474  array<Ogre::MovableObjects@> getMousePointedMovableObjects();
475 
477 
480 
485  vector3 getPersonPosition();
486 
491  void setPersonPosition(vector3 vec);
492 
497  void movePerson(vector3 relative_movement);
498 
499  void setPersonRotation(radian &in);
500 
501  radian getPersonRotation();
502 
504 
507 
508  void activateAllVehicles();
509 
510  void setTrucksForcedAwake(bool forceActive);
511 
516  void boostCurrentTruck(float factor);
517 
524 
531  BeamClass@ getTruckByNum(int truck_number);
532 
536  array<BeamClass@> getAllTrucks();
537 
541  int getCurrentTruckNumber();
542 
551  BeamClass @spawnTruck(stringtruckName, vector3 pos, vector3 rot);
552 
556  void repairVehicle(string instance, string box, bool keepPosition);
557 
561  void removeVehicle(string instance, string box);
562 
566  int getNumTrucksByFlag(int flag);
567 
572 
578 
580 
583 
588 
593 
595 
599 
600  BeamClass@ spawnTruckAI(string truckName, vector3 pos, string truckSectionConfig, string truckSkin, int x);
601  array<vector3>@ getWaypoints(int x);
602  void addWaypoint(vector3 pos);
603  int getAIVehicleCount();
604  int getAIVehicleDistance();
606  int getAIVehicleSpeed();
607  Ogre::String getAIVehicleName(int x);
608  Ogre::String getAIVehicleSectionConfig(int x);
609  std::string getAIVehicleSkin(int x);
610  int getAIRepeatTimes();
611  int getAIMode();
614 
615  // AI: set
616  void setAIVehicleCount(int count);
617  void setAIVehicleDistance(int dist);
618  void setAIVehiclePositionScheme(int scheme);
619  void setAIVehicleSpeed(int speed);
620  void setAIVehicleName(int x, string name);
621  void setAIVehicleSectionConfig(int x, string config);
622  void setAIVehicleSkin(int x, string skin);
623  void setAIRepeatTimes(int times);
624  void setAIMode(int mode);
625 
627 
630 
635  void setCameraPosition(vector3 position);
636 
641  void setCameraDirection(vector3 direction);
642 
647  void setCameraRoll(float angle);
648 
653  void setCameraYaw(float angle);
654 
659  void setCameraPitch(float angle);
660 
665  vector3 getCameraPosition();
666 
671  vector3 getCameraDirection();
672 
681  void cameraLookAt(vector3 targetPoint);
682 
684 
687 
693  float stopTimer();
694 
699  void startTimer();
700 
702 
705 
706  int setMaterialAmbient(const string materialName, float red, float green, float blue);
707  int setMaterialDiffuse(const string materialName, float red, float green, float blue, float alpha);
708  int setMaterialSpecular(const string materialName, float red, float green, float blue, float alpha);
709  int setMaterialEmissive(const string materialName, float red, float green, float blue);
710 
711  int setMaterialTextureName(const string materialName, int techniqueNum, int passNum, int textureUnitNum, const string textureName);
712  int setMaterialTextureRotate(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float rotation);
713  int setMaterialTextureScroll(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float sx, float sy);
714  int setMaterialTextureScale(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float u, float v);
715 
717 
720 
721  array<SoundScriptTemplateClass> getAllSoundScriptTemplates();
722 
726  SoundScriptTemplateClass getSoundScriptTemplate(const string &in name);
727 
731  array<SoundScriptInstanceClass> getAllSoundScriptInstances();
732 
737  SoundClass createSoundFromResource(const string &in filename, const string &in resource_group_name = string());
738 
744  SoundScriptInstanceClass createSoundScriptInstance(const string &in template_name, int actor_instance_id = -1);
745 
747 };
748 
751 
752 } //namespace Script2Game
Script2Game::GameScriptClass::getCameraDirection
vector3 getCameraDirection()
Gets the camera's direction.
Script2Game::GameScriptClass::getScriptVariable
ScriptRetCode getScriptVariable(const string &in varName, ?&ref, ScriptUnitId_t nid=-2)
Retrieves a memory address of a global variable in any script.
Script2Game::GameScriptClass::getAIMode
int getAIMode()
Script2Game::GameScriptClass::clearEventCache
void clearEventCache()
Clears the event cache.
Script2Game::GameScriptClass::getWaypoints
array< vector3 > getWaypoints(int x)
Script2Game::GameScriptClass::activateAllVehicles
void activateAllVehicles()
Script2Game::GameScriptClass::loadTerrain
void loadTerrain(string terrain)
Loads a terrain.
Script2Game::GameScriptClass::setMaterialSpecular
int setMaterialSpecular(const string materialName, float red, float green, float blue, float alpha)
Script2Game::SoundClass
Binding of RoR::Sound; a single sound sample positioned in 3D space (spatial audio).
Definition: SoundClass.h:17
Script2Game::GameScriptClass::setCameraDirection
void setCameraDirection(vector3 direction)
Sets the camera's direction vector.
Script2Game::GameScriptClass::getPersonRotation
radian getPersonRotation()
Script2Game::GameScriptClass::quitGame
void quitGame()
Quits the game.
Script2Game::GameScriptClass::addWaypoint
void addWaypoint(vector3 pos)
Script2Game::GameScriptClass::getTruckByNum
BeamClass getTruckByNum(int truck_number)
Get an actor by Instance ID, get one from eventCallbackEx() or manually by BeamClass::getInstanceId()...
Script2Game::GameScriptClass::getCurrentTruckAI
VehicleAIClass getCurrentTruckAI()
Script2Game::GameScriptClass::stopTimer
float stopTimer()
Stops the timer.
Script2Game::GameScriptClass::moveObjectVisuals
void moveObjectVisuals(const string instanceName, const vector3 pos)
This moves an object to a new position.
Script2Game::GameScriptClass::rangeRandom
float rangeRandom(float from, float to)
Generates a random number between from and to.
RoR::FreeBeamGfxID_t
int FreeBeamGfxID_t
Index into GfxScene::m_gfx_freebeams, use RoR::FREEBEAMGFXID_INVALID as empty value.
Definition: ForwardDeclarations.h:93
Script2Game::GameScriptClass::setChatFontSize
void setChatFontSize(int size)
OBSOLETE - does nothing.
Script2Game::GameScriptClass::pushMessage
bool pushMessage(MsgType type, dictionary@ dict)
Pushes a message to internal message queue.
Script2Game::TerrainClass
Binding of RoR::Terrain; represents a loaded terrain.
Definition: TerrainClass.h:16
Script2Game::BeamClass
Binding of RoR::Actor; a softbody-physics gameplay object, can be anything from soda can to space shu...
Definition: BeamClass.h:15
Script2Game::GameScriptClass::getMousePositionOnTerrain
bool getMousePositionOnTerrain(vector3 &out)
Calculates mouse cursor position on terrain.
Script2Game::GameScriptClass::setCameraPitch
void setCameraPitch(float angle)
Pitches the camera up/down anticlockwise around it's local z axis.
Script2Game::GameScriptClass::updateDirectionArrow
void updateDirectionArrow(string text, vector3 position)
set direction arrow
Script2Game::GameScriptClass::startTimer
void startTimer()
Starts a timer (useful for races etc)
Script2Game::GameScriptClass::removeVehicle
void removeVehicle(string instance, string box)
This method removes the vehicle in the box.
Script2Game::GameScriptClass::openUrlInDefaultBrowser
void openUrlInDefaultBrowser(const std::string &url)
Opens URL (must start with 'http://' or 'https://') in system's default web browser.
Script2Game::GameScriptClass::setCameraPosition
void setCameraPosition(vector3 position)
Sets the camera's position.
Script2Game::GameScriptClass::setGravity
void setGravity(float value)
sets the gravity terrain wide.
Script2Game::GameScriptClass::deleteResource
bool deleteResource(const string &in filename, const string &in resource_group)
Deletes a resource from the given group.
Script2Game::GameScriptClass::setAIVehicleName
void setAIVehicleName(int x, string name)
Script2Game::GameScriptClass::getAIVehiclePositionScheme
int getAIVehiclePositionScheme()
Script2Game::GameScriptClass::getAIVehicleDistance
int getAIVehicleDistance()
Script2Game::VehicleAIClass
Binding of RoR::VehicleAI; Vehicle driving AI using waypoints.
Definition: VehicleAIClass.h:63
Script2Game::GameScriptClass::fetchUrlAsStringAsync
void fetchUrlAsStringAsync(const std::string &url, const std::string &display_filename)
Invokes a background thread to fetch data using CURL; when finished, sends MSG_APP_SCRIPT_THREAD_STAT...
Script2Game::GameScriptClass::showMessageBox
void showMessageBox(string mTitle, stringmText, bool button1, stringmButton1, bool AllowClose, bool button2, stringmButton2)
Shows a message box.
Script2Game::GameScriptClass::setAIMode
void setAIMode(int mode)
Script2Game
Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.
Definition: BeamClass.h:2
Script2Game::GameScriptClass::setAIVehicleDistance
void setAIVehicleDistance(int dist)
Script2Game::GameScriptClass::getTime
double getTime()
returns the time in seconds since the game was started
Script2Game::GameScriptClass::backToMenu
void backToMenu()
Back to menu.
Script2Game::GameScriptClass::checkResourceExists
bool checkResourceExists(const string &in filename, const string &in resource_group)
Checks if the resource file exists in the given group.
Script2Game::GameScriptClass::getAIVehicleSectionConfig
Ogre::String getAIVehicleSectionConfig(int x)
Script2Game::GameScriptClass::setAIVehicleSkin
void setAIVehicleSkin(int x, string skin)
Script2Game::GameScriptClass::spawnObject
void spawnObject(const string objectName, const string instanceName, vector3 pos, vector3 rot, const string eventhandler, bool uniquifyMaterials)
This spawns an object.
Script2Game::GameScriptClass::getCurrentTruckNumber
int getCurrentTruckNumber()
returns the instance ID of current player vehicle, or -1 when in person mode
Script2Game::GameScriptClass::getChatFontSize
int getChatFontSize()
OBSOLETE - returns 0.
Script2Game::GameScriptClass::getWaterHeight
float getWaterHeight()
returns the current base water level (without waves)
Script2Game::GameScriptClass::getLoadedTerrain
int getLoadedTerrain(string result)
Gets the currently loaded terrain name.
Script2Game::GameScriptClass::showChooser
void showChooser(string type, string instance, string box)
This shows a vehicle chooser.
Script2Game::GameScriptClass::getMousePointedMovableObjects
array< Ogre::MovableObjects@> getMousePointedMovableObjects()
Returns array<Ogre::MovableObjects@> in no particular order; works using bounding boxes so large/gene...
Script2Game::GameScriptClass
Binding of RoR::GameScript; A general class that will provide you with general functions.
Definition: GameScriptClass.h:35
Script2Game::GameScriptClass::scriptFunctionExists
ScriptRetCode scriptFunctionExists(const string func, ScriptUnitId_t nid=-2)
Checks if a global function exists.
Script2Game::GameScriptClass::getFreeBeamGfxNextId
FreeBeamGfxID_t getFreeBeamGfxNextId()
Returns an unused (not reused) ID to use with MSG_SIM_ADD_FREEBEAMGFX_REQUESTED; see game....
Script2Game::GameScriptClass::addScriptVariable
ScriptRetCode addScriptVariable(const string var, ScriptUnitId_t nid=-2)
Adds a global variable to the script.
Script2Game::GameScriptClass::setPersonPosition
void setPersonPosition(vector3 vec)
sets the character position
Script2Game::GameScriptClass::useOnlineAPI
int useOnlineAPI(const string apiquery, const dictionary dict, string result)
Sends or request information from the master server.
Script2Game::GameScriptClass::setAIRepeatTimes
void setAIRepeatTimes(int times)
Script2Game::GameScriptClass::getAllSoundScriptTemplates
array< SoundScriptTemplateClass > getAllSoundScriptTemplates()
Script2Game::GameScriptClass::setWaterHeight
void setWaterHeight(float value)
sets the base water height
Script2Game::GameScriptClass::setMaterialTextureRotate
int setMaterialTextureRotate(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float rotation)
Script2Game::GameScriptClass::getActorNextInstanceId
int getActorNextInstanceId()
Returns an unused (not reused) ID to use with MSG_SIM_SPAWN_ACTOR_REQUESTED; see game....
Script2Game::GameScriptClass::getAIRepeatTimes
int getAIRepeatTimes()
Script2Game::GameScriptClass::setRegisteredEventsMask
void setRegisteredEventsMask(ScriptUnitId_t nid, BitMask_t eventMask)
Overwrites event mask for a specific running script.
Script2Game::GameScriptClass::setMaterialDiffuse
int setMaterialDiffuse(const string materialName, float red, float green, float blue, float alpha)
Script2Game::GameScriptClass::getNumTrucksByFlag
int getNumTrucksByFlag(int flag)
Number of trucks with flag.
Script2Game::GameScriptClass::getScriptDetails
dictionary getScriptDetails(int nid)
Returns all info about running script; obtain the NID from getRunningScripts(), global var thisScript...
Script2Game::GameScriptClass::setPersonRotation
void setPersonRotation(radian &in)
Script2Game::GameScriptClass::getSoundScriptTemplate
SoundScriptTemplateClass getSoundScriptTemplate(const string &in name)
Retrieves one sound script template by name.
Script2Game::GameScriptClass::getDisplaySize
vector2 getDisplaySize()
Gets screen size in pixels.
RoR::FreeForceID_t
int FreeForceID_t
Unique sequentially generated ID of FreeForce; use ActorManager::GetFreeForceNextId().
Definition: ForwardDeclarations.h:67
Script2Game::GameScriptClass::sendGameCmd
int sendGameCmd(const string &message)
Multiplayer only: sends AngelScript snippet to all players.
Script2Game::GameScriptClass::setTrucksForcedAwake
void setTrucksForcedAwake(bool forceActive)
Script2Game::GameScriptClass::flashMessage
void flashMessage(string message, float time, float charHeight)
shows a message to the user
Script2Game::GameScriptClass::createSoundScriptInstance
SoundScriptInstanceClass createSoundScriptInstance(const string &in template_name, int actor_instance_id=-1)
Script2Game::GameScriptClass::getEditorObjects
array< TerrainEditorObjectClassPtr@> getEditorObjects()
Returns all static objects on map (from any source).
Script2Game::GameScriptClass::getRunningScripts
array< int > getRunningScripts()
Returns active ScriptUnitIDs; check agains global var thisScript or use getScriptDetails() to get nam...
Script2Game::GameScriptClass::getCaelumAvailable
bool getCaelumAvailable()
Checks if Caleum is enabled.
Script2Game::GameScriptClass::getScreenPosFromWorldPos
bool getScreenPosFromWorldPos(const vector3 &in, vector2 &out)
Script2Game::GameScriptClass::getRegisteredEventsMask
BitMask_t getRegisteredEventsMask(ScriptUnitId_t nid)
Gets event mask for a specific running script.
Script2Game::SoundScriptTemplateClass
Binding of RoR::SoundScriptTemplate; a customizable sound effect.
Definition: SoundScriptTemplateClass.h:16
Script2Game::GameScriptClass::destroyObject
void destroyObject(const string instanceName)
This destroys an object.
Script2Game::GameScriptClass::getAvgFPS
void getAvgFPS()
Gets the average frames per second (FPS)
Script2Game::SoundScriptInstanceClass
Binding of RoR::SoundScriptInstance; instance of SoundScriptTemplateClass.
Definition: SoundScriptInstanceClass.h:17
Script2Game::GameScriptClass::setAIVehicleSpeed
void setAIVehicleSpeed(int speed)
Script2Game::GameScriptClass::createTextResourceFromString
bool createTextResourceFromString(const string &in, const string &in filename, const string &in resource_group, bool overwrite=false)
Saves a string as a text file resource.
Script2Game::GameScriptClass::getFreeForceNextId
FreeForceID_t getFreeForceNextId()
Returns an unused (not reused) ID to use with MSG_SIM_ADD_FREEFORCE_REQUESTED; see game....
Script2Game::GameScriptClass::deleteScriptVariable
ScriptRetCode deleteScriptVariable(const string var, ScriptUnitId_t nid=-2)
Removes a global variable from the script.
Script2Game::GameScriptClass::setMaterialEmissive
int setMaterialEmissive(const string materialName, float red, float green, float blue)
Script2Game::GameScriptClass::hideDirectionArrow
void hideDirectionArrow()
Hides the direction arrow.
Script2Game::GameScriptClass::getMouseScreenPosition
Ogre::Vector2 getMouseScreenPosition()
Gets mouse position in pixels.
Script2Game::GameScriptClass::getCameraPosition
vector3 getCameraPosition()
Retrieves the camera's position.
Script2Game::GameScriptClass::setMaterialTextureScroll
int setMaterialTextureScroll(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float sx, float sy)
Script2Game::GameScriptClass::getAIVehicleSpeed
int getAIVehicleSpeed()
instance
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single instance
Definition: ReadMe.txt:53
Script2Game::GameScriptClass::getTruckRemotelyReceivingCommands
BeamClass getTruckRemotelyReceivingCommands()
Actors with 'importcommands' flag will remotely respond to command keys when the player is close enou...
Script2Game::GameScriptClass::repairVehicle
void repairVehicle(string instance, string box, bool keepPosition)
This method repairs the vehicle in the box.
Script2Game::GameScriptClass::getCaelumTime
string getCaelumTime()
gets the time of the day in seconds
Script2Game::GameScriptClass::getGroundHeight
float getGroundHeight(vector3 position)
returns the ground height for a position
Script2Game::GameScriptClass::getAllTrucks
array< BeamClass@> getAllTrucks()
returns an array of all currently existing actors.
Script2Game::GameScriptClass::setMaterialAmbient
int setMaterialAmbient(const string materialName, float red, float green, float blue)
Script2Game::GameScriptClass::spawnTruck
BeamClass spawnTruck(stringtruckName, vector3 pos, vector3 rot)
Spawns a truck by filename.
Script2Game::GameScriptClass::getGravity
float getGravity()
returns the currently set upo gravity
Script2Game::GameScriptClass::spawnTruckAI
BeamClass spawnTruckAI(string truckName, vector3 pos, string truckSectionConfig, string truckSkin, int x)
Script2Game::ScriptRetCode
ScriptRetCode
Binding of RoR::ScriptRetCode; Common return codes for script manipulation funcs (add/get/delete | fu...
Definition: globals.h:687
Script2Game::GameScriptClass::deleteScriptFunction
ScriptRetCode deleteScriptFunction(const string func, ScriptUnitId_t nid=-2)
Removes a global function from the script.
Script2Game::GameScriptClass::addScriptFunction
ScriptRetCode addScriptFunction(const string func, ScriptUnitId_t nid=-2)
Adds a global function to the script.
Script2Game::GameScriptClass::getAIVehicleSkin
std::string getAIVehicleSkin(int x)
Script2Game::GameScriptClass::setCaelumTime
void setCaelumTime(float value)
sets the time of the day in seconds
Script2Game::GameScriptClass::getTruckAIByNum
VehicleAIClass getTruckAIByNum(int num)
Script2Game::GameScriptClass::setAIVehicleCount
void setAIVehicleCount(int count)
Script2Game::GameScriptClass::createSoundFromResource
SoundClass createSoundFromResource(const string &in filename, const string &in resource_group_name=string())
Script2Game::GameScriptClass::loadTextResourceAsString
std::string loadTextResourceAsString(const string &in filename, const string &in resource_group)
Loads a text file resource as string.
Script2Game::GameScriptClass::setAIVehiclePositionScheme
void setAIVehiclePositionScheme(int scheme)
BitMask_t
uint32_t BitMask_t
Definition: BitFlags.h:7
Script2Game::GameScriptClass::movePerson
void movePerson(vector3 relative_movement)
moves the person relative
Script2Game::GameScriptClass::getFPS
void getFPS()
Gets the Curent frames per second (FPS)
Script2Game::GameScriptClass::setCameraYaw
void setCameraYaw(float angle)
Rotates the camera anticlockwise around it's local y axis.
Script2Game::GameScriptClass::getAIVehicleCount
int getAIVehicleCount()
Script2Game::GameScriptClass::getAIVehicleName
Ogre::String getAIVehicleName(int x)
Script2Game::GameScriptClass::setMaterialTextureScale
int setMaterialTextureScale(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float u, float v)
Script2Game::GameScriptClass::setCameraRoll
void setCameraRoll(float angle)
Rolls the camera anticlockwise, around its local z axis.
Script2Game::GameScriptClass::message
void message(string txt, string icon, float timeMilliseconds, bool forceVisible)
shows a message to the user
Script2Game::GameScriptClass::registerForEvent
void registerForEvent(int eventValue)
registers for a new event to be received by the scripting system
Script2Game::GameScriptClass::getSceneManager
AngelOgre::SceneManager getSceneManager()
Retrieves the OGRE scene manager object.
Script2Game::GameScriptClass::getAllSoundScriptInstances
array< SoundScriptInstanceClass > getAllSoundScriptInstances()
Diagnostic function, returns all existing sound script instances.
AngelOgre::SceneManager
Encapsulates everything renderable by OGRE - use game.getSceneManager() to get it.
Definition: AngelOgre_SceneManager.h:14
Script2Game::GameScriptClass::getPersonPosition
vector3 getPersonPosition()
Returns the current position of the person.
Script2Game::GameScriptClass::boostCurrentTruck
void boostCurrentTruck(float factor)
Gives the currently used truck a boost in RPM.
Script2Game::GameScriptClass::scriptVariableExists
ScriptRetCode scriptVariableExists(const string var, ScriptUnitId_t nid=-2)
Checks if a global variable exists in the script.
Script2Game::GameScriptClass::log
void log(string message)
writes a message to the scripting logbook (AngelScript.log)
Script2Game::GameScriptClass::setMaterialTextureName
int setMaterialTextureName(const string materialName, int techniqueNum, int passNum, int textureUnitNum, const string textureName)
Script2Game::GameScriptClass::cameraLookAt
void cameraLookAt(vector3 targetPoint)
Points the camera at a location in worldspace.
x
float x
Definition: (ValueTypes) quaternion.h:5
Script2Game::MsgType
MsgType
Binding of RoR::MsgType; Global gameplay message loop.
Definition: globals.h:618
Script2Game::GameScriptClass::setAIVehicleSectionConfig
void setAIVehicleSectionConfig(int x, string config)
Script2Game::GameScriptClass::getCurrentTruck
BeamClass getCurrentTruck()
returns the current selected truck, null if in person mode
Script2Game::GameScriptClass::unRegisterEvent
void unRegisterEvent(int eventValue)
unregisters from receiving event.
Script2Game::GameScriptClass::getTerrain
TerrainClass getTerrain()
Gets the currently loaded terrain instance.