RigsofRods
Soft-body Physics Simulation
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 
266 
272  void setRegisteredEventsMask(ScriptUnitId_t nid, BitMask_t eventMask);
273 
278  int addScriptFunction(const string func);
279 
284  int scriptFunctionExists(const string func);
285 
290  int deleteScriptFunction(const string func);
291 
296  int addScriptVariable(const string var);
297 
302  int deleteScriptVariable(const string var);
303 
307  void clearEventCache();
308 
312  int sendGameCmd(const string& message);
313 
317  array<int> getRunningScripts();
318 
327  dictionary@ getScriptDetails(int nid);
328 
330 
333 
342  void loadTerrain(string terrain);
343 
349  int getLoadedTerrain(string result);
350 
355 
360  bool getCaelumAvailable();
361 
366  string getCaelumTime();
367 
372  void setCaelumTime(float value);
373 
378  float getGravity();
379 
384  void setGravity(float value);
385 
390  float getWaterHeight();
391 
397  float getGroundHeight(vector3 position);
398 
403  void setWaterHeight(float value);
404 
414  void spawnObject(const string objectName, const string instanceName, vector3 pos, vector3 rot, const string eventhandler, bool uniquifyMaterials);
415 
422  void moveObjectVisuals(const string instanceName, const vector3 pos);
423 
429  void destroyObject(const string instanceName);
430 
436  bool getMousePositionOnTerrain(vector3 &out);
437 
439 
442 
447  vector3 getPersonPosition();
448 
453  void setPersonPosition(vector3 vec);
454 
459  void movePerson(vector3 relative_movement);
460 
461  void setPersonRotation(radian &in);
462 
463  radian getPersonRotation();
464 
466 
469 
470  void activateAllVehicles();
471 
472  void setTrucksForcedAwake(bool forceActive);
473 
478  void boostCurrentTruck(float factor);
479 
486 
493  BeamClass@ getTruckByNum(int truck_number);
494 
498  array<BeamClass@> getAllTrucks();
499 
503  int getCurrentTruckNumber();
504 
513  BeamClass @spawnTruck(stringtruckName, vector3 pos, vector3 rot);
514 
518  void repairVehicle(string instance, string box, bool keepPosition);
519 
523  void removeVehicle(string instance, string box);
524 
528  int getNumTrucksByFlag(int flag);
529 
531 
535 
536  BeamClass@ spawnTruckAI(string truckName, vector3 pos, string truckSectionConfig, string truckSkin, int x);
537  array<vector3>@ getWaypoints(int x);
538  void addWaypoint(vector3 pos);
539  int getAIVehicleCount();
540  int getAIVehicleDistance();
542  int getAIVehicleSpeed();
543  Ogre::String getAIVehicleName(int x);
544  Ogre::String getAIVehicleSectionConfig(int x);
545  std::string getAIVehicleSkin(int x);
546  int getAIRepeatTimes();
547  int getAIMode();
550 
551  // AI: set
552  void setAIVehicleCount(int count);
553  void setAIVehicleDistance(int dist);
554  void setAIVehiclePositionScheme(int scheme);
555  void setAIVehicleSpeed(int speed);
556  void setAIVehicleName(int x, string name);
557  void setAIVehicleSectionConfig(int x, string config);
558  void setAIVehicleSkin(int x, string skin);
559  void setAIRepeatTimes(int times);
560  void setAIMode(int mode);
561 
563 
566 
571  void setCameraPosition(vector3 position);
572 
577  void setCameraDirection(vector3 direction);
578 
583  void setCameraRoll(float angle);
584 
589  void setCameraYaw(float angle);
590 
595  void setCameraPitch(float angle);
596 
601  vector3 getCameraPosition();
602 
607  vector3 getCameraDirection();
608 
617  void cameraLookAt(vector3 targetPoint);
618 
620 
623 
629  float stopTimer();
630 
635  void startTimer();
636 
638 
641 
642  int setMaterialAmbient(const string materialName, float red, float green, float blue);
643  int setMaterialDiffuse(const string materialName, float red, float green, float blue, float alpha);
644  int setMaterialSpecular(const string materialName, float red, float green, float blue, float alpha);
645  int setMaterialEmissive(const string materialName, float red, float green, float blue);
646 
647  int setMaterialTextureName(const string materialName, int techniqueNum, int passNum, int textureUnitNum, const string textureName);
648  int setMaterialTextureRotate(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float rotation);
649  int setMaterialTextureScroll(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float sx, float sy);
650  int setMaterialTextureScale(const string materialName, int techniqueNum, int passNum, int textureUnitNum, float u, float v);
651 
653 
656 
657  array<SoundScriptTemplateClass> getAllSoundScriptTemplates();
658 
662  SoundScriptTemplateClass getSoundScriptTemplate(const string &in name);
663 
667  array<SoundScriptInstanceClass> getAllSoundScriptInstances();
668 
673  SoundClass createSoundFromResource(const string &in filename, const string &in resource_group_name = string());
674 
680  SoundScriptInstanceClass createSoundScriptInstance(const string &in template_name, int actor_instance_id = -1);
681 
683 };
684 
687 
688 } //namespace Script2Game
Script2Game::GameScriptClass::getCameraDirection
vector3 getCameraDirection()
Gets the camera's direction.
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.
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::addScriptFunction
int addScriptFunction(const string func)
Adds a global function to the script.
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
Binding of RoR::GameScript; A general class that will provide you with general functions.
Definition: GameScriptClass.h:35
Script2Game::GameScriptClass::deleteScriptVariable
int deleteScriptVariable(const string var)
Removes a global variable from 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::scriptFunctionExists
int scriptFunctionExists(const string func)
Checks if a global function exists.
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::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)
RoR::ScriptUnitId_t
int ScriptUnitId_t
Unique sequentially generated ID of a loaded and running scriptin session. Use ScriptEngine::getScrip...
Definition: ForwardDeclarations.h:40
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.
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::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::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::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::GameScriptClass::getAIVehicleSkin
std::string getAIVehicleSkin(int x)
Script2Game::GameScriptClass::deleteScriptFunction
int deleteScriptFunction(const string func)
Removes a global function from the script.
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::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:604
Script2Game::GameScriptClass::setAIVehicleSectionConfig
void setAIVehicleSectionConfig(int x, string config)
Script2Game::GameScriptClass::addScriptVariable
int addScriptVariable(const string var)
Adds a global variable to the script.
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.