March 28 2024 11:47:51
Navigation
· Home
· Articles
· Downloads
· FAQ
· Discussion Forum
· Web Links
· News Categories
· Contact Me
· Photo Gallery
· Search
· Gameservers
Languages
Users Online
· Guests Online: 3

· Members Online: 0

· Total Members: 1,127
· Newest Member: Highl@nder
Teamspeak 3
Last Seen Users
· Intruder10:59:37
· Highl@nder15:44:52
· Silent Bob20:12:50
· desintegrator 1 day
· Jerry 2 days
· gus 2 days
· forrest747 3 days
· WEZ 3 days
· Sully 4 days
· doomed 1 week
· Terminator 1 week
· The ACE 1 week
· GONZO 2 weeks
· VictorMyson 3 weeks
· Don Turtuma 4 weeks

View Thread: New Game Mode
Vietcong.Info » Vietcong General Discussion » General Discussion
Who is here? 1 Guest
Current Rating: (Total: 0 ratings)  
 Print Thread
New Game Mode
H5N1 Bird Flu
Hi

I got idea for new game mode.

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 Smile oh learning learning learning Smile LENIN Smile...ok thx anyway..
Edited by H5N1 Bird Flu on 25-03-2014 08:37
 
30min.vietcong1.cz
Ando
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)
 
H5N1 Bird Flu
OK I have no problem with testing.

Finally if u want I will test them...I wanna "fresh blood" to the maps Smile

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...)
Edited by H5N1 Bird Flu on 25-03-2014 18:38
  x 1
 
30min.vietcong1.cz
KostiCZ
Ando, I can host it on SpecOps server
Signature________________________________________________

2LT William Theolinus "KostiCZ" Boner Jr.
LRRP Squad Baker, Delta Team
cache.www.gametracker.com/player/KostiCZ/63.143.47.189:2302/b_560x95.png
 
Teamrespawn.cz
Ando
There should be test with big team.
Unfortunately I have no time for VC but I hope somebody can organize that test.
Then I will fix bugs if needed.


I will upload testmap and source codes later to my scripts topic. Hopefully useful for somebody.
 
H5N1 Bird Flu
OK I´m in....also Nosek told me that he will join for testing....
 
30min.vietcong1.cz
Nosek
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 APPLAUSE. 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).
  x 1
 
www.clan-delta.websnadno.cz
H5N1 Bird Flu
You forgot in Duel mod weapons are don´t dispear when round ends...so in the next round you are able to load more ammo from weapons on the ground.

Also map looks good may I use it on server ?
 
30min.vietcong1.cz
Ando
Thanks for testings and feedback.
I try to fix bugs and hopefully soon.


Bird Flu, sure you can use it.
  x 1  x 2
 
Blastard
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
SignatureKb@ cap.blastard in vietcong
 
H5N1 Bird Flu
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 Smile
 
30min.vietcong1.cz
Blastard
I hope so . Feel free to join my server running with a few new mods kb@ server
SignatureKb@ cap.blastard in vietcong
 
Ando
So, GG, HTF and SSA is working without bugs?

Then I will post those source codes.
  x 3
 
H5N1 Bird Flu
Yes, these 3 modes are ok.
 
30min.vietcong1.cz
Blastard
Ando wrote:
So, GG, HTF and SSA is working without bugs?

Then I will post those source codes.



No one mod is having some problems . the duel mode with 1 bullet. sometimes it gets stuck and causes the server to crash
SignatureKb@ cap.blastard in vietcong
  x 1
 
Nosek
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!
  x 1
 
www.clan-delta.websnadno.cz
Ando
Fixed the bugs with Duel mode

Airsoft and Zombie described bugs don't appear to me, I don't know why (I tested with 2 x editor)
 
Nosek
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:
Download source  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);


*/


#include <inc\sc_global.h>
#include <inc\sc_def.h>

#define SHOW_PLAYER_COLOR         1
#define SHOW_PLAYERS_COUNT         1

#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

//#define RECOVER_POINT_ID   29         //custom recower point id.
#ifndef SC_MP_RESPAWN_HTF
#define   SC_MP_RESPAWN_HTF   29         //29   
#endif


#define   ON_GROUND_TIME      20      // max time while droped flag is on ground
//__________________________________________________________________


#define FLAG_PH_INBASE            0
#define FLAG_PH_ONPLAYER         1
#define FLAG_PH_ONGROUND         2


#define PRELOADBES_FLAG_VC   2

