Request List

Opencore Development Discussions
Post Reply
gRazzalRazzle
Level 3
Posts: 361
Joined: March 21st, 2004, 6:11 pm

Request List

Post by gRazzalRazzle » August 5th, 2008, 3:12 am

As of version .17pr1
PLAYER struct
  • flags carried
    King of the Hill timer
    bounty
    kills / wins
    deaths / losses
    turrets - how many are attached (and some ID (PID or player name or PLAYER*) on who's attached if possible)

    orientation of ship

    In libopencore.hpp, specify in the comments that the player's position is in pixels
LVZ attribute modification on the server
  • Moving location of map objects on the pixel level
    Changing object layer

Code: Select all

// void ShowObject      (Player *pp, WORD id, int show)
// void ShowObjectRange (Player *pp, WORD id_from, WORD id_to, int show)
//
//    pp       player to move objects for (use NULL to send to all players)
//    id       id of object from LVZ file
//    id_from  id of first object from LVZ file
//    id_to    id of last object from LVZ file
//    show     zero hides object(s), non-zero shows object(s)
//
//    These functions show/hide the specificed object(s) as defined by the arena LVZ. The core 
//    sends a binary object toggle packet which is much more efficient than using *objset. These
//    fucntions may be called many times in a row. A packet is not sent until the current event is
//    complete, the object buffer fills, or the destination player changes. The function that 
//    specifies a range shows/hides all object id's inclusive. You may specify the same id's in 
//    subsequent calls even if it is in the opposite state. For example, if you have objects 50-59, 
//    and you only want to show object 56, you can do the following without having to remember if 
//    any objects are currently shown:
//
//       ShowObjectRange(pp, 50, 59, 0);
//       ShowObject(pp, 56, 1);
//
// void MoveObjects (Player *pp, Obj *obj, int obj_count)
//
//    pp         player to move objects for (use NULL to send to all players)
//    obj        array of Obj structures
//    obj_count  number of array elements
//
//    Changes the coordinates of each map/screen object in the array to the values specified. The
//    Continuum protocol also allows for changes to object layer, display time, display mode, and
//    image number, but these seem useless enough that I did not want to burden this interface with 
//    them.

typedef struct Obj_
   {
   BYTE  map_obj;                      // non-zero if object is a map object (not screen object)
   WORD  id;                           // object's id from LVZ file (object must exist)
   BYTE  xrel;                         // what is Obj.x relative to (see OBJ_xxx, screen objects only)
   BYTE  yrel;                         // what is Obj.y relative to (see OBJ_xxx, screen objects only)
   short x;                            // object's new x position
   short y;                            // object's new y position
   } Obj;
EVENT_FLAG
  • Flag game reset in particular

Code: Select all

// EVENT_FLAG
//
//    Set: p1, p2, turf_flags, flag_info, flag_freq, flag_points, flag
//
//    This event is sent for many reasons:
//
//       - Turf flags detected when map is loaded (before EVENT_LOGIN)
//       - Flags picked up or dropped by player (p1)
//       - Flag carrier killed (flag(s) transferred) (p1, p2)
//       - Periodic flag rewards
//       - Flags placed by server, or flag game reset
//
//    "flag_info" is set to further describe the flag event. See FLAG_xxx for more info.

#define FLAG_RESET               0     // flag game reset (implies all flags dropped, flag[])
#define FLAG_VICTORY             1     // team win, flag game reset (implies all flags dropped, flag[])
#define FLAG_SET                 2     // location/info for a flag on the map (flag[])
#define FLAG_CHANGE              3     // flag(s) have been picked up and/or dropped (flag[])
#define FLAG_REWARD              4     // periodic flag rewards (flag_freq, flag_points)
#define FLAG_TURF                5     // flags detected on map (flag[], turf_flags)
long SetTimer(ticks_ms_t duration, void (*timer_callback)(CORE_DATA *cd));
Have the core automatically call a function when a timer expires.
For plugin programmers, this avoids nested switch(timer_id) statements or if(timer_data == ...)else if(timer_data == ...) etc in EVENT_TIMER with bots that use timers for many aspects of its job.

The same reasoning for having callback functions for EVENT_COMMAND is why this would be nice.
Free 2D, player-run space ship MMO game. 10 years, and still going strong: Continuum.

Post Reply

Return to “OpenCore”

Who is online

Users browsing this forum: No registered users and 0 guests