Kyle098 Posted September 12, 2002 Share Posted September 12, 2002 hey i added like 23 new cvars,so the server can control the damage and velocity of each weapon,but when i compiled it and ran it,when i did create server,right before it loaded my monitor blinked a couple of times then it quit tyjhe program,then i removed like 18 of those cvars and it worked,is there a cvar limit that i reached,because i only added 23 cvars so far to jedimod1.2,if,someone is a good coder i can give them my source so they check it out,but only if i trus you(people like ask,dest...and so on i knoiw wont steal my source because they have been through someone stealing source.) Link to comment Share on other sites More sharing options...
Azymn Posted September 12, 2002 Share Posted September 12, 2002 How are you flagging them? Link to comment Share on other sites More sharing options...
ASk Posted September 13, 2002 Share Posted September 13, 2002 There's a limit for one thing: server-to-client config string: // the game guarantees that no string from the network will ever // exceed MAX_STRING_CHARS #define MAX_STRING_CHARS 1024 // max length of a string passed to Cmd_TokenizeString #define MAX_STRING_TOKENS 1024 // max tokens resulting from Cmd_TokenizeString #define MAX_TOKEN_CHARS 1024 // max length of an individual token #define MAX_INFO_STRING 1024 #define MAX_INFO_KEY 1024 #define MAX_INFO_VALUE 1024 #define BIG_INFO_STRING 8192 // used for system info key only #define BIG_INFO_KEY 8192 #define BIG_INFO_VALUE 8192 This effectively limits the cvar number, but I do not think that this was the problem Link to comment Share on other sites More sharing options...
Azymn Posted September 13, 2002 Share Posted September 13, 2002 This effectively limits the cvar number, but I do not think that this was the problem I agree - this only limits the length of the cvar string being passed from game to cgame. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 hey,what do u mean how am i flagging them,i add it to g_local.h,then in g_main.c i add them there and add them to the table.for example if i want my cvar to be rage_blasterdam in g__local.h i type: extern vmCvar_t rage_blasterdam; in g_main.c vmCvar_t rage_blasterdam then in g_main.c in the table: { &rage_blasterdam, "rage_blasterdam", "20", CVAR_SERVERINFO | CVAR_LATCH, 0, qfalse }, ive also tried: {&rage_blasterdam, "rage_blasterdam", "20", CVAR_ARCHIVE |CVAR_SERVERINFO , 0, qfalse }, with all of them but that too doesnt work,hey darth syrup if your willing to help i am willing to give you my source code and you then can see right away what the problem is. Link to comment Share on other sites More sharing options...
Azymn Posted September 14, 2002 Share Posted September 14, 2002 Change this: {&rage_blasterdam, "rage_blasterdam", "20", CVAR_ARCHIVE |CVAR_SERVERINFO , 0, qfalse }, ...to this: {&rage_blasterdam, "rage_blasterdam", "20", CVAR_ARCHIVE, 0, qfalse }, And make sure you only have it in there once (it's shown twice above). Don't change anything else. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 hey,thanks i will try that,you are very helpfull,unlike deadlybofh,=here is my conversation with him today,and jevery other time i ask him a question: sk8ingaelement: hey,can u answer a quick question? Guitarist 225: depends who are u sk8ingaelement: from the message boards,kyle098,BUT i already got the questions i asked you before all answered.i now just have a quick one. sk8ingaelement: I wanted the time between fires to get changed,so now i made that in bg_weapons.c but when i compile it says that: ../bg_weapons.c:87: initializer must be constant ../bg_weapons.c:104: initializer must be constant sk8ingaelement: how can i make the number be a cvar then? Guitarist 225: ok Guitarist 225: that doesnt help me sk8ingaelement: what other info do u need? sk8ingaelement: ? sk8ingaelement: are u there? Guitarist 225: IM BUSY Guitarist 225: not now sk8ingaelement: ok,i will ask like 20 minutes later. Guitarist 225: no Guitarist 225: ur not sk8ingaelement: ?when? Guitarist 225: how bout never sk8ingaelement: why do u have to be so mean? Guitarist 225: cuz im ****ing busy Guitarist 225: now go away Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 yay it worked,so once again thanks darth syrup.i have another question now(there is always another one,lol.,i am still sorta a biggener in this mod making.) I wanted the time between fires to get changed,so now i madecvar instead of the numbers in bg_weapons.c but when i compile it says that: ../bg_weapons.c:87: initializer must be constant ../bg_weapons.c:104: initializer must be constant . i know it is possibe because jediplus i think has variables for it because he said ou can now change all the weapon speeds. Link to comment Share on other sites More sharing options...
Azymn Posted September 14, 2002 Share Posted September 14, 2002 If you want to change the weapon speeds, don't put the cvar in the array: somewhere before the array is read to determine weapon speed, set the value in the array equal to the cvar. Then the array will have the value in it, and your speed will change. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 array, i am sorry but i dont know what you mean,the code is like this: { // WP_BRYAR_PISTOL, // "Bryar Pistol", // char classname[32]; // Spawning name AMMO_BLASTER, // int ammoIndex; // Index to proper ammo slot 15, // int ammoLow; // Count when ammo is low 2, // int energyPerShot; // Amount of energy used per shot 400, // int fireTime; // Amount of time between firings 8192, // int range; // Range of weapon 2, // int altEnergyPerShot; // Amount of energy used for alt-fire 400, // int altFireTime; // Amount of time between alt-firings 8192, // int altRange; // Range of alt-fire 0, // int chargeSubTime; // ms interval for subtracting ammo during charge 200, // int altChargeSubTime; // above for secondary 0, // int chargeSub; // amount to subtract during charge on each interval 1, //int altChargeSub; // above for secondary 0, // int maxCharge; // stop subtracting once charged for this many ms 1500 // int altMaxCharge; // above for secondary now i change the 400 to rage_blastervel for example but it gives me that problem. do u mean i should do the following before the setting: #define firetime rage_blastervel; ? Link to comment Share on other sites More sharing options...
ASk Posted September 14, 2002 Share Posted September 14, 2002 He means that before that variable is referenced, you need to make it equal to the cvar. Array elements must be constant on their definitions. You can always do this: a switch statement on each reference of the variable, on the condition of the currently active weapon, where you make it to use the specific cvar. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 where is this variable referenced?do u mean in g_weapons.c under the bryan pistol coding for example where it says like: int damage = BRYAR_PISTOL_DAMAGE; and stiff like that i should add: int firetime = Rage_pistolvel or in like bg_weapons.h there is a int fireTime; But i cant set that to a variable because it is for all the firetime weapons and i cant have one cvar for all of them. Sorry for the dumb questions as i said before i am a biggener in game coding. also i am trying so people can find my game like in jedimod and i replaced in ui_main.c: static const serverFilter_t serverFilters[] = { {"All", "" }, {"Jedi Knight 2", "" }, {"JediMod", "JediMod" }, with static const serverFilter_t serverFilters[] = { {"All", "" }, {"Jedi Knight 2", "" }, {"JediRage", "JediRage" }, but it still doesnt work. Link to comment Share on other sites More sharing options...
Azymn Posted September 14, 2002 Share Posted September 14, 2002 But i cant set that to a variable because it is for all the firetime weapons and i cant have one cvar for all of them. Try what ASk said, make a switch statement - if it's the gun you want to change the speed for, use the cvar, else on the default case, use the array. static const serverFilter_t serverFilters[] = { {"All", "" }, {"Jedi Knight 2", "" }, {"JediRage", "JediRage" }, Is your mod loading from a "JediRage" folder in the Gamedata directory? Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 Originally posted by Darth_Syrup Is your mod loading from a "JediRage" folder in the Gamedata directory? OHH,OK,THEN IWILL DO THAT. so in bg_pmove it says: if ( pm->cmd.buttons & BUTTON_ALT_ATTACK ) { if (pm->ps->weapon == WP_DISRUPTOR && pm->ps->zoomMode != 1) { PM_AddEvent( EV_FIRE_WEAPON ); addTime = weaponData[pm->ps->weapon].fireTime; } else { PM_AddEvent( EV_ALT_FIRE ); addTime = weaponData[pm->ps->weapon].altFireTime; } } else { PM_AddEvent( EV_FIRE_WEAPON ); addTime = weaponData[pm->ps->weapon].fireTime; by switch statement do u mean a if then else statement? something like: if (wp_BryanPistol) { int firetime= rage_pistolvel.integer } Link to comment Share on other sites More sharing options...
Azymn Posted September 14, 2002 Share Posted September 14, 2002 by switch statement do u mean a if then else statement? something like: if (wp_BryanPistol) { int firetime= rage_pistolvel.integer } Yeah, something like that. Why not just: if (wp_BryanPistol) { addTime = rage_pistolvel.integer } Then you won't have to change the array, assuming it's not used anywhere else (i'm pretty sure the firetime is only checked right here). Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 oh ok now i get it so should i put if (wp_BryanPistol) { addTime = rage_pistolvel.integer } instead of what it says or should i put all the weapons first and write else then waht it said before i changed the code. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 i did what you told me and when i compiled it said that my cvars where undeclared identifiers so i declared each cvar in the begginign of g_pmove.c by typing the following for each cvar: extern vmCvar_t rage_pistolspeed; then it compiled but in the game now my guns shoot but they dont shoot anything?did i declare my cvars in the wrong place or did i edit the wrong thing? Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 never mind i got the gun to shoot,but now the only problem is that they all shoot at one fast rate and changeing the cvar value doesnt make the speed change. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 14, 2002 Author Share Posted September 14, 2002 now i got the speed to go down somehow by making the if statemet to this: if (pm->ps->weapon == WP_BRYAR_PISTOL) { PM_AddEvent( EV_FIRE_WEAPON ); addTime = rage_pistolspeed.integer; } but i stillcant chnage the speed in the game and now the alt attack on some weapons is the same as the regular attack and on some it is combined. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 15, 2002 Author Share Posted September 15, 2002 anyone? Link to comment Share on other sites More sharing options...
Azymn Posted September 15, 2002 Share Posted September 15, 2002 Look through the code, look at what it does for each weapon's primary and secondary fire, and look at what you're doing. Link to comment Share on other sites More sharing options...
Kyle098 Posted September 15, 2002 Author Share Posted September 15, 2002 no, i am pretty sure the problem is not that but the problem is the cvar i declared i the wrong place and\or bg_pmove doesnt reach g_main.c where the value of the cvars are declared and stuff. Link to comment Share on other sites More sharing options...
The Eternal Posted September 16, 2002 Share Posted September 16, 2002 The pmove stuff should be seen seperately from game and cgame.. it might have access to g_main, sure but it ****s up on movement prediction clientside when accessing that. you should use a seperate array in pmove_t for example. i haven't ever tested cvars in pmove i think, (never needed them) but i 'think' it ****s up. (btw, there is no cvar limit, only memory limit because q3 uses a linked list if it's using a cvar system anthing like q2's) also the cvars do need to be communicated with the clients for them to do correct weapon predictions.. which give problems when using alot (i did it in a q3 mod once.. lotta problems but making the variable names really small and removing alot of them fixxed it) Link to comment Share on other sites More sharing options...
Kyle098 Posted September 16, 2002 Author Share Posted September 16, 2002 ohh, yesterday i was looking through the coding of only pmove for like half an hour and i figured it out, now it all works and i made the alt fire sweet(especially the bowcaster).i want someone good to test it out,i can send you the pk3. Link to comment Share on other sites More sharing options...
ASk Posted September 16, 2002 Share Posted September 16, 2002 The Eternal: there's a limit on a config string length that the server can pass to clients. That effectively limits the g_ cvars number. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.