//ENHANCEMENT - variable for custom interval of adding 1 point for player holding the flag
#define ADD_POINT_INTERVAL      5.0f  //now 5 seconds

//________________________________

dword gPhase =         GPHASE_BEGIN;
float gPhase_timer =   BEGIN_TIMER;

//___________________________
// for extra tab info
ushort *player_s;

float on_player_timer;
float pl_dist;
float On_Ground_Timer=0;
float pl_total_time;
float pl_time;

float gCLN_MyFlagTimer;

void *gFlagNod;

c_Vector3 OrigFlagPos;
c_Vector3 flag_pos;
c_Vector3 orig_flag_pos;
c_Vector3 vec;

dword         pl_id;
dword         Flag_Ground_ID=0;
dword         Flag_Player_id;
dword         Flag_Player_handle;

dword         my_pl_inslot[64];
dword         my_pl_points[64];
dword         my_pl;
dword         cur_handle;
dword         PC_handle;
dword         killer_handle;
dword         last_flag_player;
dword         cln_Flag_Player_handle;



s_SC_P_Create   get_weap_inf;


int flag_phase;
int last_srv_weap=0;
int last_weap=-1;
int cur_weap=0;
int row;
int my_min;
int my_sec;
int pl_slot;
int PL_points;
int CUR_PL_points;


dword gRecs = 0;
s_SC_MP_Recover gRec[REC_MAX];
float   gRecTimer[REC_MAX];
BOOL   player_added;
BOOL   weap_removed=FALSE;
BOOL   Flag_Player_killed=FALSE;
BOOL   cln_flag_on_ground=FALSE;
BOOL   cln_flag_in_base=FALSE;
BOOL   start_game;
BOOL     EnumPls;


dword radar_color;
dword gEndRule;
dword gEndValue;
float gTime;
float Prev_time;
float update_timer;
float new_time;
float delay_timer;

dword gPlayersConnected = 0;


BOOL    fade_off = TRUE;
float   client_fade_timer = RESTART_TIMER;
float   fade_off_timer;
float   complete_f_timer=0;


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;
           
         }
         break;
      default:
         //SC_message("EndRule unsopported: %d",gEndRule);
         break;
   }// switch(gEndRule)
   if(completed){   
      if(gPhase!=GPHASE_MISSION_COMPLETED){
         if(win_pl){
            SC_sgi(GVAR_WINNER,SC_MP_GetHandleofPl(win_pl));
         }
         gPhase=GPHASE_MISSION_COMPLETED;
         SC_sgi(GVAR_GPHASE,gPhase);
         SC_MP_LoadNextMap();
         return TRUE;
      }
   }
   return FALSE;
}// void SRV_CheckEndRule(float time)



