Author Topic: Sawing Script Request  (Read 548 times)

0 Members and 1 Guest are viewing this topic.

Offline p0ppin

  • Camper
  • ***
  • Posts: 303
  • Soldat Mapmaker
Sawing Script Request
« on: June 27, 2009, 11:52:39 pm »
Hello curious scripters, I have a request to ask of anyone willing.  I frequent a server named !Elite Saw n Law, which is limited to those two specified weapons.  The problem is, the saw vs saw portion of the server is extremely tipped in favor of those with better connection speed.  Anyone living near Chicago (serv is hosted by u13) can basically walk through just about anyone whose ping is higher: for example, 0-16 ping is terribly advantageous over a slightly higher ping of 50.

Me and a friend have done some fiddling with different weapon mods for the saw that might help the problem, but have come to agree that there's nothing to be done to fix the unbalance.  However I recently thought perhaps a specific script could be written to make it fairer for sawers that aren't lucky enough to have decent ping.

Without further delay...
  The script would be used along side a saw modded to do 0 damage.  When a player is sawed, the script kills him and awards the attacker 1 point.  When 2 players saw each other, the player with the greatest speed (sum of horizontal/vertical vectors I guess) would be dealt 0 damage by the script and be awarded one point, while the slower player is killed.

If someone is a good scripter, and is extremely bored, please give this a shot  :)  It's very aggravating to be beaten by someone simply because they live a few states closer to the server than you do.  Thanks :P
« Last Edit: June 28, 2009, 12:04:04 am by p0ppin »
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: Sawing Script Request
« Reply #1 on: June 28, 2009, 09:00:30 am »
This is madness  ;D

No srsly. First of all you (of all ppl) should know there are many more factors in saw vs saw then just speed. Things like angle, position and small changes in short time are very important as well, there must be many rules that influence a saw vs saw battle.

What you are suggesting is trying to recreate those rules through scripting plus trying to compensate the influence of ping (and afaik that influence has never been described properly). This will take at least months of tweaking, especially if you want it to have exactly the same 'feel' as normal.

Then I wonder if it is even possible, I think timing is very very important for this job and that is one of the weaker points of the scriptcore.
Simply in order to get someone's speed, you'd like to poll his position as many times as possible. Right now the only 'stable' way to do that is once every second. That means that when you want to calculate someone's speed when he kills, you might only be able to extract that from the difference in position now and one second ago. But what if the player started moving half a second ago? The distance he travels in half a second will be calculated as distance within one second, thus his real speed will be actually twice as high.

If you really want to try this out and find a crazy scripter, I suggest you try to formulate what influence a difference in ping exactly has over the game-play. It seems you already did some research, so maybe you already have an idea about what's really happening.


Come join: EliteCTF
Listen to: My Music

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Sawing Script Request
« Reply #2 on: June 28, 2009, 01:21:02 pm »
Simply in order to get someone's speed, you'd like to poll his position as many times as possible. ...
Code: [Select]
function Speed(const Id: byte): single;
begin
  Result := Sqrt(GetPlayerStat(Id, 'VelX') * GetPlayerStat(Id, 'VelX') + GetPlayerStat(Id, 'VelY') * GetPlayerStat(Id, 'VelY'));
end;
Not even sure if Sqrt exists.. but if ur checking if its > / >= a given constant value, don't even Sqrt it... just square the other side of the inequality. (faster)
But still...
But even with ping, I don't believe its possible to resolve with scripting. I'm not sure how the protocol works but I'm guessing the client "shoots" the victim, and then tells the server, then the server calls OnPlayerDamage (among other things), and if there is ping issues, it may take longer for OnPlayerDamage to get called from player A (who has high ping) than player B (who has low ping) even if they damage each other at the same time. I do not believe there is any way to get around this.

Offline F4||3N

  • Soldier
  • **
  • Posts: 245
Re: Sawing Script Request
« Reply #3 on: July 06, 2009, 09:12:41 pm »
That's rich, coming from p0ppin fresh, The Almighty Saw God!
You're the Chuck Norris of sawing, because you have a fast internet connection.