Coasterdude Posted April 1, 2007 Share Posted April 1, 2007 .\g_weapon.c(482) : error C2106: '=' : left operand must be l-value I get that error and I've been trying to fix it for an hour. LoL. Link to comment Share on other sites More sharing options...
razorace Posted April 1, 2007 Share Posted April 1, 2007 What's on line 482 of that line? Link to comment Share on other sites More sharing options...
Coasterdude Posted April 1, 2007 Author Share Posted April 1, 2007 Hmm.. I did some changes and I don't get that error anymore. Anyway I'm trying to make blaster spread different for movement with this.... Under static void WP_FireBlaster( gentity_t *ent, qboolean altFire ) in g_weapon.c if ( altFire ) { if ( (ent->client->pers.cmd.forwardmove > 0) || (ent->client->pers.cmd.forwardmove < 0) || (ent->client->pers.cmd.rightmove < 0) || (ent->client->pers.cmd.rightmove > 0) ) { angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 2.0); angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 2.0); } else if ( ent->client->pers.cmd.upmove == 0 ) { angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 4.0); angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 4.0); } else { angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 1.0); angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 1.0); } } also I changed BLASTER_SPREAD to define this #define BLASTER_SPREAD wmw_BlasterSpread.integer wmw_BlasterSpread.integer is 1.6 Ingame I do see changes in the spread, but It's not what I wanted. Standing still has alot of spread. crouching gives good accuracy, more accurate than normal spread (1.6). Running has more accurate spread than just standing still lol. So I did something wrong, but I'm not sure what I did wrong. Link to comment Share on other sites More sharing options...
razorace Posted April 1, 2007 Share Posted April 1, 2007 1. pers.cmd is just the commanded movement direction for the player, not their actual movement. 2. "else if ( ent->client->pers.cmd.upmove == 0 )" will apply if you're not trying to move in any direction other than up/down. This is why you're having crap accuracy when standing still. This should be else if ( ent->client->pers.cmd.upmove > 0 ) IE, if ( ent->client->pers.cmd.upmove > 0 ) {//jumping is the worse, it should go first so it will override normal movement. } else if ( (ent->client->pers.cmd.forwardmove > 0) || (ent->client->pers.cmd.forwardmove < 0) || (ent->client->pers.cmd.rightmove < 0) || (ent->client->pers.cmd.rightmove > 0) ) {//for normal movement } else if ( ent->client->pers.cmd.upmove < 0 ) {//crouching } else {//standing, not moving. } Link to comment Share on other sites More sharing options...
Coasterdude Posted April 1, 2007 Author Share Posted April 1, 2007 Ahhh.. Thanks. Oh and I'm using the OJP Basic Source Code. and I didn't edit power duel in anyway. When I was playing power duel, I was the single duelist, and I was playing against 2 bots who were on the paired duelists, the second paired duelist always got booted by server command overflow when a new round started. Link to comment Share on other sites More sharing options...
razorace Posted April 1, 2007 Share Posted April 1, 2007 hmmm, interesting. That's probably due to a infinite team switching loop or something. If you got the qconsole.log of it happening, go ahead and post a bug ticket for it on the OJP bug tracker. Link to comment Share on other sites More sharing options...
ensiform Posted April 1, 2007 Share Posted April 1, 2007 Hmm.. I did some changes and I don't get that error anymore. Anyway I'm trying to make blaster spread different for movement with this.... Under static void WP_FireBlaster( gentity_t *ent, qboolean altFire ) in g_weapon.c if ( altFire ) { if ( (ent->client->pers.cmd.forwardmove > 0) || (ent->client->pers.cmd.forwardmove < 0) || (ent->client->pers.cmd.rightmove < 0) || (ent->client->pers.cmd.rightmove > 0) ) { angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 2.0); angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 2.0); } else if ( ent->client->pers.cmd.upmove == 0 ) { angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 4.0); angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 4.0); } else { angs[PITCH] += crandom() * (wmw_BlasterSpread.integer * 1.0); angs[YAW] += crandom() * (wmw_BlasterSpread.integer * 1.0); } } also I changed BLASTER_SPREAD to define this #define BLASTER_SPREAD wmw_BlasterSpread.integer wmw_BlasterSpread.integer is 1.6 Ingame I do see changes in the spread, but It's not what I wanted. Standing still has alot of spread. crouching gives good accuracy, more accurate than normal spread (1.6). Running has more accurate spread than just standing still lol. So I did something wrong, but I'm not sure what I did wrong. well for one that will actually only be 1 due to floor round conversion that is automatically used when you try to do an float when its actually an int. you are going to want cvar.value instead. Link to comment Share on other sites More sharing options...
Coasterdude Posted April 1, 2007 Author Share Posted April 1, 2007 Is there something for falling? Link to comment Share on other sites More sharing options...
razorace Posted April 2, 2007 Share Posted April 2, 2007 Falling or mid-air? Link to comment Share on other sites More sharing options...
Coasterdude Posted April 2, 2007 Author Share Posted April 2, 2007 mid-air not pressing anything. EDIT: OOOoo I have an idea! Ima try it out! Ill let you know if it works. Link to comment Share on other sites More sharing options...
Coasterdude Posted April 2, 2007 Author Share Posted April 2, 2007 Hmm everything seems to be working correctly except, when you jump you can just let go of all your keys and your accuracy is better lol. Link to comment Share on other sites More sharing options...
razorace Posted April 2, 2007 Share Posted April 2, 2007 Well, see, that's part of the problem with your design. You're using the player's desired command rather than their actual movement. Link to comment Share on other sites More sharing options...
Coasterdude Posted April 2, 2007 Author Share Posted April 2, 2007 im using pm->cmd but same result. So what tracks their actual movement? Link to comment Share on other sites More sharing options...
Coasterdude Posted April 6, 2007 Author Share Posted April 6, 2007 Yesss!!! I got it all working perfectly! Thanks for the help guys. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.