|
Post by mro on Sept 1, 2009 1:53:28 GMT -8
understand perfectly: what is very strange for me is: between vc1 and vc2 the scripts system is different, but basically they work in same way (apart scripting).. I mean that main points of the engine are very similar and vc2 is an improved version of vc1.. so I look at example of JPV and underline that he created the famous "Hamburger Hill beta..", where medics heal you in CooP when needed, and also they work without your call / request. That's strange for me.
Anyhow: how to recover Cobber, Dutch, Stone and Tommyboy scripts?
|
|
|
Post by mro on Sept 1, 2009 1:55:57 GMT -8
these are the scripts I made for US_AI missing from your previos list: please check and USE, if OKAY:
US_SNIPER _______________________________________________________________________ // us_soldier.cxx - vytvoril MaxPayne
#include <inc\Maxovo\!max_support.h> #include <inc\Maxovo\!max_defs.h> #include <inc\Maxovo\!max_gameplay.h> //#include "level.h"
#define PL_SIDE SC_P_SIDE_US #define PL_GROUP 2 #define PL_ID SC_P_CREATE_MEMID_AUTO
#define CLASS CLASS_SNIPER
#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; }
US_GUNNER _________________________________________________________________________ // us_soldier.cxx - vytvoril MaxPayne
#include <inc\Maxovo\!max_support.h> #include <inc\Maxovo\!max_defs.h> #include <inc\Maxovo\!max_gameplay.h> //#include "level.h"
#define PL_SIDE SC_P_SIDE_US #define PL_GROUP 2 #define PL_ID SC_P_CREATE_MEMID_AUTO
#define CLASS CLASS_KULAS #define RANK 5 #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 200.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; }
|
|
|
Post by mro on Sept 1, 2009 5:34:28 GMT -8
I'm not expert in scripting, but I see that there is a BOOL for Side1 (rule1 and rule2) and Side1 should be US side.. and not for Side2 (VC) in MP scripts
|
|
|
Post by mro on Sept 1, 2009 5:34:55 GMT -8
Also there is a Modificator in INI: could be this one
|
|
Zybero
Staff Sergeant
Posts: 81
|
Post by Zybero on Sept 1, 2009 5:37:51 GMT -8
Me neither, but your scripts is the right ones. Its not possible to get the scripts for Tommyboy, Stone, Cobber and Dutch. Unless you get em from 2K Czech aka Pterodon, wich is not likely anyway. As i said, the MP and SP is not scripted the same way. So the creates of HamburgerHill might have improved the scripts a little...
|
|
|
Post by mro on Sept 1, 2009 13:53:52 GMT -8
ThankYou, but I guess your idea is not correct: in fact the scripts work during the testing game in editor, and they aren't of TommyBoy, etc..: this means that the generic scripts should work in some particular condition.. mean that, since the editor is not made for SP missions, must be a way to make them working well.. this is my opinion
|
|
|
Post by Chavez on Sept 1, 2009 17:13:07 GMT -8
From what i have learned in my game programming classes...you can over-write definitions which gives them new parameters...if you only had the portion of script which deals with this particular area...you can re-define the variables and units to work for you the way you want them to in MP...but without the sdk for vc2 you are dead in the water...
strange that it works in editor ... and not in MP ... has to be an internal VC2 engine script which controls this...it must be currently set to zero (false) when it needs to be set to 1 (true)...
Also, you mentioned it works for VC and not the US soldiers .. so in the vc script there must be a place which defines the healing/resupply for both of the medics and the engineers...SO, if you were to modify the VC script (which HAS that part working), for the US, then it SHOULD work...
Is this part listed in the script: SC_P_GetStatus (pl, &status); if (status.hp<=99) return TRUE; return false;
this could be used to tell the medik if a player needs to be healed...
Im not sure how the engineer could be made to function since it relies on a player calling for ammo...
pseudocode would be: if player calls for ammo return true get player position and id go to position and give ammo to player id else return false
|
|
ando
Sergeant
Posts: 31
|
Post by ando on Sept 1, 2009 23:00:43 GMT -8
Here is part of "max_support.h" its setting parameters for medic. And that function is used in MP mode too. Without it medic don't work.
void MAX_SUP_set_medik(sc_player player) { s_SC_P_Ai_Medik medik_props; s_SC_P_AmmoRedefine redefine; s_SC_PC_CmdMenu menu;
CLEAR(redefine); redefine.ammo_type = 22; //23 pro ing. redefine.max_ammo = 1000; SC_P_AmmoRedefine_Add(player, &redefine);
SC_AMMO_Set(player, 22, 1000);
CLEAR(medik_props); SC_P_Ai_Medik_GetProps(player, &medik_props); medik_props.battle.hp_percentage = 0.2; medik_props.battle.range = 20.0; medik_props.battle.movedist_limit = 20.0; medik_props.peace.hp_percentage = 0.7; medik_props.peace.range = 20.0; medik_props.peace.movedist_limit = 20.0; SC_P_Ai_Medik_SetProps(player, &medik_props);
CLEAR(menu); SC_PC_GetCommandMenu(&menu); menu.flags |= SC_PC_CMDMENU_FL_ENABLEMEDIC; menu.medik_max_call_distance = 20.0; SC_PC_SetCommandMenu(&menu); }
Probably something is stopping medic in MP mode.
I tested it all again and VC_AI dont work for me ( he dont heal himself and teammates too). Same is when I host a server with editor and full game too. And of course it is working in SP mode.
MRO, we must use bit different script or are doing something else differently. Can you send me your testmap?
|
|
|
Post by mro on Sept 2, 2009 5:52:50 GMT -8
I PREPARED THIS TEXT BEFORE READING YOURS (THANKYOU) SO SEND IT: MIGHT BE IT HELPS, EVEN IF YOUR COMMENTS ARE (IN MY OPINION) RIGHT.
As said I'm not expert AT ALL about scripting (so sorry if I'm writing something stupid): just trying to understand, because it's my character: I dislike to abandone something until I'm not convinced. Actually I still have doubts about the opinion that SP and MP have different US_AI scripts, and this for several reasons. Among these reasons, main are that 1) the game testing editor uses the properties of medic and engineer as well as in SP, but editor is for MP only 2) this also proves that they aren't necessary particular scripts (as e.g. Tommyboy) to activate specialists properties (as healing, etc.): if it works in editor mode it for sure means that those scripts work So I improved my study, and my curiosisty brought me to a clear point: 1) when you test in game editor AI scripts are not compiled yet 2) when you play the finalized map scripts are compiled 3) this means that something happens "compiling scripts" I've gone to ussoldier.cxx and vcsoldier.cxx and compared with winmerge: they are totally different. IN PARTICULAR IN VC *.cxx THERE ARE THE FOLLOWING DEFINITIONS "//can use MEDIK or ENGINEER to make soldier medic or engineer" WHICH ARE TOTALLY MISSING IN ussoldier *.cxx (which obviously has many other stuff missing in VC).
I tried to add / modify some relevant points, copying from vcsoldier into ussoldier, but there are many other points to change and still trying.. my low experience for sure doesn't help.. BUT I'M SURE THIS IS THE RIGHT WAY / REASON.
FOLLOWING SOME PARTS I TRIED TO ADD TO US, BUT THERE ARE MANY OTHER STRINGS TO CHANGE: I'M SURE. ALSO I'M NOT SURE THAT THE RIGHT WAY IS TO CORRECT THE *.cxx: MIGHT BE CORRECT OR IT MIGHT BE BETTER TO ADD / CHANGE SOMETHING REFERING TO THESE ONES IN SPECIFIC AI SCRIPTS (THE *.c).
IN CONSEQUENCE I'M ONLY QUITE SURE TO BE CLOSER TO THE SOLUTION, BUT ASK KINDLY TO ANDO OR OTHER FRIENDS TO IMPROVE THIS FOR ME.. DUE TO MY POOR ABILITY IN SCRIPTS.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\ADDITION_1 (medik & engineer medikit & ammo)
#ifdef MEDIK weap[1].weap_id=60; create_info.weapons = 2; amred[0].ammo_type = 22; //medkit 'ammo' amred[0].max_ammo = 1000; //ammo amount create_info.ammo_redefines = 1; create_info.ammo_redefine = amred; #else if (!(rand() % (SC_GetDifficulty()+3))){ weap[create_info.weapons].weap_id=60; create_info.weapons++; }
#endif
#ifdef ENGINEER weap[1].weap_id=61; create_info.weapons = 2; amred[0].ammo_type = 23; //'ammo' amred[0].max_ammo = 1000; //ammo amount create_info.ammo_redefines = 1; create_info.ammo_redefine = amred; #endif
\\ADDITION_2 (medik behaviour)
#ifdef MEDIK SC_P_Ai_Medik_GetProps(info->player, &mp); mp.peace.range = 30; mp.peace.hp_percentage = 0.8f; mp.battle.range = 12; mp.battle.hp_percentage = 0.5f; SC_P_Ai_Medik_SetProps(info->player, &mp); #endif \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
AND RICK, IF YOU THINK IT USEFUL, PASS THIS SECTOR OF OUR THREAD AS A NEW ONE TO PUT IN EVIDENCE: IT COULD BE HELPFUL (HOPE) FOR OTHERS THANKYOU
|
|
ando
Sergeant
Posts: 31
|
Post by ando on Sept 2, 2009 9:52:22 GMT -8
some notes: 1. when you press F8 scripts are automatically compiled 2. you can use editor for MP game testings too. Game > Game menu > Multiplayer > Host a server > .....
You was talking about "vcsoldier.cxx" and "ussoldier.cxx" but my AI scripts don't use those at all. And same is with your US_SNIPER and US_GUNNER scripts what you posted before.
|
|
|
Post by mro on Sept 2, 2009 11:39:18 GMT -8
VERY INTERESTING.. but I must say that I must study a lot to apply scripting corrections. Tried with Rick's part, but message is "error, missing pl definition", or something like this. Actually I'm not able to insert the right string in the right place (I guess): might be I'm writing bad definition syntax, or interrupt some strings, or.. boh!
Could you please show me how to make correction? medic script is the Ando's sample: just once in a while please write for me.. so I study where, and how to..
Thanks in advance. Mauro
I send you the test map (where I'm testing) Ando: pls. give me an email address
|
|
|
Post by mro on Sept 2, 2009 14:25:52 GMT -8
THIS IS us_medic.c sample
#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; }
|
|
|
Post by Chavez on Sept 2, 2009 21:45:30 GMT -8
|
|
|
Post by mro on Sept 2, 2009 23:43:12 GMT -8
thanks Rick, I saw that wanderful work, but decided to study it once my experience on scripting will be little bit improved.. now it's too early to try to fight with in void, ifdef, etc. I guess my sector to attach should start from
#ifdef MEDIK SC_P_Ai_Medik_GetProps(info->player, &mp); mp.peace.range = 30; mp.peace.hp_percentage = 0.8f; mp.battle.range = 12; mp.battle.hp_percentage = 0.5f; SC_P_Ai_Medik_SetProps(info->player, &mp); #endif
But where should I attach?
|
|
|
Post by mro on Sept 3, 2009 14:12:20 GMT -8
we continued (me and Ando) by email for one day and this is my conclusion:
Ando, I improved study on Editor and deeply considered its processes: as you say (didn't consider earlier) F8 recompile everytime scripts initializing game test, but of course it works compiling ONLY players scripts: in fact it works even with AI scripts without game / MP scripts. For this reason it works well in game test, and medic heals, engineer gives ammo.. So the bug happens when finalize MP game, as to say ONLY WHEN compiles and follows MP scripts.. BUT, since as you say the bug comes with ANY type of game (DM, CooP, etc..), this absolutely must mean that PROBLEM COMES WITH A SCRIPT WHICH CONTROLS ANY GAME, as "Level.c" in VC1.
1) I don't know if the alert "Level.c creation failed" (which we ignore creating *.vc2m with editor is conncted with this problem.. what is sure is that AN ALERT MEANS THAT SOMETHING IS WRONG FINALIZING THE GAME, and this could be the "duties of each AI script".. 2) the AI scripts are ALL CORRECT: we could spend another 20 days to search for bug into script, but all is already defined with all #include and class specification 3) we should know which is the game script for editor game testing: must be something that instructs editor to play a generic game, and in my opinion THERE must be the right missing part in MP scripts (Level.cxx?) 4) might also be that Editor has some bug: Indiglow? who made it? For sure it doesn't work properly, since this alert comes everytime.. the editor, from my understanding was born for VC1 and modified for VC2, but VC2 scripts are totally different 5) the prove could be "how it works in VC1, with medic scripts".. we should test
Studied a lot about C++ scripting and now something is more clear for me. One problem I have is language: in previous experiences (the sim's) my habit was to work, and learn / improve what I didn't know from developers' \\ comments: these are very precious. But here in VC all in in Czech and this is very strange: normally an international program is made under all English comments and instructions: it seems that the developers don't like modders' help.
Do you understand Czech? For me to understand where a problem is studying from Czech comments / instructions is like "to search a pin in the dark"!
I post this in the forum too. Hopefully someone could help us: what about Don Turtuma? and a new SDK?
|
|