Entity Functions

For the corresponding Entity variables go here

  • ChangeCHR() Replaces an entity's imagefile on the map with a different one
  • EntityMove() Sets the movecode of an entity - so moving them around on the map
  • EntitySetWanderDelay() Change the wander delay time.
  • EntitySetWanderRect() Sets an entity's wandermode to Rect.
  • EntitySetWanderZone() Sets an entity to wander about in Zone 0.
  • EntitySpawn() spawn an entity onto the map
  • EntityStalk() Makes one entity follow another
  • EntityStop() Clears an entities movecode
  • GetPlayer() Returns the map's entity index for the current player.
  • HookEntityRender() Every time the specified entity would be rendered, calls the specified function instead
  • PlayerMove() Sets a movecode for the player - taking control from the user
  • SetEntitiesPaused() Halts all entity movement
  • SetPlayer() Set up controls and camera for entity
  • Talkback

    Post a new comment?

    Talkback #1 written by Zip on 2004-07-16.

    If you need the game to pause until an entity is done moving, you may find this function useful.

    void WaitForEntity(int wait_entity)
    
    // Waits until an entity has finished its movecode
    {
    // Just incase we get stuck somewhere, set a timeout
    int timeout = timer + 1000;
    // While the entity is still doing stuff
    while (entity.movecode[wait_entity])
    {
    Render(); // Render the map
    ShowPage(); // Display to screen
    if (timeout < timer) // If they've got stuck
    {
    // Stop the entity
    EntityStop(wait_entity);
    // Notify you so you can fix your code
    MessageBox("Timeout for entity number "+str(wait_entity));
    }
    }
    }

    Post a new comment?

    Ben McGraw's lovingly crafted this website from scratch for years.
    It's a lot prettier this go around because of Jon Wofford.
    Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.