Description:
1./ on the map will be just one weapon (etc. AK-47) (with no respawn weapon and no disapear weapon)
2./ it will be based on TDM mode
3./ scoring will be depend which team is hold this weapon
4./ each minute of holding this weapon will be 1 point
Solution about one weapon on the map is done ,but I want to release scoring cause I dont know how. So I want to ask someone who knows programming game scripts if someone want to make this script.
..any help will be appreciate...
THX
hm so it looks that I have to do that myself oh learning learning learning LENIN ...ok thx anyway..
Long time ago I made few new game modes with LDC Apfel and Kosti.
But not released because I have no time for VC.
One mode was similar to your idea, except team was holding flag.
If I remember correctly then all was finished except bigger testing.
If someone want to organize proper testing then I will give a map.
And when test map is good then I will release source code of scripts too.
( don't want to release if it might not work correctly)
Finally if u want I will test them...I wanna "fresh blood" to the maps
BTW: Also pointing system from GTP mode sounds good. I think also about the little combination of GTP and new mode.(if u kill enemy with this gun + extra point for team and so on...)
Alright. Yesterday I tested with Bird Flu the new game modes in the testing map released by Ando. We ran into a few problems, so I'll try to describe those here.
The GG (GunGame), HTF (Hold The Flag) and SSA (Sharp Shooter Assault) modes worked like a charm in our tests. We didn't encounter any problems with these modes.
Whilst the Duel mode had a problem with switching the invulnerability. It switches off too soon and it is possible to hurt or even kill a player before the black screen appears (and all players are relocated back to spawn points). This seems to happen only to players who were killed in the last round but I can't confirm that.
The Zombie mode is buggy. In the first round, all players were living (as it's probably suppossed to be) and the mod worked properly. But in all next rounds the VC player turns into a zombie automatically after the start.
The Airsoft mode is just broken and cannot be played properly at all. In some rounds, a player just raises his hands immeditately after the start. Sometimes the player sync is broken and we couldn't see each other moving. VC player couldn't conquer the neutral flag at any time...
I personally like all the mods . Good ideas and it's even better that te VC engine seems to be capable of realising them in the first place (just can't imagine accurately how do they work).
Im running the duel airsoft and other fun mods at my server many players like the 1 bullet duel and the 22 weapons duel i hope more maps will be provided with these mods
I want to add these new mods to new maps ,but also add to some older maps as remakes. Adding is no problem ,but at the first Ando have to release source codes after repair modes.
I hope that one day will be done
Thank you Ando for releasing the HTF, SSA & GG scripts publicly. Currently I'm looking into them and I see it really isn't a piece of cake to make them functioning correctly. Good job!
Ando, there's something I need to inform you about. The HTF mode isn't exactly without any bugs. There's one bug we didn't notice during our testing.
Any player who has the flag, is killed and then gets killed again, drops the flag on ground again. It does not show the message 'Flag dropped' but when you try to acquire this 'fake' flag the game shows message 'Flag returned'. First I spotted it when I finalized my testing map (which is using the new modes). It DOES also occur on your testing map (it's really weird we didn't notice it...).
BUT I've managed to fix it just by myself (with my poor skills in VC scripting it took me some hours to figure it out :D). See the code in spoiler - search for words 'POSSIBLE FIX' and 'ENHANCEMENT'.
Spoiler:[ShowHide]
Code
// VIETCONG 1
// HTF (Hold The Flag) script - compatible with synchronized objects
// made by Ando
// v1.0
//
/*
______________DESCRIPTION:
HTF (Hold The Flag)
Hold The Flag - fight with everybody. No teams.
Every second what you hold the flag, will give you one point.
______________TUTORIAL FOR EDITOR
ENDRULE: points
RECOVERY POINT: HTF or waypoint name "HTF_'nr'"
// NOTES:
- custom recover point id = 29. Added to editor after batch 1.7
- added fade for restart
- show player in different color (on/off option in script)
- show players count when "TAB" is pressed (on/off option in script)
- fixed tab list order
- added gphase "GPHASE_MISSION_COMPLETED" (used when end condition reached)
- added text "Mission completed" //#2026: #tee Mission completed
- added fade to "Mission completed"
- best player in dark red when mission completed
- added flag icon
*/
/*
_____________Fixed and (just slightly) enhanced by Nosek
(v 1.1 - added global variable ADD_POINT_INTERVAL)
- search for words POSSIBLE FIX and ENHANCEMENT to see the changes
- use sc_def.h & sc_global.h from the VC Script SDK 0.96!!!
\-> sc_global.h from SDK includes definitions which are needed for this script, f.ex. extern BOOL SC_KeyJustPressed(dword id);
#define FADE_TIME 0.8
#define RESTART_TIMER 3 //time before actual restart
#define BEGIN_TIMER 3 //
//________________________________Global Variables for MP objects___
//global variable system for object synchro
#define GVAR_SERVER 600 // server ( dont add SC_MP_Gvar_SetSynchro for that) 0 - not server, 1 - server
#define GVAR_COUNT 601 // count of object variables ( dont add SC_MP_Gvar_SetSynchro for that)
#define GVAR_USE_start 602 //start Global variable
//________________________________Global Variables__________________
#define GVAR_GPHASE 500 // important to use game phase and channel 500 for synchronised objects
#define GVAR_GPHASE_TIME 501
#define GVAR_WINNER 503
#define GVAR_FLAG_PLAYER 504
#define GVAR_FLAG_STATUS 510
//POSSIBLE FIX - new global variable for sending last flag player to clients (for dropped by message)
#define GVAR_LAST_FLAG_PLAYER 505
//________________________________Game phases_______________________
#define GPHASE_BEGIN 1//objects are restarting
#define GPHASE_WAIT_PLAYERS 2 //wait plaiers if needed and respawn for start
#define GPHASE_START_GAME 3 //fade on and spawn
#define GPHASE_GAME 4 //game
//#define GPHASE_FLAG_IN_BASE 4
//#define GPHASE_FLAG_ON_GROUND 5
//#define GPHASE_FLAG_ON_PLAYER 6
#define GPHASE_MISSION_COMPLETED 7
//________________________________Recover___________________________
#define RECOVER_TIME 5.0f // time to recover player after killed
#define NORECOV_TIME 3.0f // disable time of recoverplace after recovering someone there
#define REC_WPNAME "HTF_%d"
#define REC_MAX 64
BOOL SRV_CheckEndRule(float time){
int frags;
dword win_pl;
BOOL completed=FALSE;
switch(gEndRule){
case SC_MP_ENDRULE_TIME:
if (gPlayersConnected>0) gTime += time;
SC_MP_EndRule_SetTimeLeft(gTime,gPlayersConnected>0);
if (gTime>gEndValue) completed=TRUE;
break;
case SC_MP_ENDRULE_FRAGS:
win_pl = SC_MP_GetMaxFragsPl(&frags);
if (win_pl){
if (frags>=gEndValue)completed=TRUE;
}
break;
case SC_MP_ENDRULE_POINTS:
win_pl = SC_MP_GetMaxPointsPl(&frags);
if (win_pl){
if (frags>=gEndValue)completed=TRUE;
case GPHASE_GAME:
flag_phase=SC_ggi(GVAR_FLAG_STATUS);
switch(flag_phase){
case FLAG_PH_INBASE: //_________
flag_pos = orig_flag_pos;
case FLAG_PH_ONGROUND: //_________
Flag_Player_id = SC_GetNearestPlayer(&flag_pos,&pl_dist);
if ((Flag_Player_id)&&(pl_dist<1.5f)){
Flag_Player_handle = SC_MP_GetHandleofPl(Flag_Player_id);
update_timer=0;
SC_sgi(GVAR_FLAG_PLAYER, Flag_Player_handle);
SC_SRV_Item_Release(Flag_Ground_ID);// release ground flag
SC_sgi(GVAR_FLAG_STATUS,FLAG_PH_ONPLAYER);
//gPhase=GPHASE_FLAG_ON_PLAYER;
//SC_sgi(GVAR_GPHASE,gPhase);
}else{// no players around
if (flag_phase==FLAG_PH_ONGROUND){
SC_Item_GetPos(Flag_Ground_ID,&flag_pos);// update flag pos because of dynamics
On_Ground_Timer-= info->elapsed_time;
if(On_Ground_Timer < 0 ){
SC_sgi(GVAR_FLAG_STATUS,FLAG_PH_INBASE);
//gPhase=GPHASE_FLAG_IN_BASE;
//SC_sgi(GVAR_GPHASE,gPhase);
}
}
}
break;
case FLAG_PH_ONPLAYER: //_________
update_timer+= info->elapsed_time;
//ENHANCEMENT - custom interval of adding one point for player holding the flag
if(update_timer>ADD_POINT_INTERVAL){
SC_P_MP_AddPoints(Flag_Player_id,1);
update_timer=0;
}
if (!SC_P_IsReady(Flag_Player_id) || (Flag_Player_killed)){//exit game or dead
Flag_Player_killed = FALSE;
update_timer=0;
if (SC_Item_GetPos(Flag_Ground_ID,&flag_pos)){ // flag on ground
//POSSIBLE FIX (setting last flag player)
SC_sgi(GVAR_LAST_FLAG_PLAYER, Flag_Player_handle);
//POSSIBLE FIX (resetting flag stats)
SC_sgi(GVAR_FLAG_PLAYER, 0);
Flag_Player_handle = 0;
}else {//no flag, add to base
SC_sgi(GVAR_FLAG_STATUS,FLAG_PH_INBASE);
//gPhase=GPHASE_FLAG_IN_BASE;
//SC_sgi(GVAR_GPHASE,gPhase);
//POSSIBLE FIX (resetting flag stats)
SC_sgi(GVAR_FLAG_PLAYER, 0);
Flag_Player_handle = 0;
}
}
break;
}
break;
case GPHASE_MISSION_COMPLETED:
break;
}
//________________________________________________________________
//gPlayersConnected = 64;
//SC_MP_EnumPlayers(enum_pl,&gPlayersConnected,SC_MP_ENUMPLAYER_SIDE_ALL);
if (SRV_CheckEndRule(info->elapsed_time)) break;
for (i=0;i<gRecs;i++)
gRecTimer[i] -= info->elapsed_time;
break;
case SC_NET_MES_CLIENT_TICK:
switch(SC_ggi(GVAR_GPHASE)){
case GPHASE_BEGIN: //___________________________CLN______BEGIN
break;
case GPHASE_WAIT_PLAYERS: //___________________________CLN______WAIT_PLAYERS
witxt = SC_Wtxt(1076);//1076
SC_GetScreenRes(&sc_width,&sc_height);
val= sc_width - SC_Fnt_GetWidthW(witxt,1);
SC_Fnt_WriteW(val * 0.5f,15,witxt,1,0xffffffff);
break;
case GPHASE_START_GAME: //___________________________CLN______START_GAME
if (fade_off){
client_fade_timer -= info->elapsed_time;
if (client_fade_timer < (FADE_TIME + 0.1f)){
SC_FadeTo(TRUE, FADE_TIME);
fade_off=FALSE;
client_fade_timer=RESTART_TIMER;
fade_off_timer=0;
//reset objexts and states
}
}
swprintf(wtxt,SC_AnsiToUni("%s %S", wtxt2),SC_Wtxt(6030)," - HTF (Hold The Flag)");
val= (sc_width*0.5) - (SC_Fnt_GetWidthW(wtxt,1)*0.5);
SC_Fnt_WriteW(val,15,wtxt,1,0xffffffff);
break;
case GPHASE_GAME:
//FADE OFF
if (!fade_off){
fade_off_timer += info->elapsed_time;
if (fade_off_timer > 0.2f){// looks better so because spawn is with short delay
SC_FadeTo(FALSE, FADE_TIME);
fade_off=TRUE;
SC_DUMMY_Set_DoNotRenHier2(gFlagNod,FALSE);//show base flag
SC_NOD_GetWorldPos(gFlagNod, &vec);
SC_HUD_RadarShowPos(&vec, 0xff000000);//0xffffffff// white
swprintf(wtxt,SC_AnsiToUni("%s",wtxt2),SC_Wtxt(1069));//#1069: #tee Flag returned!
SC_GameInfoW(wtxt);
last_flag_player=-1;
cln_flag_in_base=TRUE;
cln_flag_on_ground=FALSE;
}
break;
case FLAG_PH_ONGROUND: //_________
if(!cln_flag_on_ground){
icon[0].color = 0xffffffff;
icon[0].type = SC_HUD_MP_ICON_TYPE_NONE;
icon[0].icon_id = 5;
SC_MP_SetIconHUD(icon,1);
SC_DUMMY_Set_DoNotRenHier2(gFlagNod,TRUE);// dont show base flag
//POSSIBLE FIX - just getting the last flag player
cln_Flag_Player_handle = SC_ggi(GVAR_LAST_FLAG_PLAYER);
//POSSIBLE FIX - no need to check if the killed player had the flag when no player actually had it
if(Flag_Player_handle > 0) {
pl_id = SC_MP_GetPlofHandle(Flag_Player_handle);
if (info->param1==pl_id){ // killed player with flag
SC_P_GetPos(pl_id,&vec);
vec.z += 0.6f;
Flag_Ground_ID = SC_Item_Create(146,&vec);
On_Ground_Timer = ON_GROUND_TIME;
Flag_Player_killed = TRUE;
}
}//if(Flag_Player_handle > -1)
break;// SC_NET_MES_SERVER_KILL
case SC_NET_MES_LEVELPREINIT:
//orig - SC_sgi(GVAR_MP_MISSIONTYPE,GVAR_MP_MISSIONTYPE_HTF);
//ENHANCEMENT - no need to create new missiontype, script will use settings for DM
SC_sgi(GVAR_MP_MISSIONTYPE,GVAR_MP_MISSIONTYPE_DM);
gEndRule = info->param1;
gEndValue = info->param2;
gTime = 0.0f;
SC_MP_EnableBotsFromScene(FALSE);
break;// SC_NET_MES_LEVELPREINIT
case SC_NET_MES_LEVELINIT:
//_____________________________________automatic custom global variables_________________
for (i=GVAR_USE_start;i<GVAR_USE_start+SC_ggi(GVAR_COUNT)+1;i++){ //custom global variables
SC_MP_Gvar_SetSynchro(i);
}
// preload flag eqp items
SC_PreloadBES(PRELOADBES_FLAG_VC,"G\\WEAPONS\\Vvh_flag\\Vvh_flag_VC_3pv.BES");
nod = SC_NOD_Get(NULL,"HTF_flag");
if (!nod) SC_message("'HTF_flag' not found 01");
gFlagNod = SC_NOD_Get(nod,"Vlajka VC");
if (!gFlagNod) SC_message("'HTF_flag' not found 02");
SC_NOD_GetWorldPos(nod,&orig_flag_pos);
if (info->param1){
// it's server
//_______________________________________________________________________________________
SC_sgi(GVAR_SERVER,1);
SC_MP_Gvar_SetSynchro(GVAR_GPHASE);
SC_MP_Gvar_SetSynchro(GVAR_GPHASE_TIME);
//SC_MP_Gvar_SetSynchro(GVAR_CUR_WEAP);
SC_MP_Gvar_SetSynchro(GVAR_WINNER);
SC_MP_Gvar_SetSynchro(GVAR_FLAG_PLAYER);
//POSSIBLE FIX - last flag player sync
SC_MP_Gvar_SetSynchro(GVAR_LAST_FLAG_PLAYER);
for (i=300;i<364;i++){ //custom global variables for player id's
SC_MP_Gvar_SetSynchro(i);
}
//_______________________________________________________________________________________
for (i=400;i<464;i++){ //for player points
SC_MP_Gvar_SetSynchro(i);
}
//_______________________________________________________________________________________
SC_MP_GetSRVsettings(&SRVset);
SC_MP_SRV_InitWeaponsRecovery((float)SRVset.dm_weap_resp_time);
gRecs = 0;
for (i=0;i<REC_MAX;i++){
sprintf(txt,REC_WPNAME,i);
if (SC_NET_FillRecover(&gRec[gRecs],txt)) gRecs++;
}
#if _GE_VERSION_ >= 170
i = REC_MAX - gRecs;
SC_MP_GetRecovers(SC_MP_RESPAWN_HTF,&gRec[gRecs],&i);
gRecs += i;
#endif
if (gRecs==0){
SC_message("no 'HTF' recover place added! Will use 'DM' recover place if exist.");
i = REC_MAX - gRecs;
SC_MP_GetRecovers(SC_MP_RESPAWN_DM,&gRec[gRecs],&i);
gRecs += i;
}
CLEAR(gRecTimer);
}// if (info->param1)
}//if (info->param2)
break;// SC_NET_MES_LEVELINIT
case SC_NET_MES_RENDERHUD:
if(SC_KeyPressed(0x0F)){//TAB pressed
if(SHOW_PLAYER_COLOR){
SC_MP_HUD_SelectPl(SC_PC_Get(),0x1100ffff);
}
if (SHOW_PLAYERS_COUNT){
SC_MP_EnumPlayers(enum_pl,&j,SC_MP_ENUMPLAYER_SIDE_ALL);
if (j==1) player_s = SC_Wtxt(350); else player_s = SC_Wtxt(7001);
swprintf(wtxt,SC_AnsiToUni("%d %s", wtxt2),j,player_s);
SC_Fnt_WriteW(100,25,wtxt,1,0xffffffff);
}
}else if(SC_ggi(GVAR_GPHASE)==GPHASE_MISSION_COMPLETED){
if (SC_MP_GetMaxPointsPl(&max_point)){
if(max_point > 0){
SC_MP_HUD_SelectPl(SC_MP_GetMaxPointsPl(&max_point),0x88440000);
}
}
}
break;
case SC_NET_MES_SERVER_RECOVER_TIME:
if (info->param2){
info->fval1 = 0.1f;
}
else{// killed
Ando wrote:
Airsoft and Zombie described bugs don't appear to me, I don't know why (I tested with 2 x editor)
I tested it twice (once with Bird Flu and once with more people) and the strange behavior of these modes, as I described, always occured. We can try some further testing in the Editor but I don't think this will change anything.