November 26 2024 10:54:20
Navigation
· Home
· Articles
· Downloads
· FAQ
· Discussion Forum
· Web Links
· News Categories
· Contact Me
· Photo Gallery
· Search
· Gameservers
Languages
Users Online
· Guests Online: 24

· Members Online: 0

· Total Members: 1,134
· Newest Member: Brody
Teamspeak 3
Last Seen Users
· hackepter01:36:27
· GONZO18:30:58
· Intruder18:57:41
· Sully 1 day
· desintegrator 2 days
· WEZ 3 days
· Homi 3 days
· The ACE 4 days
· xhc 1 week
· dRgiGGLeZ 1 week
· El Dookie 1 week
· Melber 2 weeks
· SGT PEPPER 2 weeks
· martyr 2 weeks
· Terminator 2 weeks

View Thread: Script troubles
Vietcong.Info » Vietcong General Discussion » Maps & Mapping
Who is here? 1 Guest
Current Rating: (Total: 0 ratings)  
 Print Thread
Script troubles
gemzy
Hey guys,
I am computing light maps for the ground Pfft never done light maps before so I have discovered something new!
As for coop I have never created a coop map before so would not know where to start but I am sure with the right brains it would be possible!
I have tried to add TDMC.c mode. However, when finalizing the mission I get an error message,
Line 1
message parse error.

I created a map using this scrip back in the day, but have not got a clue how I done it or got it to work.
This time I have copied the script into levels/map name/data/scripts
Then went to multiplayer editor
new mode custom selected the script set the parameters.

Can anyone help me please?
Thanks GeMzY^
 
KostiCZ
Parse error? It looks like you have not complete your script, maybe some bracket is missing at the end of script or something wrong in header. Check your script, maybe download it again... Can you post it here?
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
gemzy
Here is the code from the TDMC file
Download source  Code
/*
   Team Deathmatch Classic (TDMC) script by Don Turtuma (http://www.vietcong-coop.net)
   Based on the TDM tutorial script from the Vietcong SDK.
   
   Version history:
   22.8.2004 - Initial version
*/

#include <inc\sc_MPglobal.h>


// defines uf used global variables

#define GVAR_SIDE0FRAGS                   500

#define GVAR_SIDE1FRAGS                   501

#define NORECOV_TIME    3.0f
#define REC_MAX         64

int gSideFrags[2] = {0,0};
int gCLN_SideFrags[2];
dword gRecs = 0;
s_SC_MP_Recover gRec[REC_MAX];
float gRecTimer[REC_MAX];
float gNextRecover = 0.0f;
dword gEndRule;
dword gEndValue;
float gTime;
dword gPlayersConnected = 0;

void UpdateSideFrags(void){
      SC_sgi(GVAR_SIDE0FRAGS,gSideFrags[0]);
      SC_sgi(GVAR_SIDE1FRAGS,gSideFrags[1]);
}