int ScriptMain(s_SC_NET_info *info){
   char txt[32];
   dword i;
   int j,k;
   int max_point;
   void *nod;
   s_SC_MP_Recover *precov;
   s_SC_MP_hud hudinfo;
   s_SC_MP_EnumPlayers enum_pl[64];
   s_SC_MP_SRV_settings SRVset;
   s_SC_HUD_MP_icon icon[3];
   dword icons;
   ushort wtxt[128],wtxt2[64],*witxt,*my_witxt;
   float   sc_width,sc_height,val;

   switch(info->message){
      case SC_NET_MES_SERVER_TICK:   

         //________________________________________________________________   
         //gPlayersConnected = 64;
         EnumPls=FALSE;
         if (SC_MP_EnumPlayers(enum_pl,&gPlayersConnected,SC_MP_ENUMPLAYER_SIDE_ALL)){
            EnumPls=TRUE;
         }


         gPhase_timer -= info->elapsed_time;
         switch(gPhase){
         case GPHASE_BEGIN:
            if (gPhase_timer <= 0.0f){
               SC_MP_SetInstantRecovery(TRUE);//
               gPhase_timer=0;
               gPhase=GPHASE_WAIT_PLAYERS;
               SC_sgi(GVAR_GPHASE,gPhase);
            }
            break;
         case GPHASE_WAIT_PLAYERS:
            if (gPlayersConnected >1){
               gPhase_timer = RESTART_TIMER;
               gPhase=GPHASE_START_GAME;
               SC_sgi(GVAR_GPHASE,gPhase);
            }
            break;
         case GPHASE_START_GAME:
            if (gPhase_timer <= 0.0f){
               SC_MP_SetInstantRecovery(FALSE);               
               gTime = 0;
               gPhase=GPHASE_GAME;
               SC_sgi(GVAR_GPHASE,gPhase);
               
               SC_sgi(GVAR_FLAG_STATUS,FLAG_PH_INBASE);
               
               SC_MP_SRV_ClearPlsStats();
               SC_MP_SRV_InitGameAfterInactive();
               SC_MP_RecoverAllNoAiPlayers();   
            }
            break;
           
         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);
             
                     SC_sgi(GVAR_FLAG_STATUS,FLAG_PH_ONGROUND);
                     //gPhase=GPHASE_FLAG_ON_GROUND;
                     //SC_sgi(GVAR_GPHASE,gPhase);
               
                //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;



               }
            }   
           
            switch(SC_ggi(GVAR_FLAG_STATUS)){
            case FLAG_PH_INBASE: //_________
               if(!cln_flag_in_base){
                  icon[0].color = 0xffffffff;           
                  icon[0].type = SC_HUD_MP_ICON_TYPE_NONE;
                  icon[0].icon_id = 3;
                  SC_MP_SetIconHUD(icon,1);
               
               
                  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);
             
                  last_flag_player=-1;
                  if(cln_Flag_Player_handle){
                     pl_id = SC_MP_GetPlofHandle(cln_Flag_Player_handle);
                     SC_P_UnLink3pvEqp(pl_id,0);   
                     swprintf(wtxt,SC_AnsiToUni("%s  -  %S",wtxt2),SC_Wtxt(1068),SC_P_GetName(pl_id));//#1068:    #tee Flag dropped!
                     SC_GameInfoW(wtxt);
                  }
                  cln_flag_on_ground=TRUE;
                  cln_flag_in_base=FALSE;
               }
               break;
            case FLAG_PH_ONPLAYER: //_________
               cln_Flag_Player_handle = SC_ggi(GVAR_FLAG_PLAYER);
               pl_id = SC_MP_GetPlofHandle(cln_Flag_Player_handle);
               SC_P_GetPos(pl_id, &vec);
               SC_HUD_RadarShowPos(&vec, radar_color);//0xffffffff// white
               
               if(last_flag_player != cln_Flag_Player_handle){
                  icon[0].color = 0xffffffff;           
                  icon[0].type = SC_HUD_MP_ICON_TYPE_NONE;
                  icon[0].icon_id = 4;
                  SC_MP_SetIconHUD(icon,1);
                 
                 
                 
                  last_flag_player = cln_Flag_Player_handle;
                  SC_DUMMY_Set_DoNotRenHier2(gFlagNod,TRUE);// dont show base flag
                  pl_id = SC_MP_GetPlofHandle(cln_Flag_Player_handle);
                  SC_P_Link3pvEqp(pl_id,0,PRELOADBES_FLAG_VC,"G\\WEAPONS\\Vvh_flag\\eqp\\Vvh_flag_VC_3pv.eqp");
                  if(pl_id == SC_PC_Get()){
                     SC_SND_PlaySound2D(10424);
                     radar_color=0x99ffffff;
                  }else{
                     radar_color=0xff000000;
                     swprintf(wtxt,SC_AnsiToUni("%s  -  %S",wtxt2),SC_Wtxt(1067),SC_P_GetName(pl_id));//#1067:    #tee Flag stolen!
                     SC_GameInfoW(wtxt);
                  }
                  cln_flag_on_ground=FALSE;
                  cln_flag_in_base=FALSE;
               }
               
               if((pl_id) && (pl_id == SC_PC_Get())){
                     gCLN_MyFlagTimer += info->elapsed_time;
                      while (gCLN_MyFlagTimer > 1.0f) gCLN_MyFlagTimer -= 1.0f;
                      if (gCLN_MyFlagTimer>0.5f) icon[0].color = (dword)(511.0f * (gCLN_MyFlagTimer-0.5f));
                        else icon[0].color = (dword)(511.0f * (0.5f-gCLN_MyFlagTimer));
                     icon[0].color <<= 24;
                     icon[0].color += 0x00ffffff;           
                     icon[0].type = SC_HUD_MP_ICON_TYPE_NONE;
                     icon[0].icon_id = 4;
                     SC_MP_SetIconHUD(icon,1);
                     
               }
           
           
               break;
            }
            break;
         case GPHASE_MISSION_COMPLETED:   
            if (fade_off){
               complete_f_timer -= info->elapsed_time;
               if (complete_f_timer < -6.0f){   
                  SC_FadeTo(TRUE, FADE_TIME);
                  fade_off=FALSE;
               }
            }
            swprintf(wtxt,SC_AnsiToUni("%s", wtxt2),SC_Wtxt(2026));//#2026:    #tee   Mission completed
            SC_GetScreenRes(&sc_width,&sc_height);
            val= (sc_width*0.5) - (SC_Fnt_GetWidthW(wtxt,1)*0.5);         
            SC_Fnt_WriteW(val,15,wtxt,1,0xffffffff);

           
            //SC_MP_GetMaxPointsPl(&max_point))
           
            swprintf(wtxt,SC_AnsiToUni("Best player:  %S ", wtxt2), SC_P_GetName(SC_MP_GetPlofHandle(SC_ggi(GVAR_WINNER))));
            //SC_Fnt_WriteW((sc_width*0.5),(sc_height*0.5),wtxt,1.1,0x85ffffff);
            val= (sc_width*0.5) - (SC_Fnt_GetWidthW(wtxt,1)*0.5);   
            SC_Fnt_WriteW(val,35,wtxt,1,0xffffffff);
            break;
         }
         break;// SC_NET_MES_CLIENT_TICK
      case SC_NET_MES_SERVER_KILL:
         //info->param2//killer
         //info->param1//killed
      
       //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);
         }

         SC_MP_SRV_SetForceSide(0xffffffff);
         SC_MP_SetChooseValidSides(3);
         SC_HUD_DisableRadar(TRUE);         
         SC_MP_SRV_SetClassLimitsForDM();   
         CLEAR(hudinfo);
         hudinfo.title = 1050;
         hudinfo.sort_by[0] = SC_HUD_MP_SORTBY_POINTS;         
         hudinfo.sort_by[1] = SC_HUD_MP_SORTBY_KILLS;
         hudinfo.sort_by[2] = SC_HUD_MP_SORTBY_DEATHS | SC_HUD_MP_SORT_DOWNUP;
         hudinfo.sort_by[3] = SC_HUD_MP_SORTBY_PINGS | SC_HUD_MP_SORT_DOWNUP;
         hudinfo.pl_mask = SC_HUD_MP_PL_MASK_POINTS  | SC_HUD_MP_PL_MASK_KILLS | SC_HUD_MP_PL_MASK_DEATHS;
         hudinfo.use_sides = 0;
         SC_MP_HUD_SetTabInfo(&hudinfo);
         SC_MP_AllowStPwD(FALSE);
         SC_MP_AllowFriendlyFireOFF(FALSE);
         SC_MP_SetItemsNoDisappear(FALSE);
         if (info->param2){   
            // preload flag items
            SC_Item_Preload(146);

            // 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);
            
            
               //SC_MP_Gvar_SetSynchro(GVAR_FLAG_TIMER);
               
               SC_MP_Gvar_SetSynchro(GVAR_FLAG_STATUS);
               SC_sgi(GVAR_FLAG_STATUS,FLAG_PH_INBASE);               
               

               SC_sgi(GVAR_GPHASE,gPhase);
               //_______________________________________________________________________________________
               

               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

            info->fval1 = RECOVER_TIME;
         }
         break;
      case SC_NET_MES_SERVER_RECOVER_PLACE:
         precov = (s_SC_MP_Recover*)info->param2;
         i = SC_MP_SRV_GetBestDMrecov(gRec,gRecs,gRecTimer,NORECOV_TIME);
         gRecTimer[i] = NORECOV_TIME;
         *precov = gRec[i];     
         break;
      case SC_NET_MES_RESTARTMAP: //___________________________________________________________
         gPhase_timer = BEGIN_TIMER;
         gPhase = GPHASE_BEGIN;   
         SC_sgi(GVAR_GPHASE,gPhase);
         break;// SC_NET_MES_RESTARTMAP
      case SC_NET_MES_RULESCHANGED:         
         gEndRule = info->param1;
         gEndValue = info->param2;
         gTime = 0.0f;
         break;
   }// switch(info->message)
   return 1;
}// int ScriptMain(void)







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.
Edited by Nosek on 22-04-2014 01:48
 
www.clan-delta.websnadno.cz
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
Multiple Ded Servers not visible in game list General Discussion 2 19-06-2023 23:59
Problem with walking NPCs in the game. General Discussion 3 26-04-2021 23:43
Game with Jarek Kolar - Registration OPEN General Discussion 15 16-02-2021 23:44
Hey guys I need help my game will not run Vietcong Tech Talk 7 19-03-2020 13:48
Multiplayer Game Script Vietcong Tech Talk 4 22-06-2019 19:31
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Render time: 0.43 seconds - 88 Queries 4,880,826 unique visits