FAQ  •  Register  •  Login

MultiDamage fix

Moderator: Inside3D Admins

<<

Cobalt

User avatar

Posts: 155

Joined: Wed Jun 10, 2009 2:58 am

Location: NY

Post Fri May 11, 2012 1:38 am

Re: MultiDamage fix

Ok , going back to the original discussion where it was decided you have to loop through the entire entity list. Not that it really soaks up a heck of a lot of CPU resources doing that, but I noticed this code that might speed things up. I think you could assign a new string .float like in this code and still find the effected clients:

  Code:
local entity p;
p = find (world, stringname, "client");
   while ((p != world))
   {
      /// do whatever to the entity here....

      p = find (p, stringname, "client");
   }





In this example the coder used a float .stringname and set it to "client" in clientconnect which defines them more clearly as a client.

So lets say for multidamage you set a .multidamage string field, and put the players netname into it, then use this code to walk through the matching entities? It ought to work.....
<<

taniwha

Posts: 399

Joined: Thu Jan 14, 2010 7:11 am

Post Fri May 11, 2012 2:18 am

Re: MultiDamage fix

That should work if by "player's name" you mean the name of the player firing the shotgun. You're still looping over the entities list, but at least doing so as quickly as possible.
Leave others their otherness.
http://quakeforge.net/
<<

Spike

Posts: 2084

Joined: Fri Nov 05, 2004 3:12 am

Location: UK

Post Fri May 11, 2012 2:18 am

Re: MultiDamage fix

the find builtin is kinda slow due to the string compares inside. There is always the findfloat[chain] builtin if you want to avoid slow stuff. Or you can build a list/chain of entities yourself.
<<

Cobalt

User avatar

Posts: 155

Joined: Wed Jun 10, 2009 2:58 am

Location: NY

Post Fri May 18, 2012 3:34 am

Re: MultiDamage fix

Orion and I have been exchanging some code ideas privately, and I finally have the code working to an extent. One thing I notice is the shotguns always do 4 or 5 points of damage no matter what, which is not like it had done with the original code before the changes.

I looked at the original code again, and am unsure how it takes the original 4 or 5 points of damage from the initial command and increases them. does it merely wind up doubling them, or is there more that I am missing here...? (yea)
Previous

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.
Icons provided by Aha Soft