int ScriptMain(s_SC_NET_info *info){
   s_SC_MP_SRV_settings   SRVset;
   s_SC_MP_EnumPlayers enum_pl[64];
   s_SC_MP_Recover *precov;
   s_SC_MP_hud      hudinfo;
   s_SC_P_getinfo   plinfo;
   s_SC_HUD_MP_icon icon[2];
   int i, j, sideA, sideB;

   switch(info->message){
      
      case SC_NET_MES_SERVER_TICK:   
         // server tick, this part of the code is executed on server side only ( dedicated and no-dedicated too)
         switch(gEndRule){
            case SC_MP_ENDRULE_TIME:
               if (gPlayersConnected>0) gTime += info->elapsed_time;
               SC_MP_EndRule_SetTimeLeft(gTime,gPlayersConnected>0);
               if (gTime>gEndValue){
                  SC_MP_LoadNextMap();
                  return TRUE;
               }
               break;
            case SC_MP_ENDRULE_FRAGS:
               if (((gSideFrags[0]>0)&&(gSideFrags[0]>=gEndValue)) || ((gSideFrags[1]>1)&&(gSideFrags[1]>=gEndValue))){
                  SC_MP_LoadNextMap();
                  return TRUE;
               }
               break;

            default:
               SC_message("EndRule unsopported: %d",gEndRule);
               break;
         }
           
         for (i=0;i<gRecs;i++)
            gRecTimer[i] -= info->elapsed_time;

         j = 64;
         if (SC_MP_EnumPlayers(enum_pl,&j,SC_MP_ENUMPLAYER_SIDE_ALL)){
            if ((j==0)&&((gSideFrags[0]+gSideFrags[1])!=0)){
               gSideFrags[0] = 0;
               gSideFrags[1] = 0;
               UpdateSideFrags();
            }// if ((side[0]+side[1])==0)

         }
         gPlayersConnected = j;
         break;

      case SC_NET_MES_CLIENT_TICK:
         // client tick, this part is executed on client only ( including client on no-dedicated server)
         gCLN_SideFrags[0] = SC_ggi(GVAR_SIDE0FRAGS);
         gCLN_SideFrags[1] = SC_ggi(GVAR_SIDE1FRAGS);
         SC_MP_SetSideStats(0,gCLN_SideFrags[0],0);
         SC_MP_SetSideStats(1,gCLN_SideFrags[1],0);
         for (i=0;i<2;i++){
            icon[i].type = SC_HUD_MP_ICON_TYPE_NUMBER;
            icon[i].icon_id = 3*i;
            icon[i].value = gCLN_SideFrags[i];
            icon[i].color = 0xffffffff;
         }
         SC_MP_SetIconHUD(icon,2);
         break;// SC_NET_MES_CLIENT_TICK

      case SC_NET_MES_LEVELPREINIT:
         // is called before level.c SC_LEV_MES_INITSCENE is called
         // use it for set gametype and some basic setting that has to be done before scene initialization
          SC_sgi(GVAR_MP_MISSIONTYPE,GVAR_MP_MISSIONTYPE_TDM);
         gEndRule = info->param1;
         gEndValue = info->param2;
         gTime = 0.0f;
         SC_MP_EnableBotsFromScene(FALSE);
         break;// SC_NET_MES_LEVELPREINIT

      case SC_NET_MES_LEVELINIT:
         // initialization
         SC_MP_SRV_SetForceSide(0xffffffff);
         SC_MP_SetChooseValidSides(3);
         // Set class limits for DM
         SC_MP_SRV_SetClassLimitsForDM();
         // Enable soldiers and disable DM classes
         SC_MP_SRV_SetClassLimit(1, 64); // US Soldier
         SC_MP_SRV_SetClassLimit(21, 64); // VC Soldier
         SC_MP_SRV_SetClassLimit(19, 0); // US DM
         SC_MP_SRV_SetClassLimit(39, 0); // VC DM
         CLEAR(hudinfo);
         hudinfo.title = 1051;
         hudinfo.sort_by[0] = SC_HUD_MP_SORTBY_FRAGS;
         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_FRAGS | SC_HUD_MP_PL_MASK_KILLS | SC_HUD_MP_PL_MASK_DEATHS;
         hudinfo.use_sides = TRUE;
         hudinfo.side_name[0] = 1010;
         hudinfo.side_color[0] = 0x440000ff;
         hudinfo.side_name[1] = 1011;
         hudinfo.side_color[1] = 0x44ff0000;
         hudinfo.side_mask = SC_HUD_MP_SIDE_MASK_FRAGS;
         SC_MP_HUD_SetTabInfo(&hudinfo);
         SC_MP_AllowStPwD(TRUE);
         SC_MP_AllowFriendlyFireOFF(TRUE);
         SC_MP_SetItemsNoDisappear(FALSE);
         if (info->param2){
            if (info->param1){
               // it's server         
               SC_MP_GetSRVsettings(&SRVset);
               // Disable weapons placed on the map
               SC_MP_SRV_InitWeaponsRecovery((float)SRVset.dm_weap_resp_time);
               //SC_MP_SRV_InitWeaponsRecovery(-1.0f);
               SC_MP_Gvar_SetSynchro(GVAR_SIDE0FRAGS);
               SC_MP_Gvar_SetSynchro(GVAR_SIDE1FRAGS);
               UpdateSideFrags();
               gRecs = 0;
               i = REC_MAX - gRecs;
               SC_MP_GetRecovers(SC_MP_RESPAWN_DM,&gRec[gRecs],&i);
               gRecs += i;
               if (gRecs==0) SC_message("no recover place defined!");
               CLEAR(gRecTimer);                         
            }// if (info->param1)
         }//if (info->param2)

         break;// SC_NET_MES_LEVELINIT


      case SC_NET_MES_RENDERHUD:

         // is called on every client in every frame - enables rendering some on screen info


         break;

      case SC_NET_MES_SERVER_RECOVER_TIME:
         // game engine asks server for time to respawn selected player
         if (info->param2){
            info->fval1 = 0.1f;
         }
         else {
            // killed
            info->fval1 = 5;
         }
         break;

      case SC_NET_MES_SERVER_RECOVER_PLACE:
         // game engine asks for place where to recover some player
         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:
         // command restart map came
         gTime = 0;
         CLEAR(gSideFrags);
         UpdateSideFrags();
         SC_MP_SRV_ClearPlsStats();
         SC_MP_SRV_InitGameAfterInactive();
         SC_MP_RecoverAllNoAiPlayers();

         break;// SC_NET_MES_RESTARTMAP

      case SC_NET_MES_RULESCHANGED:
         // command change end rule came
         gEndRule = info->param1;
         gEndValue = info->param2;
         gTime = 0.0f;
         break;

      case SC_NET_MES_SERVER_KILL:
         // some player is killed, check autobalance for example, or score points etc
         SC_P_GetInfo(info->param1,&plinfo);       
         sideA = plinfo.side;
         if (info->param2){
            SC_P_GetInfo(info->param2,&plinfo);       
            sideB = plinfo.side;
         }
         else sideB = 0xffffffff;

         if (sideA==sideB){
            gSideFrags[sideB]--;
         }
         else{
            if (sideB!=0xffffffff) gSideFrags[sideB]++;
          }
         UpdateSideFrags();
         break;// SC_NET_MES_SERVER_KILL
         

   }// switch(info->message)
   


   return 1;

}// int ScriptMain(void)




I have had a look through and I cant seem to find anything...it has been a while since I looked at anything like this. My spare time is now spent building towers with my kids and washing lol!!!
Also does anyone have the DMC script file or can help me in altering the TDMC file so it can be used as DMC.
Thank you
GeMzY
Edited by gemzy on 29-01-2013 01:47
 
gemzy
thankyou. i managed to get the tdmc working. just not dmc. will try this though!
Thankyou!!!
 
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
Multiplayer Game Script Vietcong Tech Talk 4 22-06-2019 19:31
MP sync. script discussion Maps & Mapping 89 26-04-2016 09:40
Ando door script Maps & Mapping 4 25-10-2015 19:50
Vietcong Troubles Vietcong Tech Talk 2 18-06-2015 12:34
ADM script Maps & Mapping 3 03-12-2014 14:23
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Render time: 0.15 seconds - 52 Queries 5,473,427 unique visits