Jump to content

Home

Siege Changes


ensiform

Recommended Posts

Because Raven decided to use cvars they limited us modders very severely on using more cvars and thus like me i cant even run siege in ensimod or red slushie because of max_cvars.

 

So i've an idea if anyone wants to see if it looks good.

 

setup some structs that depend on number of teams, objectives, etc like this:

 

siegeData, holding global and team stuff

 

teaminfo = teamnum, teamicon, teamobjectives(struct)

 

global = prim_obj, obj.

 

thats all ive got so far and the objective struct looks like this:

 

int team
char longdesc[8192]
char desc[8192]
char gfx[8192]
char mapicon[8192]
char litmapicon[8192]
char donemapicon[8192]
vec4_t	mappos
qboolean completed;
qboolean inuse;

 

im not exactly sure how i would make it work i mean, isnt there only 2 siege teams yet in the code it supports more?

 

there's also the fact that everyone would need the client for it to work.

Link to comment
Share on other sites

#define MAX_SIEGE_OBJECTIVES 1024		// testing
#define BG_MAX_SIEGE_TEAMS 2			// MAX_SIEGE_TEAMS already exists but doesnt work in bg_public

typedef struct bgSiegeObjective_s {
int					team;
//int				objectiveNum;
char				longdesc[8192];
char				desc[8192];
char				gfx[8192];
char				mapicon[8192];
char				litmapicon[8192];
char				donemapicon[8192];
vec4_t				mappos;
qboolean			completed;
qboolean			inuse;
} bgSiegeObjective_t;

typedef struct bgSiegeTeamInfo_s {
int					teamNum;
char				*team_icon;
bgSiegeObjective_t	objective[MAX_SIEGE_OBJECTIVES];
} bgSiegeTeamInfo_t;

typedef struct bgSiegeGlobalInfo_s {
bgSiegeObjective_t	prim_obj;
bgSiegeObjective_t	objective[MAX_SIEGE_OBJECTIVES];
} bgSiegeGlobalInfo_t;

typedef struct bgSiegeData_s {
bgSiegeTeamInfo_t	sTeam[bG_MAX_SIEGE_TEAMS];	// bg_max_siege_teams (2)
bgSiegeGlobalInfo_t	sGlobal;
} bgSiegeData_t;

Link to comment
Share on other sites

mmm, I'm not sure how you'd gain anything from creating new structs like that. It seems to me that the easiest solution would be to just replace the cvars with a 1-to-1 relationship to data types that makes sense for the data and config strings/game events for everything that has to be sent to the client.

 

If it's a major issue for you, I'd just reduce the number of actual cvars in redslushie by turning them into server-side commands that alter global variables on the server.

Link to comment
Share on other sites

okay so here's my prob now i have a func that will read a string for 2 floats (vectors) but i need to make this work for 4 (vec3_t):

 

void CG_ParseMapPos( char *posstr, float *f1, float *f2, float *f3, float *f4 )
{
 	// Parse the float or floats

 	char *middleptr;
 	char buff[64];

 	Q_strncpyz( buff, posstr, sizeof(buff) );
 	for( middleptr = buff; *middleptr && *middleptr != ' '; middleptr++ );
 	if( *middleptr )
 	{
 	  	*middleptr++ = 0;
 	  	*f1 = atof( posstr );
 	  	*f2 = atof( middleptr );
 	}
 	else {
 	  	*f1 = *f2 = atof( posstr );
 	}
}

 

any help?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...