Author |
Message |
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed May 21, 2008 10:50 am Post subject: hs_util |
|
|
|
|
I'm releasing the newest version of the Hyperspace utility modules. These modules don't depend on the hscore, and can be useful to most ASSS zones.
There are four independent (exception: see the note for kill) components to this library:
- Formula: This module will parse formulas from strings, such as "4*3.2+8^2" and "$jackpot/max($teamsize,5)". The primary usefulness is embedding formulas into configuration files. Variables can be specified when evaluating the formula. Also included is a formula_cmd module that gives players access to a ?formula command that they can use as a simple calculator.
Available unary (one argument) functions:
abs, acos, acosh, asin, asinh, atan, atanh, ceil, cos, cosh
exp, floor, log, log10, log2, round, sin, sinh, sqrt, tan
tanh, trunc
|
Available binary (two argument) functions:
atan2, hypot, max, min, mod, remainder
|
- Menu: This module will generate the formatted menus seen in many hyperspace commands. It allows tables with optional column headers, text areas with wrapped text, menu titles, and automatic width matching between sections. The included ?menuformat command allows a player to switch their formatter. Two formatters are included: hs and simple. Other formatters can be modeled on these two with (hopefully) minimal effort.
The "hs" formatter:
+-----------------+
| Menu Formatters |
+-----------+-----+---+
| Formatter | Default |
+-----------+---------+
| hs | * |
| simple | |
+-----------+---------+
|
The "simple" formatter:
Menu Formatters
-----------------
Formatter|Default
-----------------
hs | *
simple |
|
- Selfpos: This module sends "self position packets" for the purposes of warping, setting bounties, setting status bits, and firing weapons. This module will try to match the outgoing packet's time stamp to the player's lag to reduce the effect of the "offset bug". It also does all the necessary administrative tasks, such as incrementing weapon packet counts. It also uses the game module to only send the packets to the players that would normally get them, to reduce the outgoing packet count. A selfpos_cmd module is included for testing purposes.
- Kill: This module will kill players with a *thor, optionally sending the blast to surrounding players or teammates. It supports the generation of fake killers (e.g. <engine failure> in Hyperspace). It also supports killing using existing players. All of the fake player overhead is handled transparently, such as removing fakes in an empty arena so it can be destroyed. NOTE that kill depends on selfpos to kill players in safeties. A kill_cmd module is included for testing the loading and unloading of fake killers.
These modules are online in Hyperspace, but have not been rigorously tested. There may be a few bugs in them, so please post any problems you encounter. The selfpos module is missing some features advertised in the .h file (coalescing of bounty/status packets, and timestamp deltas), but if you need any of them let me know and I'll make completing them a top priority.
Building:
The included makefile should handle all the building for anyone using the regular ASSS make system. If you don't have bison and flex (needed to build some .c files from the formula grammar), put the parser.c, parser.h, lexer.c files from hs_util_noflexbison.zip into the hs_util/ directory, and the makefile won't try to build them.
If you're not using the ASSS make system, the only thing you need to worry about is passing -DUSE_AKD_LAG to the compiler if you're using HZ's akd_lag module. Otherwise, just add all the .c files you can find, and add hs_util to the include directories for your own modules. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Revision 1153
hs_util_noflexbison.zip - 28.98 KB
File downloaded or viewed 228 time(s)
Revision 1153
hs_util.zip - 21.86 KB
File downloaded or viewed 248 time(s)
|
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu May 22, 2008 8:48 pm Post subject: |
|
|
|
|
If you're not using the asss.asss.hs monotone branch, you'll need to apply (minimally) this patch _________________
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Tue Jul 28, 2009 6:53 pm Post subject: |
|
|
|
|
Hey, sorry for bump, but do you mind re-uploading that patch? Seems to redirect to asss 1.5.0, and that doesn't really help because my security.so module doesn't work with asss 1.5.0, and it doesn't come with one.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Tue Jul 28, 2009 10:25 pm Post subject: |
|
|
|
|
I seem to recall the issue being a missing energy field in the player position structure. Unfortunately, that commit got combined with a bunch of other ones when the switch to mercurial was made, but here are the important bits:
diff -r 443387f9c075 -r 005e019b97c8 src/include/player.h
--- a/src/include/player.h Fri Nov 09 04:16:56 2007 -0800
+++ b/src/include/player.h Mon Apr 06 00:44:18 2009 -0700
@@ -155,6 +155,7 @@
int rotation; /**< rotation value (0-63) */
unsigned bounty; /**< current bounty */
unsigned status; /**< status bitfield */
+ int energy; /**< current energy */
};
/* pyconst: define int, "STATUS_*" */
|
diff -r 443387f9c075 -r 005e019b97c8 src/core/game.c
--- a/src/core/game.c Fri Nov 09 04:16:56 2007 -0800
+++ b/src/core/game.c Mon Apr 06 00:44:18 2009 -0700
@@ -518,6 +518,7 @@
p->position.rotation = pos->rotation;
p->position.bounty = pos->bounty;
p->position.status = pos->status;
+ p->position.energy = pos->energy;
}
if (p->flags.sent_ppk == 0 && !isfake)
|
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed Jul 29, 2009 6:26 pm Post subject: |
|
|
|
|
It's probably easier to apply those patches manually, since they're one line each. Just search the files for the correct place to put in the line starting with the +. Probably near line 155 in player.h and 518 in game.c.
What did you mean about HSCore?
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Thu Jul 30, 2009 1:48 pm Post subject: |
|
|
|
|
Quote: | To get spawner to compile, you'll need the modification to game.c/game.h in 5bbdeb509511dd9efbf5872ebf656bb3e0a7615b of the branch asss.asss.hs. Or if you don't want/need items to affect energy viewing, you can just comment out the offending sections in the spawner.
|
That part.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
|
KrynetiX Seasoned Helper
Gender: Joined: Jan 06 2003 Posts: 137 Location: Poconos Offline
|
Posted: Fri Dec 18, 2009 3:55 am Post subject: |
|
|
|
|
again, where's the delete post button? should be able to delete your own
|
|
Back to top |
|
|
Onuzim Newbie
Joined: Apr 18 2014 Posts: 1 Offline
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sat Apr 19, 2014 2:03 pm Post subject: |
|
|
|
|
It's been years since I've done anything on that. Unfortunately I don't have any system setup where I can compile it, so I can't just send you the autogenerated files.
Anyway, I looked through the sources, and it looks like all you'll need to do is open up lexer.c and move the #include "ast.h" higher up in the file so it's above the #include "parser.h". You could also add #include "ast.h" into parser.h.
Once that's done you may want to make the files read-only so your changes don't get blasted away.
I wish I had a more permanent solution for you, but I've forgotten what little I ever knew about flex and bison.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sat Apr 19, 2014 2:04 pm Post subject: |
|
|
|
|
Onuzim wrote: | I won't ask about Windows compiling. |
The only tricky part on windows is getting flex and bison installed. If you're not going to be doing any development, you could just take the output files from your ubuntu machine (after making the above changes) and compile them on windows.
|
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Sun Apr 20, 2014 12:49 am Post subject: |
|
|
|
|
Dr Brain wrote: | [..]
The only tricky part on windows is getting flex and bison installed. If you're not going to be doing any development, you could just take the output files from your ubuntu machine (after making the above changes) and compile them on windows. |
I've been trying to get asss to recompile on windows but haven't had any luck - even went back to the 1.4.4 release that I once compiled hs_money (?) with the funky "all HS fines to go to cypherjf" mod to it. No such luck. Let alone 1.5.x. Was there new dependencies added since then that would really cause that much of an issue with building on windows? Grel had the windeps flow pretty much going, I feared the day that you (et al) wouldn't be able to provide security.dll for new releases. :/ _________________ Performance is often the art of cheating carefully. - James Gosling
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sun Apr 20, 2014 7:22 am Post subject: |
|
|
|
|
This thread is about hs_util. If you're having problems with asss make a new thread and we can try to work through them. I'll be gone most of this week though.
|
|
Back to top |
|
|
|