Hi Germanunkol,

That is correct with track skill number. It is best define everything. 0 - 28 are actually used for fields, which are 3dgs fields likes pan, tilt, roll, alpha, etc.

Define Example:
-------------------------------
DEFINE MPUC_FILENAME, 0;
DEFINE MPUC_POSITION, 1;
DEFINE MPUC_PAN, 3;
DEFINE MPUC_TILT, 4;
DEFINE MPUC_ROLL, 5;
DEFINE MPUC_SCALE_X, 6;
DEFINE MPUC_SCALE_Y, 7;
DEFINE MPUC_SCALE_Z, 8;
DEFINE MPUC_FLAGS, 9;
DEFINE MPUC_FRAME, 10;
DEFINE MPUC_NEXTFRAME, 11;
DEFINE MPUC_SKIN, 12;
DEFINE MPUC_AMBIENT, 13;
DEFINE MPUC_ALBEDO, 14;
DEFINE MPUC_ALPHA, 15;
DEFINE MPUC_LIGHTRANGE, 16;
DEFINE MPUC_BLUE, 17;
DEFINE MPUC_GREEN, 18;
DEFINE MPUC_RED, 19;
DEFINE MPUC_EMASK, 20;
DEFINE MPUC_EFLAGS, 21;
DEFINE MPUC_MIN, 22;
DEFINE MPUC_MAX, 23;
DEFINE MPUC_TRIGGER_RANGE, 24;
DEFINE MPUC_PUSH, 25;
DEFINE MPUC_FLOOR_DIST, 26;
DEFINE MPUC_SMASK 27;
DEFINE MPUC_CLIENT_ID 28;
DEFINE MPUC_SKILL_1, 29;
DEFINE MPUC_SKILL_2, 30;
DEFINE MPUC_SKILL_3, 31;
.
.
DEFINE MPUC_SKILL_98, 126;
DEFINE MPUC_SKILL_99, 127;
DEFINE MPUC_SKILL_100, 128;
-------------------------

Then you just do this,
MP_TrackSkill(my, MPUC_SKILL_20);

As of right now there in no just sending a skill once, it always tracks the skill until you turn off tracking it. Here is an example of what I do to send skills I really don't want to track forever so I track for 1 second then turn off tracking.

----------------------------------------

my = MP_EntityCreate(em_light_inf_string, vector(create_pos.x,create_pos.y,create_pos.z), "inf_action", "InfCallback");

entsCreatedByMe += 1;

//make sure to track the animation skill
MP_TrackSkill(my, MPUC_SKILL_28); //anim_state
my.anim_state = anim_stand;
MP_TrackSkill(my, MPUC_SKILL_66); //_obj_type
my._obj_type = 2004;//NumFromName("Em_Fighter","Id",unit_dbf);
MP_TrackSkill(my, MPUC_SKILL_1); // health
my.health = NumFromId(my._obj_type, "health", unit_dbf);
//make sure to track the owner_id & team until set
MP_TrackSkill(my, MPUC_SKILL_77); //team
my.team = player_team;
MP_TrackSkill(my, MPUC_SKILL_60); //owner_id
my.owner_id = player_id;
MP_TrackSkill(my, MPUC_SKILL_47); //EntityNum
my.EntityNum = player_id*EntArrayIndex+entsCreatedByMe;
MP_TrackField(my, MPUC_TILT); // Tilt
MP_TrackField(my, MPUC_ROLL); // Roll


sleep(1);
// wait until team, owner_id and obj_type set, then stop tracking
if(my)
{
MP_IgnoreSkill(my, MPUC_SKILL_77); //team
MP_IgnoreSkill(my, MPUC_SKILL_60); //owner_id
MP_IgnoreSkill(my, MPUC_SKILL_66); //_obj_type
MP_IgnoreSkill(my, MPUC_SKILL_47); //EntityNum
}

--------------------------------

In that example I track team, owner_id and obj_type, EntityNum for one second, then stop tracking with MP_IgnoreSkill(), because they don't need to be continually tracked during gameplay just set at creation.

Stuff like anim_state, health, etc I keep tracking in that example.

In the example above also wanted to track Tilt and Roll so I used
MP_TrackField(my, MPUC_TILT); // Tilt
MP_TrackField(my, MPUC_ROLL); // Roll
to have them tracked also.

Anytime you create an entity with MP_EntityCreate() the entity's Position and Pan (not tilt and roll) are automatically tracked until you turn off tracking them. So if you created a static entity you would want to turn off tracking Position and Pan after entity was created using:
MP_IgnoreField(my,MPUC_POSITION);
MP_IgnoreField(my,MPUC_PAN);

Also, unlike 3DGS networking, the computer that creates the entity handles transfering that entity's data. The action is ran on all computer's also, not just server(or creator in this case). So I generally put in some code in action to exit on computers that did not create it after any basic stuff is set up like materials and whatever else you want set up or run locally on all the computers.

Example in an action:
---------------------
// wait until owner_id set or received from computer that created entity
while(!my.owner_id)
{
wait(1);
}

// set materials, local functions you want run, etc here
// local functions like animation, healthbars, or anything
// that would be similar to Proc_Local with 3DGS would be placed here
// local events can be set up here to with enable_scan, etc

// player_id is set in main after connected using
//player_id = MP_GetPlayerIndex();
// you will have to look that up

// if action running on computer that did not create entity, exit here after basic setup
if(my.owner_id != player_id)
{
return;
}

// creator's machine continues to run the actual action from this point on
while(my.health > 0)
-----------------------

That is some basics. Later, when I have time I will making some detailed examples.

Loco


Professional A8.30
Spoils of War - East Coast Games