Info
This is the EmptyEpsilon script reference for this version of EmptyEpsilon. By no means this is a guide to help you scripting, you should check
emptyepsilon.org for the guide on scripting.As well as check the already existing scenario and ship data files on how to get started.
Functions
- addGMFunction
- addGMFunction(name, function) Add a function that can be called from the GM console. This can be used to create helper scripts for the GM. Or to give the GM console certain control over the scenario.
- removeGMFunction
- removeGMFunction(name) Remove a function from the GM console
- clearGMFunctions
- clearGMFunctions() Remove all the GM functions from the GM console.
- getGMSelection
- getGMSelection() Returns an list of objects that the GM currently has selected.
- addGMMessage
- addGMMessage(message) shows a message on the GM screen
- setCommsMessage
- setCommsMessage(message) Sets the message/reply shown to the comms officer.
- addCommsReply
- addCommsReply(message, function) Add an reply option for communications.
- victory
- victory(string) Called with a faction name as parameter, sets a certain faction as victor and ends the game.
- globalMessage
- globalMessage(string) Show a global message on the main screens of all active player ships.
- setBanner
- setBanner(string) Show a scrolling banner containing this text on the cinematic and top down views.
- getPlayerShip
- getPlayerShip(index) Return the player's ship, use -1 to get the first active player ship.
- getObjectsInRadius
- getObjectsInRadius(x, y, radius) Return a list of all space objects at the x,y location within a certain radius.
- getAllObjects
- getAllObjects() Return a list of all space objects. (Use with care, this could return a very long list which could slow down the game when called every update)
- getScenarioVariation
- getScenarioVariation() Returns the currently used scenario variation.
- setScenario
- setScenario(script_name, variation_name) Change the current scenario to a different one.
- shutdownGame
- Shutdown the game. Calling this function will close the game. Mainly usefull for a headless server setup.
- getLongRangeRadarRange
- Return the long range radar range, normally 30.000, but can be configured per game.
- playSoundFile
- Play a sound file on the server. Will work with any file supported by SFML (.wav, .ogg, .flac) Note that the sound is only played on the server. Not on any of the clients.
- require
- require(filename) Run the script with the given filename in the same context as the current running script.
A blackhole has a 5km radius where it pulls in all near objects. At the center of the black hole everything gets a lot of damage. Which will lead to the eventual destruction of said object.
Subclass of:
SpaceObject
BeamEffect is a beam weapon fire effect that will fade after 1 seond Example: BeamEffect():setSource(player):setTarget(enemy_ship)
Subclass of:
SpaceObject- BeamEffect:setSource(P<SpaceObject> source, sf::Vector3f offset)
- BeamEffect:setTarget(P<SpaceObject> target, sf::Vector2f hitLocation)
- BeamEffect:setTexture(string texture)
- BeamEffect:setBeamFireSound(string sound)
- BeamEffect:setBeamFireSoundPower(float power)
- BeamEffect:setDuration(float duration)
- BeamEffect:setRing(bool ring)
Subclass of:
ShipTemplateBasedObject- SpaceShip:isFriendOrFoeIdentified()
- SpaceShip:isFullyScanned()
- SpaceShip:isFriendOrFoeIdentifiedBy(P<SpaceObject> other)
- SpaceShip:isFullyScannedBy(P<SpaceObject> other)
- SpaceShip:isFriendOrFoeIdentifiedByFaction(int faction_id)
- SpaceShip:isFullyScannedByFaction(int faction_id)
- SpaceShip:isDocked(P<SpaceObject> target)
- SpaceShip:getTarget()
- SpaceShip:getWeaponStorage(EMissileWeapons weapon)
- SpaceShip:getWeaponStorageMax(EMissileWeapons weapon)
- SpaceShip:setWeaponStorage(EMissileWeapons weapon, int amount)
- SpaceShip:setWeaponStorageMax(EMissileWeapons weapon, int amount)
- SpaceShip:getShieldsFrequency(void)
- SpaceShip:setShieldsFrequency(float freq)
- SpaceShip:getBeamFrequency()
- SpaceShip:getMaxEnergy()
- SpaceShip:setMaxEnergy(float amount)
- SpaceShip:getEnergy()
- SpaceShip:setEnergy(float amount)
- SpaceShip:getSystemHealth(ESystem system)
- SpaceShip:setSystemHealth(ESystem system, float health)
- SpaceShip:getSystemHeat(ESystem system)
- SpaceShip:setSystemHeat(ESystem system, float heat)
- SpaceShip:getSystemPower(ESystem system)
- SpaceShip:setSystemPower(ESystem system, float power)
- SpaceShip:getSystemCoolant(ESystem system)
- SpaceShip:setSystemCoolant(ESystem system, float coolant)
- SpaceShip:getImpulseMaxSpeed()
- SpaceShip:setImpulseMaxSpeed(float speed)
- SpaceShip:getRotationMaxSpeed()
- SpaceShip:setRotationMaxSpeed(float speed)
- SpaceShip:setCombatManeuver(float boost, float strafe)
- SpaceShip:hasJumpDrive()
- SpaceShip:setJumpDrive(bool has_jump)
- SpaceShip:setJumpDriveRange(float min, float max)
- SpaceShip:hasWarpDrive()
- SpaceShip:setWarpDrive(bool has_warp)
- SpaceShip:getBeamWeaponArc(int index)
- SpaceShip:getBeamWeaponDirection(int index)
- SpaceShip:getBeamWeaponRange(int index)
- SpaceShip:getBeamWeaponTurretArc(int index)
- SpaceShip:getBeamWeaponTurretDirection(int index)
- SpaceShip:getBeamWeaponCycleTime(int index)
- SpaceShip:getBeamWeaponDamage(int index)
- SpaceShip:getBeamWeaponEnergyPerFire(int index)
- SpaceShip:getBeamWeaponHeatPerFire(int index)
- SpaceShip:setBeamWeapon(int index, float arc, float direction, float range, float cycle_time, float damage)
- SpaceShip:setBeamWeaponTurret(int index, float arc, float direction, float rotation_rate)
- SpaceShip:setBeamWeaponTexture(int index, string texture)
- SpaceShip:setBeamWeaponEnergyPerFire(int index, float energy)
- SpaceShip:setBeamWeaponHeatPerFire(int index, float heat)
- SpaceShip:setWeaponTubeCount(int amount)
- SpaceShip:getWeaponTubeCount()
- SpaceShip:getWeaponTubeLoadType(int index)
- SpaceShip:weaponTubeAllowMissle(int index, EMissileWeapons type)
- SpaceShip:weaponTubeDisallowMissle(int index, EMissileWeapons type)
- SpaceShip:setWeaponTubeExclusiveFor(int index, EMissileWeapons type)
- SpaceShip:setWeaponTubeDirection(int index, float direction)
- SpaceShip:setRadarTrace(string trace)
- Set the icon to be used for this ship on the radar. For example, ship:setRadarTrace("RadarBlip.png") will show a dot instead of an arrow for this ship. Note: Icon is only shown after scanning, before the ship is scanned it is always shown as an arrow.
- SpaceShip:addBroadcast(int threshold, string message)
ExplosionEffect is a visible explosion, like from nukes, missiles, ship destruction, etc Example: ExplosionEffect():setPosition(500,5000):setSize(20)
Subclass of:
SpaceObject- ExplosionEffect:setSize(float size)
- FactionInfo:setName(string name)
- FactionInfo:setGMColor(int r, int g, int b)
- FactionInfo:setDescription(string description)
- FactionInfo:setEnemy(P<FactionInfo> other)
- FactionInfo:setFriendly(P<FactionInfo> other)
- FactionInfo:isValid()
- Check if this is still looking at a valid object. Returns false when the objects that this variable references is destroyed.
- FactionInfo:destroy()
- Removes this object from the game.
- FactionInfo:typeName
- Returns the class name of this object, this is not a function, but a direct member: if object.typeName == "Mine" then print("MINE!") end
- ModelData:setName(string name)
- ModelData:setMesh(string mesh_name)
- ModelData:setTexture(string texture_name)
- ModelData:setSpecular(string specular_texture_name)
- ModelData:setIllumination(string illumination_texture_name)
- ModelData:setRenderOffset(sf::Vector3f mesh_offset)
- ModelData:setScale(float scale)
- ModelData:setRadius(float radius)
- ModelData:setCollisionBox(sf::Vector2f collision_box)
- ModelData:addBeamPosition(sf::Vector3f position)
- ModelData:addTubePosition(sf::Vector3f position)
- ModelData:addEngineEmitor(sf::Vector3f position, sf::Vector3f color, float scale)
- ModelData:addEngineEmitter(sf::Vector3f position, sf::Vector3f color, float scale)
- ModelData:isValid()
- Check if this is still looking at a valid object. Returns false when the objects that this variable references is destroyed.
- ModelData:destroy()
- Removes this object from the game.
- ModelData:typeName
- Returns the class name of this object, this is not a function, but a direct member: if object.typeName == "Mine" then print("MINE!") end
A planet.
Subclass of:
SpaceObject- Planet:setPlanetAtmosphereColor(float r, float g, float b)
- Planet:setPlanetAtmosphereTexture(string texture_name)
- Planet:setPlanetSurfaceTexture(string texture_name)
- Planet:setPlanetCloudTexture(string texture_name)
- Planet:setPlanetRadius(float size)
- Planet:setPlanetCloudRadius(float size)
- Planet:setDistanceFromMovementPlane(float distance_from_movement_plane)
- Planet:setAxialRotationTime(float time)
- Planet:setOrbit(P<SpaceObject> target, float orbit_time)
A mine object. Simple, effective, deadly.
Subclass of:
SpaceObject
Subclass of:
SpaceObject- ShipTemplateBasedObject:setTemplate(string template_name)
- Set the ship template to be used for this station. Stations use ship-templates to define hull/shields/looks
- ShipTemplateBasedObject:setShipTemplate(string template_name)
- [Depricated]
- ShipTemplateBasedObject:setTypeName(string type_name)
- Set the class name of this object. Normally the class name is copied from the template name (Ex "Cruiser") but you can override it with this function.
- ShipTemplateBasedObject:getTypeName()
- ShipTemplateBasedObject:getHull()
- Get the current amount of hull
- ShipTemplateBasedObject:getHullMax()
- Get the maximum hull value
- ShipTemplateBasedObject:setHull(float amount)
- Set the current hull value, note that setting this to 0 does not destroy the station.
- ShipTemplateBasedObject:setHullMax(float amount)
- Set the maximum amount of hull for this station. Stations never repair hull damage, so this only effects the percentage displays
- ShipTemplateBasedObject:setCanBeDestroyed(bool enabled)
- Set if the object can be destroyed or not. true or false
- ShipTemplateBasedObject:getCanBeDestroyed()
- Get if the object can be destroyed or not. true or false
- ShipTemplateBasedObject:getShieldLevel(int index)
- Get the current shield level, stations only have a single shield, unlike ships that have a front&back shield
- ShipTemplateBasedObject:getShieldCount()
- Get the amount of shields fit on this object.
- ShipTemplateBasedObject:getShieldMax(int index)
- Get the maxium shield level.
- ShipTemplateBasedObject:setShields(std::vector<float> amounts)
- Set the current amount of shields.
- ShipTemplateBasedObject:setShieldsMax(std::vector<float> amounts)
- Set the maximum shield level. Note that this does low the current shield level when the max becomes lower, but it does not increase the shield level. A seperate call to setShield is needed for that.
- ShipTemplateBasedObject:setRadarTrace(string trace)
- Set the icon to be used for this station on the radar. For example, station:setRadarTrace("RadarArrow.png") will show an arrow instead of a dot for this station.
- ShipTemplateBasedObject:getShieldsActive()
- Are the shields online or not. Currently always returns true except for player ships, as only players can turn off shields.
- ShipTemplateBasedObject:getSharesEnergyWithDocked()
- ShipTemplateBasedObject:setSharesEnergyWithDocked(bool enabled)
- ShipTemplateBasedObject:getRepairDocked()
- ShipTemplateBasedObject:setRepairDocked(bool enabled)
- ShipTemplateBasedObject:getRestocksScanProbes()
- ShipTemplateBasedObject:setRestocksScanProbes(bool enabled)
- ShipTemplateBasedObject:getFrontShield()
- [Depricated]
- ShipTemplateBasedObject:getFrontShieldMax()
- [Depricated]
- ShipTemplateBasedObject:setFrontShield(float amount)
- [Depricated]
- ShipTemplateBasedObject:setFrontShieldMax(float amount)
- [Depricated]
- ShipTemplateBasedObject:getRearShield()
- [Depricated]
- ShipTemplateBasedObject:getRearShieldMax()
- [Depricated]
- ShipTemplateBasedObject:setRearShield(float amount)
- [Depricated]
- ShipTemplateBasedObject:setRearShieldMax(float amount)
- [Depricated]
- ShipTemplateBasedObject:onTakingDamage(ScriptSimpleCallback callback)
- Set a function that will be called if the object is taking damage. First argument given to the function will be the object taking damage, the second the instigator SpaceObject (or nil).
- ShipTemplateBasedObject:onDestruction(ScriptSimpleCallback callback)
- Set a function that will be called if the object is destroyed by taking damage. First argument given to the function will be the object taking damage, the second the instigator SpaceObject that gave the final blow (or nil).
An artifact. Can be used for mission scripting.
Subclass of:
SpaceObject- Artifact:setModel(string name)
- Set the 3D model used for this artifact. Example: setModel("artifact6"), setModel("shield_generator"), setModel("ammo_box"). Check model_data.lua for all possible options.
- Artifact:explode()
- Have this object explode with a visual explosion. The Artifact is destroyed by this action.
- Artifact:allowPickup(bool allow)
- Set if this artifact can be picked up or not. When it is picked up, this artifact will be destroyed.
- Artifact:onPickUp(ScriptSimpleCallback callback)
- Set a function that will be called if a player picks up the artifact. First argument given to the function will be the artifact, the second the player.
Subclass of:
SpaceObject- WormHole:setTargetPosition(sf::Vector2f v)
- Set the target of this wormhole
- WormHole:getTargetPosition()
- WormHole:onTeleportation(ScriptSimpleCallback callback)
- Set a function that will be called if a SpaceObject is teleported. First argument given to the function will be the WormHole, the second the SpaceObject that has been teleported.
ElectricExplosionEffect is a visible electrical explosion, as seen from EMP missiles Example: ElectricExplosionEffect():setPosition(500,5000):setSize(20)
Subclass of:
SpaceObject- ElectricExplosionEffect:setSize(float size)
A zone area
Subclass of:
SpaceObject- Zone:setPoints(std::vector<sf::Vector2f> points)
- Zone:setColor(int r, int g, int b)
- Zone:setLabel(string label)
- Zone:isInside(P<SpaceObject> obj)
CpuShips are AI controlled ships. They can get different orders. Example: CpuShip():setTemplate("Fighter"):setPosition(random(-10000, 10000), random(0, 3000)):setFaction("Human Navy"):orderRoaming():setScanned(true)
Subclass of:
SpaceShip- CpuShip:setAI(string new_ai)
- Switch the AI to a different type. AI can be set per ship, or left per default which will be taken from the shipTemplate then.
- CpuShip:orderIdle()
- Order this ship to stand still and do nothing.
- CpuShip:orderRoaming()
- Order this ship to roam around the world and attack targets
- CpuShip:orderStandGround()
- Order this ship to stand still, but still target and try to hit nearby enemies
- CpuShip:orderDefendLocation(sf::Vector2f position)
- Order this ship to defend a specific location. It will attack enemies near this target.
- CpuShip:orderDefendTarget(P<SpaceObject> object)
- Order this ship to defend a specific object. It will attack enemies near this object.
- CpuShip:orderFlyFormation(P<SpaceObject> object, sf::Vector2f offset)
- Order this ship to fly in formation with another ship. It will attack nearby enemies.
- CpuShip:orderFlyTowards(sf::Vector2f target)
- Order this ship to fly to a location, attacking everything alogn the way.
- CpuShip:orderFlyTowardsBlind(sf::Vector2f target)
- Order this ship to fly to a location, without attacking anything
- CpuShip:orderAttack(P<SpaceObject> object)
- Order this ship to attack a specific target. If the target is destroyed it will fall back to roaming orders.
- CpuShip:orderDock(P<SpaceObject> object)
- Order this ship to dock at a specific object (station or otherwise)
- CpuShip:getOrder()
- Get the order this ship is executing
- CpuShip:getOrderTargetLocation()
- Get the target location of the currently executed order
- CpuShip:getOrderTarget()
- Get the target SpaceObject of the currently executed order
An asteroid in space. Which you can fly into and hit. Will do damage.
Subclass of:
SpaceObject- Asteroid:setSize(float size)
- Set the size of this asteroid, per default asteroids have a size of 120
An asteroid in space. Outside of hit range, just for visuals.
Subclass of:
SpaceObject- VisualAsteroid:setSize(float size)
- Set the size of this asteroid, per default asteroids have a size of 120
Subclass of:
SpaceShip- PlayerSpaceship:getWaypoint(int index)
- PlayerSpaceship:getWaypointCount()
- PlayerSpaceship:getAlertLevel()
- PlayerSpaceship:setShieldsActive(bool active)
- PlayerSpaceship:addToShipLog(string message, sf::Color color)
- PlayerSpaceship:transferPlayersToShip(P<PlayerSpaceship> other_ship)
- PlayerSpaceship:transferPlayersAtPositionToShip(ECrewPosition position, P<PlayerSpaceship> other_ship)
- PlayerSpaceship:hasPlayerAtPosition(ECrewPosition position)
- PlayerSpaceship:isCommsInactive()
- PlayerSpaceship:isCommsOpening()
- PlayerSpaceship:isCommsBeingHailed()
- PlayerSpaceship:isCommsBeingHailedByGM()
- PlayerSpaceship:isCommsFailed()
- PlayerSpaceship:isCommsBroken()
- PlayerSpaceship:isCommsClosed()
- PlayerSpaceship:isCommsChatOpen()
- PlayerSpaceship:isCommsChatOpenToGM()
- PlayerSpaceship:isCommsChatOpenToPlayer()
- PlayerSpaceship:isCommsScriptOpen()
- PlayerSpaceship:setEnergyLevel(float amount)
- PlayerSpaceship:setEnergyLevelMax(float amount)
- PlayerSpaceship:getEnergyLevel()
- PlayerSpaceship:getEnergyLevelMax()
- PlayerSpaceship:setMaxCoolant(float coolant)
- Set the maximum coolant available to engineering. Default is 10.
- PlayerSpaceship:getMaxCoolant()
- PlayerSpaceship:setScanProbeCount(int amount)
- PlayerSpaceship:getScanProbeCount()
- PlayerSpaceship:setMaxScanProbeCount(int amount)
- PlayerSpaceship:getMaxScanProbeCount()
- PlayerSpaceship:addCustomButton(ECrewPosition position, string name, string caption, ScriptSimpleCallback callback)
- PlayerSpaceship:addCustomInfo(ECrewPosition position, string name, string caption)
- PlayerSpaceship:addCustomMessage(ECrewPosition position, string name, string caption)
- PlayerSpaceship:addCustomMessageWithCallback(ECrewPosition position, string name, string caption, ScriptSimpleCallback callback)
- PlayerSpaceship:removeCustom(string name)
- PlayerSpaceship:getBeamSystemTarget()
- PlayerSpaceship:getBeamSystemTargetName()
- Gets the name of the target system, instead of the ID
- PlayerSpaceship:commandTargetRotation(float target)
- PlayerSpaceship:commandImpulse(float target)
- PlayerSpaceship:commandWarp(int8_t target)
- PlayerSpaceship:commandJump(float distance)
- PlayerSpaceship:commandSetTarget(P<SpaceObject> target)
- PlayerSpaceship:commandLoadTube(int8_t tubeNumber, EMissileWeapons missileType)
- PlayerSpaceship:commandUnloadTube(int8_t tubeNumber)
- PlayerSpaceship:commandFireTube(int8_t tubeNumber, float missile_target_angle)
- PlayerSpaceship:commandFireTubeAtTarget(int8_t tubeNumber, P<SpaceObject> target)
- PlayerSpaceship:commandSetShields(bool enabled)
- PlayerSpaceship:commandMainScreenSetting(EMainScreenSetting mainScreen)
- PlayerSpaceship:commandMainScreenOverlay(EMainScreenOverlay mainScreen)
- PlayerSpaceship:commandScan(P<SpaceObject> object)
- PlayerSpaceship:commandSetSystemPowerRequest(ESystem system, float power_level)
- PlayerSpaceship:commandSetSystemCoolantRequest(ESystem system, float coolant_level)
- PlayerSpaceship:commandDock(P<SpaceObject> station)
- PlayerSpaceship:commandUndock()
- PlayerSpaceship:commandAbortDock()
- PlayerSpaceship:commandOpenTextComm(P<SpaceObject> obj)
- PlayerSpaceship:commandCloseTextComm()
- PlayerSpaceship:commandAnswerCommHail(bool awnser)
- PlayerSpaceship:commandSendComm(uint8_t index)
- PlayerSpaceship:commandSendCommPlayer(string message)
- PlayerSpaceship:commandSetAutoRepair(bool enabled)
- PlayerSpaceship:commandSetBeamFrequency(int32_t frequency)
- PlayerSpaceship:commandSetBeamSystemTarget(ESystem system)
- PlayerSpaceship:commandSetShieldFrequency(int32_t frequency)
- PlayerSpaceship:commandAddWaypoint(sf::Vector2f position)
- PlayerSpaceship:commandRemoveWaypoint(int32_t index)
- PlayerSpaceship:commandMoveWaypoint(int32_t index, sf::Vector2f position)
- PlayerSpaceship:commandActivateSelfDestruct()
- PlayerSpaceship:commandCancelSelfDestruct()
- PlayerSpaceship:commandConfirmDestructCode(int8_t index, uint32_t code)
- PlayerSpaceship:commandCombatManeuverBoost(float amount)
- PlayerSpaceship:commandSetScienceLink(int32_t id)
- PlayerSpaceship:commandSetAlertLevel(EAlertLevel level)
- PlayerSpaceship:getRepairCrewCount()
- PlayerSpaceship:setRepairCrewCount(int amount)
- PlayerSpaceship:setAutoCoolant(bool active)
- PlayerSpaceship:setControlCode(string code)
- ScienceDatabase:setName(string name)
- ScienceDatabase:addEntry(string name)
- ScienceDatabase:addKeyValue(string key, string value)
- ScienceDatabase:setLongDescription(string text)
- ScienceDatabase:isValid()
- Check if this is still looking at a valid object. Returns false when the objects that this variable references is destroyed.
- ScienceDatabase:destroy()
- Removes this object from the game.
- ScienceDatabase:typeName
- Returns the class name of this object, this is not a function, but a direct member: if object.typeName == "Mine" then print("MINE!") end
The SpaceObject is the base for every object which can be seen in space. General properties can read and set for each object. Each object has a position, rotation and collision shape.
- SpaceObject:setPosition [ERROR]
- Set the position of this object in 2D space, in meters
- SpaceObject:setRotation [ERROR]
- Sets the absolute rotation of this object. In degrees.
- SpaceObject:getPosition [ERROR]
- Gets the position of this object, returns x, y Example: local x, y = obj:getPosition()
- SpaceObject:getRotation [ERROR]
- Gets the rotation of this object. In degrees. 0 degrees is pointing to the right of the world. So this does not match the heading of a ship. The value returned here can also go below 0 degrees or higher then 360 degrees, there is no limiting on the rotation.
- SpaceObject:getHeading()
- Get the heading of this object, in the range of 0 to 360. The heading is 90 degrees off from the rotation.
- SpaceObject:setHeading(float heading)
- SpaceObject:getVelocity [ERROR]
- Gets the velocity of the object, in 2D space, in meters/second
- SpaceObject:getAngularVelocity [ERROR]
- Gets the rotational velocity of the object, in degree/second
- SpaceObject:setFaction(string faction_name)
- Sets the faction to which this object belongs. Requires a string as input.
- SpaceObject:getFaction()
- Gets the faction name to which this object belongs.
- SpaceObject:setFactionId(unsigned int faction_id)
- Sets the faction to which this object belongs. Requires a index in the faction list.
- SpaceObject:getFactionId()
- Gets the index in the faction list from this object. Can be used in combination with setFactionId to make sure two objects have the same faction. Example: other:setFactionId(obj:getFactionId())
- SpaceObject:setCommsScript(string script_name)
- SpaceObject:setCommsFunction(ScriptSimpleCallback callback)
- SpaceObject:isEnemy(P<SpaceObject> obj)
- SpaceObject:isFriendly(P<SpaceObject> obj)
- SpaceObject:setCallSign(string new_callsign)
- Set a custom callsign for this object. Objects get assigned random callsigns at creation, but you can overrule this from scenario scripts.
- SpaceObject:getCallSign()
- SpaceObject:areEnemiesInRange(float range)
- SpaceObject:getObjectsInRange(float range)
- SpaceObject:setReputationPoints(float amount)
- Sets the reputation to a value.
- SpaceObject:getReputationPoints()
- Return the current amount of reputation points.
- SpaceObject:takeReputationPoints(float amount)
- Take a certain amount of reputation points, returns true when there are enough points to take. Returns false when there are not enough points and does not lower the points.
- SpaceObject:addReputationPoints(float amount)
- Add a certain amount of reputation points.
- SpaceObject:getSectorName()
- Get the name of the sector this object is in (A4 for example)
- SpaceObject:openCommsTo(P<PlayerSpaceship> target)
- Hail a player ship from this object. The ship will get a notification and can accept or deny the hail. Warning/ToFix: If the player refuses the hail, no feedback is given to the script in any way. Return true when the hail is enabled with succes. Returns false when the target player cannot be hailed right now (because it's already communicating with something else)
- SpaceObject:sendCommsMessage(P<PlayerSpaceship> target, string message)
- Hail a player ship from this object. The ship will get a notification and can accept or deny the hail. Warning/ToFix: If the player refuses the hail, no feedback is given to the script in any way. Return true when the hail is enabled with succes. Returns false when the target player cannot be hailed right now (because it's already communicating with something else) This function will display the message given as parameter when the hail is answered.
- SpaceObject:takeDamage(float damage_amount, DamageInfo info)
- Let this object take damage, the DamageInfo parameter can be empty, or a string which indicates if it's energy, kinetic or emp damage optionally followed by the location of the damage's origin (to damage the correct shield), followed by the frequency band (0-20 for energy damage) and the ESystem to target.
- SpaceObject:setDescription(string description)
- Set the description of this object. The description is visible on the Science station.
- SpaceObject:setDescriptionForScanState(EScannedState state, string description)
- SpaceObject:getDescription(getScannedStateFor(obj)
- SpaceObject:setDescriptions(string unscanned_description, string scanned_description)
- Sets the description of this object in scanned and unscanned states. First parameter is the description in unscanned state, while the 2nd parameter is in scanned state.
- SpaceObject:setRadarSignatureInfo(float grav, float elec, float bio)
- Set the radar signature of this object. Objects' signatures create noise on the Science station's raw radar signal ring.
- SpaceObject:getRadarSignatureGravity()
- SpaceObject:getRadarSignatureElectrical()
- SpaceObject:getRadarSignatureBiological()
- SpaceObject:scanningComplexity(P<SpaceObject> target)
- Get the scanning complexity of this object (amount of bars in the minigame)
- SpaceObject:scanningChannelDepth(P<SpaceObject> target)
- Get the scanning depth of this object (number of minigames to complete)
- SpaceObject:setScanningParameters(int complexity, int depth)
- Set the scanning complexity and depth for this object.
- SpaceObject:isScanned()
- [DEPRICATED] Check if this object is scanned already.
- SpaceObject:isScannedBy(P<SpaceObject> obj)
- Check if this object is scanned by the faction of another object
- SpaceObject:isScannedByFaction(string faction)
- Check if this object is scanned by another faction
- SpaceObject:setScanned(bool scanned)
- Set if this object is scanned or not by every faction.
- SpaceObject:setScannedByFaction(string faction_name, bool scanned)
- Set if this object is scanned or not by a particular faction.
- SpaceObject:isValid()
- Check if this is still looking at a valid object. Returns false when the objects that this variable references is destroyed.
- SpaceObject:destroy()
- Removes this object from the game.
- SpaceObject:typeName
- Returns the class name of this object, this is not a function, but a direct member: if object.typeName == "Mine" then print("MINE!") end
The TutorialGame object is normally never created. And it only used to setup the special tutorial level. It contains functions to assist in explaining the game, but do not work outside of the tutorial.
- TutorialGame:setPlayerShip(P<PlayerSpaceship> ship)
- TutorialGame:switchViewToMainScreen()
- TutorialGame:switchViewToTactical()
- TutorialGame:switchViewToLongRange()
- TutorialGame:switchViewToScreen(int n)
- TutorialGame:showMessage(string message, bool show_next)
- TutorialGame:setMessageToTopPosition()
- TutorialGame:setMessageToBottomPosition()
- TutorialGame:onNext(ScriptSimpleCallback callback)
- TutorialGame:finish()
- TutorialGame:isValid()
- Check if this is still looking at a valid object. Returns false when the objects that this variable references is destroyed.
- TutorialGame:destroy()
- Removes this object from the game.
- TutorialGame:typeName
- Returns the class name of this object, this is not a function, but a direct member: if object.typeName == "Mine" then print("MINE!") end
Subclass of:
SpaceObject- SupplyDrop:setEnergy(float amount)
- SupplyDrop:setWeaponStorage(EMissileWeapons weapon, int amount)
- SupplyDrop:onPickUp(ScriptSimpleCallback callback)
- Set a function that will be called if a player picks up the supply drop. First argument given to the function will be the supply drop, the second the player.
Subclass of:
SpaceObject- WarpJammer:setRange(float range)
- WarpJammer:onTakingDamage(ScriptSimpleCallback callback)
- Set a function that will be called if the warp jammer is taking damage. First argument given to the function will be the warp jammer, the second the instigator SpaceObject (or nil).
- WarpJammer:onDestruction(ScriptSimpleCallback callback)
- Set a function that will be called if the warp jammer is destroyed by taking damage. First argument given to the function will be the warp jammer, the second the instigator SpaceObject that gave the final blow (or nil).
Object which can be used to create and run another script. Other scripts have their own lifetime, update and init functions. Scripts can destroy themselves, or be destroyed by the main script.
- Script:run [ERROR]
- Run a script with a certain filename
- Script:setVariable [ERROR]
- Set a global variable in this script instance, this variable can be accessed in the main script.
- Script:isValid()
- Check if this is still looking at a valid object. Returns false when the objects that this variable references is destroyed.
- Script:destroy()
- Removes this object from the game.
- Script:typeName
- Returns the class name of this object, this is not a function, but a direct member: if object.typeName == "Mine" then print("MINE!") end
ShipTemplates are created when EmptyEpsilon is started. And used to fill the ship starting statistics, and other information.
- ShipTemplate:setName(string name)
- ShipTemplate:setClass(string class_name, string sub_class_name)
- Set the class name, and subclass name for the ship. Used to divide ships into different classes.
- ShipTemplate:setDescription(string description)
- Set the description shown for this ship in the science database.
- ShipTemplate:setType(TemplateType type)
- Sets the type of template. Defaults to normal ships, so then it does not need to be set. Example: template:setType("ship"), template:setType("playership"), template:setType("station")
- ShipTemplate:setDefaultAI(string default_ai_name)
- Set the default AI behaviour. EE has 3 types of AI coded into the game right now: "default", "fighter", "missilevolley"
- ShipTemplate:setModel(string model_name)
- Set the 3D model to be used for this template. The model referers to data set in the model_data.lua file.
- ShipTemplate:setDockClasses(std::vector<string> classes)
- Supply a list of ship classes that can be docked to this ship. setDockClasses("Starfighter") will allow all small starfighter type ships to dock with this ship.
- ShipTemplate:setEnergyStorage(float energy_amount)
- Set the amount of energy available for this ship. Note that only player ships use energy. So setting this for anything else is useless.
- ShipTemplate:setRepairCrewCount(int amount)
- ShipTemplate:setBeam(int index, float arc, float direction, float range, float cycle_time, float damage)
- Setup a beam weapon.
- ShipTemplate:setBeamWeapon(int index, float arc, float direction, float range, float cycle_time, float damage)
- Setup a beam weapon.
- ShipTemplate:setBeamWeaponTurret(int index, float arc, float direction, float rotation_rate)
- Setup a beam's turret.
- ShipTemplate:setBeamTexture(int index, string texture)
- Setup a beam weapon texture
- ShipTemplate:setBeamWeaponEnergyPerFire(int index, float energy)
- ShipTemplate:setBeamWeaponHeatPerFire(int index, float heat)
- ShipTemplate:setTubes(int amount, float load_time)
- Set the amount of missile tubes, limited to a maximum of 16.
- ShipTemplate:setTubeLoadTime(int index, float load_time)
- ShipTemplate:weaponTubeAllowMissle(int index, EMissileWeapons type)
- ShipTemplate:weaponTubeDisallowMissle(int index, EMissileWeapons type)
- ShipTemplate:setWeaponTubeExclusiveFor(int index, EMissileWeapons type)
- ShipTemplate:setTubeDirection(int index, float direction)
- ShipTemplate:setTubeSize(int index, EMissileSizes size)
- ShipTemplate:setHull(float amount)
- Set the amount of starting hull
- ShipTemplate:setShields(std::vector<float> values)
- Set the shield levels, amount of parameters defines the amount of shields. (Up to a maximum of 8 shields) Example: setShieldData(400) setShieldData(100, 80) setShieldData(100, 50, 50)
- ShipTemplate:setSpeed(float impulse, float turn, float acceleration)
- Set the impulse speed, rotation speed and impulse acceleration for this ship.
- ShipTemplate:setCombatManeuver(float boost, float strafe)
- Sets the combat maneuver power of this ship.
- ShipTemplate:setWarpSpeed(float warp)
- Set the warp speed for warp level 1 for this ship. Setting this will indicate that this ship has a warpdrive. (normal value is 1000)
- ShipTemplate:setSharesEnergyWithDocked(bool enabled)
- Set if this ship shares energy with docked ships. Example: template:setSharesEnergyWithDocked(false)
- ShipTemplate:setRestocksScanProbes(bool enabled)
- Set if this ship restocks scan probes on docked ships. Example: template:setRestocksScanProbes(false)
- ShipTemplate:setJumpDrive(bool enabled)
- Set if this ship has a jump drive. Example: template:setJumpDrive(true)
- ShipTemplate:setJumpDriveRange(float min, float max)
- ShipTemplate:setCloaking(bool enabled)
- ShipTemplate:setWeaponStorage(EMissileWeapons weapon, int amount)
- ShipTemplate:addRoom(sf::Vector2i position, sf::Vector2i size)
- ShipTemplate:addRoomSystem(sf::Vector2i position, sf::Vector2i size, ESystem system)
- ShipTemplate:addDoor(sf::Vector2i position, bool horizontal)
- ShipTemplate:setRadarTrace(string trace)
- ShipTemplate:copy(string new_name)
- Return a new template with the given name, which is an exact copy of this template. Used to make easy variations of templates.
- ShipTemplate:isValid()
- Check if this is still looking at a valid object. Returns false when the objects that this variable references is destroyed.
- ShipTemplate:destroy()
- Removes this object from the game.
- ShipTemplate:typeName
- Returns the class name of this object, this is not a function, but a direct member: if object.typeName == "Mine" then print("MINE!") end