Community made patches and improvements

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby C.Brutail » Wed Jan 14, 2009 3:30 pm

Wow,good job! :)
"One should strive to achieve; not sit in bitter regret."
WE ARE NEXUIZ.
Image
Image
C.Brutail
Laidback mapper
 
Posts: 2357
Joined: Tue Feb 28, 2006 7:26 pm
Location: Ironforge

Postby halogene » Wed Jan 14, 2009 3:44 pm

Amazing! Thanks!
<Community>: Why was the name "Nexuiz" licensed to IllFonic in a way that allows IllFonic to use the name without any suffix or subtitle for a commercial console game?
<Lee Vermeulen>:
<Community>: http://www.xonotic.org
halogene
Alien trapper
 
Posts: 465
Joined: Fri Jun 20, 2008 8:31 am
Location: http://www.xonotic.org

Postby divVerent » Wed Jan 14, 2009 6:01 pm

Looks pretty good now, but:

+ cvar_set("crosshair", "0"); //Make sure engine crosshairs are always off for now.

Avoid this. Don't touch the cvars... only read them.

Instead, I suggest this:

Look at this line:

R_SetView(VF_DRAWCROSSHAIR, !scoreboard_active && !ons_showmap);

Make it:

R_SetView(VF_DRAWCROSSHAIR, 0);

and use the condition

if(!scoreboard_active && !ons_showmap)

for drawing your crosshair. That way, you can keep the "crosshair" cvar working as it should.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby MirceaKitsune » Wed Jan 14, 2009 8:41 pm

Fixed that detail as well. I mainly intended that as something temporary since I wasn't sure if you wanted to keep the engine crosshair system in Darkplaces or not. LINK 1 LINK 2.
Last edited by MirceaKitsune on Wed Jan 14, 2009 9:09 pm, edited 1 time in total.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby esteel » Wed Jan 14, 2009 9:03 pm

I'd do away the crosshair_default_* stuff.. just use what is currently set into crosshair_*

to see how to do this, an example:
Code: Select all
        if(last_weapon != activeweapon) {
              wcross_wep = ""; // not sure if this is needed.. did not take a closer look at the code right before..
              if(cvar("crosshair_custom")) // IMO a bad name, crosshair_per_weapon or _per_gun might be better?
                      e = get_weaponinfo(activeweapon);
                      wcross_wep = strcat("_", e.netname);
              }
              wcross_style = cvar(strcat("crosshair", wcross_wep));
              wcross_color_x = cvar(strcat("crosshair", wcross_wep, "_color_red"));
              wcross_color_y = cvar(strcat("crosshair", wcross_wep, "_color_green"));
              wcross_color_z = cvar(strcat("crosshair", wcross_wep, "_color_blue"));
              wcross_size_x = cvar(strcat("crosshair", wcross_wep, "_size")) * 24;
              wcross_size_y = wcross_size_x;
              wcross_size_z = 0;
              wcross_alpha = cvar(strcat("crosshair", wcross_wep, "_color_alpha"));
              weapontime = time;
              last_weapon = activeweapon;


That would make some of your changes unneeded as it just uses the current variables..
Last edited by esteel on Thu Jan 15, 2009 6:09 pm, edited 1 time in total.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby Spaceman » Thu Jan 15, 2009 2:44 am

A small patch to improve the messages set by server/g_damage.qc

Get it here http://paste.debian.net/26028/

Changes

moved the 'You killed your own dumb self' line lower down, hopefully below the scoreboard

made a 'sv_gentle' message less offensive

cleaned the code 'couldn't resist the urge to self-destruct', commented a few unneeded lines - need to confirm that they are unwanted

changed '"^7 committed suicide.' to the same style as the others

changed the wording of 'ended it all with a x kill spree'

changed 'teammate' to 'team mate' eight times, I took a quick poll on IRC and 2 voted in favour, 0 against, 79 abstained

added the team players name to 'Moron! You fragged a teammate'

added 'Frist blood', 'Frist victim' centerprint messages

moved another message below the scoreboard

changed some whitespace - made the code look a bit prettier :D
Spaceman
Alien trapper
 
Posts: 264
Joined: Tue Aug 28, 2007 10:53 am

Postby Spaceman » Thu Jan 15, 2009 3:01 am

Some crosshair code I wrote for client/sbar.qc.
Code: Select all
void draw_crosshair()
{ // not all crosshair images are square ;)
   vector ch_position, ch_colour;
   vector ch_size;
   string ch_name;
   float ch_alpha;

   ch_name = strcat("gfx/crosshair", ftos(cvar("crosshair")));

   ch_size = drawgetimagesize(ch_name) * cvar("crosshair_size");

   ch_position_x = (vid_conwidth - ch_size_x) * 0.5;
   ch_position_y = (vid_conheight - ch_size_y) * 0.5;

   ch_colour_x = cvar("crosshair_color_red");
   ch_colour_y = cvar("crosshair_color_green");
   ch_colour_z = cvar("crosshair_color_blue");

   ch_alpha = cvar("crosshair_color_alpha");

   drawpic(ch_position, ch_name, ch_size, ch_colour, ch_alpha, 0);
}

Note: The 0 in the last line needs to be changed to a constant, probably DRAWFLAG_NORMAL.

Change client/View.qc R_SetView(VF_DRAWCROSSHAIR, !scoreboard_active && !ons_showmap);
to R_SetView(VF_DRAWCROSSHAIR, 0); or similar.
Spaceman
Alien trapper
 
Posts: 264
Joined: Tue Aug 28, 2007 10:53 am

Postby divVerent » Thu Jan 15, 2009 5:47 am

victim wrote:cleaned the code 'couldn't resist the urge to self-destruct', commented a few unneeded lines - need to confirm that they are unwanted


It was wanted, in case the weapon code does not set the message.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Spaceman » Thu Jan 15, 2009 11:36 am

Do the following need to be updated?
    server/arena.qc line 262
    server/clientcommands.qc lines 468 and 480
    server/teamplay.qc lines 394 and 457
Spaceman
Alien trapper
 
Posts: 264
Joined: Tue Aug 28, 2007 10:53 am

Postby MirceaKitsune » Thu Jan 15, 2009 2:16 pm

Yet more work on the custom crosshairs patch which fixes the final problems. The first one was the crosshair displaying when the scoreboard or ONS map were active... I added a simple check to prevent that. This fixes crosshairs showing to players while they are dead or at the end of the game which looked ugly.

The second fix is a check to update the enabling or disabling the crosshair_custom cvar dynamically. Now switching between custom or non-custom crosshairs from the menu checkbox updates the crosshair instantly rather then when you switch to a new weapon again. I had to use a goto as that was the only and best way to reapply over a past setting which needs to have already been checked.

Also, changing crosshair properties (style, size, color and alpha) update on the fly as well since I got these checks out of the if(last_weapon != activeweapon) statement so crosshair changes are now checked and updated every frame in case of a change (I was afraid of performance issues but I've checked closely and there are none).

New patch available HERE and HERE.
Last edited by MirceaKitsune on Thu Jan 15, 2009 4:54 pm, edited 2 times in total.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

PreviousNext

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron