Post by ando on Aug 5, 2009 12:57:18 GMT -8
How to add COOP_VC in VC2
Officially there is only one coop option and that is for COOP US.
The PC player parameters are located in your g\ini\mp\classes\coop.ini
If you try to use simple script for coop_vc then the engine will still use those COOP US PC parameters.
So you will need to add that ini file "under your map vc2m file" (ini\mp\classes\coop.ini) and use the parameters for VC PC player.
Game engine is automatically using that .ini file "under your map" and "only for that map."
With that option you can use only one coop mode for map.
When you finalize your map then you can use [COOP_VC] inside “usermap.ini” or “def.ini” . Then that name appears under mode list.
Here is modified coop.ini for coop_vc and add it inside your VC2M file (ini\mp\classes\coop.ini)
sample COOP_VC.c
sample US_soldier.c
sample_US_medic.c
sample US_engineer.c
Officially there is only one coop option and that is for COOP US.
The PC player parameters are located in your g\ini\mp\classes\coop.ini
If you try to use simple script for coop_vc then the engine will still use those COOP US PC parameters.
So you will need to add that ini file "under your map vc2m file" (ini\mp\classes\coop.ini) and use the parameters for VC PC player.
Game engine is automatically using that .ini file "under your map" and "only for that map."
With that option you can use only one coop mode for map.
When you finalize your map then you can use [COOP_VC] inside “usermap.ini” or “def.ini” . Then that name appears under mode list.
Here is modified coop.ini for coop_vc and add it inside your VC2M file (ini\mp\classes\coop.ini)
[VC Fighter]
name = 1774, 1792
side = 0
bodyside = 1
inifile = mp\\vc_fighter
eqpbody = g\\Characters\\cvp_nva01\\soldier\\eqp.ini
weaps = 38, 43, 15, 28, 37, 3, 54, 70
forceweaps = 30
stamina = 255,1
speed = 90
health = 200
icon = ico_soldier.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
[VC Engineer]
name = 1775, 1793
side = 0
bodyside = 1
inifile = mp\\vc_engineer
eqpbody = g\\Characters\\cvp_militia02\\engineer\\eqp.ini
weaps = 9, 28, 39, 3, 6, 70, 64, 63, 66
forceweaps = 69, 61, 67
stamina = 260,1
ammo = 23, 25
speed = 91
health = 200
icon = ico_engineer.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
[VC Medic]
name = 1776, 1794
side = 0
bodyside = 1
inifile = mp\\vc_medic
eqpbody = g\\Characters\\cvp_vc02\\medic\\eqp.ini
eqphead = g\\Characters\\_heads\\_eqpini\\vhg010.ini
weaps = 38, 28, 15, 54, 37, 3, 64
forceweaps = 30, 60
stamina = 300,1
ammo = 22, 25
speed = 95
levreq = 1
health = 200
icon = ico_medic.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
[VC Machinegunner]
name = 1777, 1795
side = 0
bodyside = 1
inifile = mp\\vc_machinegunner
eqpbody = g\\Characters\\cvp_vc03\\mgunner\\eqp.ini
weaps = 9, 5, 18, 35, 71, 72
forceweaps = 30
stamina = 340,1
ammo = 23, 8
speed = 85
levreq = 2
health = 200
icon = ico_mg.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
[VC Soldier]
name = 1778, 1796
side = 0
bodyside = 1
inifile = mp\\vc_soldier
eqpbody = g\\Characters\\cvp_nva01\\soldier\\eqp.ini
weaps = 8, 43, 41, 27, 15, 28, 40, 37, 2, 6, 64, 70
forceweaps = 30
stamina = 280,1
speed = 95
levreq = 3
health = 200
icon = ico_marine.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
[VC Radioman]
name = 1779, 1797
side = 0
bodyside = 1
inifile = mp\\vc_radioman
eqpbody = g\\Characters\\cvp_nva02\\radioman\\eqp.ini
weaps = 38, 3, 15, 28, 40, 6, 39, 2, 54
forceweaps = 30, 62
stamina = 320, 0.5
speed = 91
levreq = 4
health = 200
icon = ico_radioman.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
[VC Sniper]
name = 1780, 1798
side = 0
bodyside = 1
inifile = mp\\vc_sniper
eqpbody = g\\Characters\\cvp_sniper01\\basic\\eqp.ini
eqphead = g\\Characters\\_heads\\_eqpini\\vhg004.ini
weaps = 58, 26, 14
forceweaps = 30
stamina = 310,1
ammo = 23, 8
speed = 92
levreq = 5
health = 200
icon = ico_sniper.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
[VC Commando]
name = 1781, 1799
side = 0
bodyside = 1
inifile = mp\\vc_commnado
eqpbody = g\\Characters\\cvp_hero01\\basic\\eqp.ini
weaps = 49, 43, 27, 41, 15, 40, 28, 2, 37, 39, 70, 64
forceweaps = 30, 67
stamina = 375, 0.5
speed = 98
levreq = 6
health = 200
icon = ico_commando.tga
animstativ = g\\anims\\SCRIPT ANIMS\\an120.stg
animselected = 910
sample COOP_VC.c
// easyer coop_vc
// This script working only with one coop mode (you can't add coop_us)
// You MUST add new COOP.INI file for PC players to your *.vc2m file. (**.vc2m\ini\MP\CLASSES\COOP.INI)
//
//
#define ICON_PRIMARY_1 "g\\mp\\icons\\map\\ico_c4_1.tga"
#define ICON_PRIMARY_2 "g\\mp\\icons\\map\\ico_c4_2.tga"
#include <inc\maxovo\!max_multiplayer.h>
#define GAME_TYPE GAME_TYPE_COOP
dword SIDE1 = SC_P_SIDE_VC;
dword SIDE2 = SC_P_SIDE_US;
BOOL side1_rule1(s_MAX_RULE_data *MAX_RULE_data);
BOOL side1_rule2(s_MAX_RULE_data *MAX_RULE_data);
#define GROUPS_COUNT_SIDE1 1
char respawn_groups_side1_names[GROUPS_COUNT_SIDE1][MAX_STRING_LEN] = { "COOP_VC" };
char respawn_groups_side1_op_names[GROUPS_COUNT_SIDE1][MAX_STRING_LEN] = { "" };
BOOL respawn_groups_side1_active[GROUPS_COUNT_SIDE1] = { TRUE };
p_fce respawn_groups_side1_rules[GROUPS_COUNT_SIDE1] = { NULL };
#define WINNING_RULES_SIDE1_COUNT 1
p_fce WINNING_RULES_SIDE1[WINNING_RULES_SIDE1_COUNT] = { MAX_MUL_RULE_side_wins_opp_death_all };
// definuje se jake dalsi pravidla musi jeste platit s aktualnim pravidlem, -1 znamena zadne dalsi pravidlo
/*int WINNING_RULES_SIDE1_OPP[WINNING_RULES_SIDE1_COUNT][WINNING_RULES_SIDE1_COUNT-1] = { 1, 2,
0, 2,
0, 1 };*/
//#define OBJECTS_COUNT 4
//char *MAX_MUL_object_names[OBJECTS_COUNT] = { "cerpadlo_destr", "cerpadlo_destr#3", "cerpadlo_destr#5", "cerpadlo_destr#6" };
BOOL MAX_MUL_get_winning_side(s_MAX_RULE_data *MAX_RULE_data);
#define ROUND_TIMEOUT_WINNING_SIDE_COUNT 1 //todle asi bude vzdy pouze 1, ale ...
p_fce ROUND_TIMEOUT_WINNING_SIDE[ROUND_TIMEOUT_WINNING_SIDE_COUNT] = { MAX_MUL_get_winning_side };
//-------------------------------- MAPA ---------------------------------
#define MAP_NAME "Levels\\mapname\\DATA\\scenename\\mapfpv\\map.bmp"
#define MAP_TRANSFORM "Levels\\mapname\\DATA\\scenename\\mapfpv\\map_transform.dat"
void MAX_MUL_define_custom_items() {
/*int i, objective = 1;
for (i=0; i<OBJECTS_COUNT; i++) {
MAX_MUL_add_item_primary(MAX_MUL_object_names[i], SC_MP_MAP_SIDEMASK_SIDE1|SC_MP_MAP_SIDEMASK_SPECTATOR, objective++);
}*/
}
int MAX_MUL_define_custom_objectives() {
MAX_MUL_add_objective(1, SC_MP_MAP_SIDEMASK_SIDE1, 1946, NULL);
/*MAX_MUL_add_objective(2, SC_MP_MAP_SIDEMASK_SIDE1|SC_MP_MAP_SIDEMASK_SPECTATOR, 1007, "G\\mp\\icons\\map\\ws_primary_A.bmp");
MAX_MUL_add_objective(3, SC_MP_MAP_SIDEMASK_SIDE1|SC_MP_MAP_SIDEMASK_SPECTATOR, 1007, "G\\mp\\icons\\map\\ws_primary_B.bmp");
MAX_MUL_add_objective(4, SC_MP_MAP_SIDEMASK_SIDE1|SC_MP_MAP_SIDEMASK_SPECTATOR, 1007, "G\\mp\\icons\\map\\ws_primary_A.bmp");*/
return 1;
}
//-----------------------------------------------------------------------
#include <inc\maxovo\!max_multiplayer.cxx>
//-----------------------------------------------------------------------
//------------------------------ PRAVIDLA -------------------------------
//-----------------------------------------------------------------------
int iii;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
BOOL MAX_MUL_get_winning_side(s_MAX_RULE_data *MAX_RULE_data) {
MAX_RULE_data->side = SIDE2;
return TRUE; //SIDE2 brani
}
sample US_soldier.c
#define VOICEGROUP "tommyboy"
#include <inc\Maxovo\!max_support.h>
#include <inc\Maxovo\!max_defs.h>
#include <inc\Maxovo\!max_gameplay.h>
#define PL_SIDE SC_P_SIDE_US
#define PL_GROUP 2
#define PL_ID SC_P_CREATE_MEMID_AUTO
#define CLASS CLASS_RANDOM_NORMAL
#define RESPAWN
#define RESPAWN_FLAGS 1 //0x1 pro kleceni
#define RESPAWN_TIMES 0 //kolikrat se respawne - 255 = nekonecne
#define RESPAWN_TIME 10.0 //cas, za jak dlouho se respawne po smrti
#define RESPAWN_DIST 30.0 //koule v ktere nesmi byt PC, jinak se nerespawne
#define INI_FILE_BODY "CUP_ARVN03"
#define INI_FILE_HEAD "hwm_007"
#define EQP_FILE_BODY "G\\characters\\CUP_ARVN03\\US4_SOL_B\\eqp.ini"
#define EQP_FILE_HEAD "G\\characters\\_heads\\_eqpini\\uhg017.ini"
#define MP_SEARCH_PLAYER 10 //poslednich x aicek zacne aktivne vyhledavat nejblizsi PC
#define MP_SEARCH_PLAYER_DIST 50.0 //vyhledava maximalne do x metru (nepovinne)
#define MP_SEARCH_PLAYER_RETRY 10.0 //hledani opakuje kazdych x sekund (nepovinne)
#define MAINTASK
#define MAINTASK_COUNT 1
#define MAINTASK_LOOPED FALSE
#define MWP_SEARCH 30.0
#include <inc\Maxovo\uni_soldier.cxx>
int define_maintask() {
dword cur;
for (cur=0; cur<MAINTASK_COUNT; cur++) CLEAR(maintask[cur]);
cur = 0;
sprintf(maintask[cur].name, "main_task_vc_#1");
maintask[cur].coop_id = 20;
maintask[cur].flags = SC_P_AI_MAINTASK_FL_DO_VALID_MOVEDIRECTION_TEST | SC_P_AI_MAINTASK_FL_ALLOW_MOVE_TO_NOCOVER | SC_P_AI_MAINTASK_FL_PERMANENT;
maintask[cur].step = 10.0;
maintask[cur].wait = 1.0;
cur++;
/*sprintf(maintask[cur].name, "main_task_vc_#2");
maintask[cur].coop_id = 21;
maintask[cur].flags = SC_P_AI_MAINTASK_FL_DO_VALID_MOVEDIRECTION_TEST | SC_P_AI_MAINTASK_FL_ALLOW_MOVE_TO_NOCOVER | SC_P_AI_MAINTASK_FL_PERMANENT;
maintask[cur].step = 10.0;
maintask[cur].wait = 1.0;
cur++;*/
return cur;
}
dword gphase = 0;
BOOL callback_to_main(s_SC_Pscript_info *info) {
switch(info->message){
//------------------------------------
case SC_PLSCR_MSG_PL_RESPAWNED:
PL_MAINTASK_disable();
break;
case SC_PLSCR_MSG_SCRIPT_TIMETICK:
switch (gphase) {
case 0:
if (uni_gphase == 1) {
MAX_GMP_change_skill(info->player, 0.58);
gphase = 1;
}
break;
case 1:
break;
}
break;
case SC_PLSCR_MSG_AI_MOVEAT_CALLBACK:
break;
}
return TRUE;
}
sample_US_medic.c
#define VOICEGROUP "tommyboy"
#include <inc\Maxovo\!max_support.h>
#include <inc\Maxovo\!max_defs.h>
#include <inc\Maxovo\!max_gameplay.h>
#define PL_SIDE SC_P_SIDE_US
#define PL_GROUP 2
#define PL_ID SC_P_CREATE_MEMID_AUTO
#define CLASS CLASS_MEDIK
#define RESPAWN
#define RESPAWN_FLAGS 1 //0x1 pro kleceni
#define RESPAWN_TIMES 0 //kolikrat se respawne - 255 = nekonecne
#define RESPAWN_TIME 10.0 //cas, za jak dlouho se respawne po smrti
#define RESPAWN_DIST 10.0 //koule v ktere nesmi byt PC, jinak se nerespawne
#define INI_FILE_BODY "CUP_ARVN03"
#define INI_FILE_HEAD "HWM_005"
#define EQP_FILE_BODY "G\\characters\\CUP_ARVN03\\US4_MEDIC\\eqp.ini"
#define EQP_FILE_HEAD "G\\characters\\_heads\\_eqpini\\Uhg022.ini"//++
#define MP_SEARCH_PLAYER 10 //poslednich x aicek zacne aktivne vyhledavat nejblizsi PC
#define MP_SEARCH_PLAYER_DIST 150.0 //vyhledava maximalne do x metru (nepovinne)
#define MP_SEARCH_PLAYER_RETRY 10.0 //hledani opakuje kazdych x sekund (nepovinne)
#define MAINTASK
#define MAINTASK_COUNT 1
#define MAINTASK_LOOPED FALSE
#define MWP_SEARCH 30.0
#include <inc\Maxovo\uni_soldier.cxx>
int define_maintask() {
dword cur;
for (cur=0; cur<MAINTASK_COUNT; cur++) CLEAR(maintask[cur]);
cur = 0;
sprintf(maintask[cur].name, "main_task_vc_#1");
maintask[cur].coop_id = 20;
maintask[cur].flags = SC_P_AI_MAINTASK_FL_DO_VALID_MOVEDIRECTION_TEST | SC_P_AI_MAINTASK_FL_ALLOW_MOVE_TO_NOCOVER | SC_P_AI_MAINTASK_FL_PERMANENT;
maintask[cur].step = 10.0;
maintask[cur].wait = 1.0;
cur++;
/*sprintf(maintask[cur].name, "main_task_vc_#2");
maintask[cur].coop_id = 21;
maintask[cur].flags = SC_P_AI_MAINTASK_FL_DO_VALID_MOVEDIRECTION_TEST | SC_P_AI_MAINTASK_FL_ALLOW_MOVE_TO_NOCOVER | SC_P_AI_MAINTASK_FL_PERMANENT;
maintask[cur].step = 10.0;
maintask[cur].wait = 1.0;
cur++;*/
return cur;
}
dword gphase = 0;
BOOL callback_to_main(s_SC_Pscript_info *info) {
switch(info->message){
//------------------------------------
case SC_PLSCR_MSG_PL_RESPAWNED:
PL_MAINTASK_disable();
break;
case SC_PLSCR_MSG_SCRIPT_TIMETICK:
switch (gphase) {
case 0:
if (uni_gphase == 1) {
MAX_GMP_change_skill(info->player, 0.58);
gphase = 1;
}
break;
case 1:
break;
}
break;
case SC_PLSCR_MSG_AI_MOVEAT_CALLBACK:
break;
}
return TRUE;
}
sample US_engineer.c
#define VOICEGROUP "cobber"
#include <inc\Maxovo\!max_support.h>
#include <inc\Maxovo\!max_defs.h>
#include <inc\Maxovo\!max_gameplay.h>
#define PL_SIDE SC_P_SIDE_US
#define PL_GROUP 2
#define PL_ID SC_P_CREATE_MEMID_AUTO
#define CLASS CLASS_INZENYR
#define RESPAWN
#define RESPAWN_FLAGS 1 //0x1 pro kleceni
#define RESPAWN_TIMES 0 //kolikrat se respawne - 255 = nekonecne
#define RESPAWN_TIME 10.0 //cas, za jak dlouho se respawne po smrti
#define RESPAWN_DIST 10.0 //koule v ktere nesmi byt PC, jinak se nerespawne
#define INI_FILE_BODY "cup_usmc04"
#define INI_FILE_HEAD "hwm_002"
#define EQP_FILE_BODY "G\\characters\\cup_usmc04\\us5_sapper\\eqp.ini"
#define EQP_FILE_HEAD "G\\characters\\_heads\\_eqpini\\Uhg007.ini"
#define MP_SEARCH_PLAYER 10 //poslednich x aicek zacne aktivne vyhledavat nejblizsi PC
#define MP_SEARCH_PLAYER_DIST 50.0 //vyhledava maximalne do x metru (nepovinne)
#define MP_SEARCH_PLAYER_RETRY 10.0 //hledani opakuje kazdych x sekund (nepovinne)
#define MAINTASK
#define MAINTASK_COUNT 1
#define MAINTASK_LOOPED FALSE
#define MWP_SEARCH 30.0
#include <inc\Maxovo\uni_soldier.cxx>
int define_maintask() {
dword cur;
for (cur=0; cur<MAINTASK_COUNT; cur++) CLEAR(maintask[cur]);
cur = 0;
sprintf(maintask[cur].name, "main_task_vc_#1");
maintask[cur].coop_id = 20;
maintask[cur].flags = SC_P_AI_MAINTASK_FL_DO_VALID_MOVEDIRECTION_TEST | SC_P_AI_MAINTASK_FL_ALLOW_MOVE_TO_NOCOVER | SC_P_AI_MAINTASK_FL_PERMANENT;
maintask[cur].step = 10.0;
maintask[cur].wait = 1.0;
cur++;
/*sprintf(maintask[cur].name, "main_task_vc_#2");
maintask[cur].coop_id = 21;
maintask[cur].flags = SC_P_AI_MAINTASK_FL_DO_VALID_MOVEDIRECTION_TEST | SC_P_AI_MAINTASK_FL_ALLOW_MOVE_TO_NOCOVER | SC_P_AI_MAINTASK_FL_PERMANENT;
maintask[cur].step = 10.0;
maintask[cur].wait = 1.0;
cur++;*/
return cur;
}
dword gphase = 0;
BOOL callback_to_main(s_SC_Pscript_info *info) {
switch(info->message){
//------------------------------------
case SC_PLSCR_MSG_PL_RESPAWNED:
PL_MAINTASK_disable();
break;
case SC_PLSCR_MSG_SCRIPT_TIMETICK:
switch (gphase) {
case 0:
if (uni_gphase == 1) {
MAX_GMP_change_skill(info->player, 0.58);
gphase = 1;
}
break;
case 1:
break;
}
break;
case SC_PLSCR_MSG_AI_MOVEAT_CALLBACK:
break;
}
return TRUE;
}