Meteor 2 Scripting Functions
Sprite
int createSprite(string spriteName, vector2 pos, uint8 side)
Create a sprite (server only).

Example
createSprite("objects\\arrow.spr", getPos(PLAYER_OBJECT), 0, 0);

See also
deleteSprite

void deleteSprite(int spriteID)
Delete a sprite (server only).

Example
// create an arrow sprite
int sprite = createSprite("objects\\arrow.spr", getPos(PLAYER_OBJECT), 0, 0);

// immediately delete the sprite
deleteSprite(sprite);

See also
createSprite

bool getSpriteHidden(int spriteID)
Get sprite hidden status.

Example
print(getSpriteHidden(1));

See also
setSpriteHidden

void setSpriteHidden(int spriteID, bool hidden)
Show or hide a sprite.

Example
// hide sprite ID 1
setSpriteHidden(1, true);

See also
getSpriteHidden

float getSpriteLifetime(int spriteID)
Get a sprite's remaining lifetime (server only).

Example
print(getSpriteLifetime(1));

Comments
lifetime is in seconds (0 for no lifetime specified).

See also
setSpriteLifetime

void setSpriteLifetime(int spriteID, bool hidden)
Set a sprite's remaining lifetime in seconds (server only).

Example
// create an arrow sprite
int sprite = createSprite("objects\\arrow.spr", getPos(PLAYER_OBJECT), 0, 0);

// Delete the sprite in 5.25 seconds
setSpriteLifetime(sprite, 5.25);

Comments
Set lifetime to 0 to not automatically delete.
Note that wrecks and corpses are deleted automatically once map limits are reached.

See also
getSpriteLifetime


Index

Generated on the 23 November 2024 at 08:20:44 (UK Time)