Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Github repository, made some minor improvements
There were some changes I wanted to make. To share them, I put them in a github repository: Can consider this zort's fork until Silva or SomeoneElse give their approval I guess.

Here's the list of changes:
  • Upgraded to Angelscript 2.32.0 (mainly for array.sort() that takes comparator function)
  • Added Object.vrests (was split into int vrest and char unkwn8[396])
  • Added global elapsed_time (number of TUs since start of match)
  • Added vector3 type
  • Copy more fields from Object to Info (the self and target globals):
    • x_real, y_real, z_real
    • vector3 position, velocity
    • wait_counter (also fixed offset in Object, previously was 4 bytes off, as was ctimer and ccatcher)
    • weapon_holder
  • Added function setEnemy(int) for use in ego() for setting the enemy that the AI targets when you return 0 from ego() (in fact I initially thought this was what loadTarget did) - though it's only as useful as ego() is, which at the moment is not very useful because it's limited to basic Template AI
  • Fixed signatures of Info constructors, now you can construct an Info via Info(object_num) (useful because unlike Object, Info stores its own num and other goodies)
  • Made Info fields changeable (non-const), now you can do like obj.frame =[obj.frame].next to simulate obj in the next TU
  • Added enum ItrKinds:

Here's the DLLs: debug, release

Everything is backwards compatible of course, or at least it should be.

To show some of the new features, here's a script that always targets the nearest enemy (gets very confused):

double distance_to(const Info& other) {
    return (self.position - other.position).length();
bool closer(const Info& a, const Info& b) {
    return distance_to(a) < distance_to(b);
array<const Info@> getEnemyObjects() {
    array<const Info@> ret = {};
    for (int i = 0; i < 400; i++) {
        // exists
        if (!game.exists[i])
        // not us
        if (i == self.num)
        // is enemy
        if (game.objects[i].team ==
        // is alive
        if (game.objects[i].hp <= 0)
    return ret;
array<const Info@> getEnemies() {
    array<const Info@> enemyObjects = getEnemyObjects();
    array<const Info@> ret = {};
    for (uint i = 0; i < enemyObjects.length(); i++) {
        // is human
        if (enemyObjects[i].type != 0) 
    return ret;
array<const Info@> attackableEnemies() {
    array<const Info@> enemies = getEnemies();
    array<const Info@> ret = {};
    for (uint i = 0; i < enemies.length(); i++) {
        if (enemies[i].state == STATE_LYING)
        if (enemies[i].blink != 0)
    return ret;
array<const Info@> attackableEnemiesByDistance() {
    array<const Info@> attackable_enemies = attackableEnemies();
    attackable_enemies.sort(function(a,b){return closer(a,b);});
    return attackable_enemies;
int ego() {
    array<const Info@> enemies = attackableEnemiesByDistance();
    if (enemies.length > 0)
    return 0;
I get a lot of e-mails that kick off by saying, I"I want to be zort's best bud' but who cares, so do lots of people, you have to more than just want it.
Thanks given by: Memento , MangaD , Luigi600 , RazenBrenday , MoragWan
I'm fine with marking this as the official release.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.

Thanks given by:
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Thanks given by:
(11-21-2018, 02:54 AM)zort Wrote:  Here's the DLLs: debug, release

The links are dead.
Refer to this thread for links and a repository.

Sorry for grave-digging, but there may be many guys came here for the DLL.. :)
Thanks given by: Memento
sry for grave digging, was using debug version of this but ctimer seems to be bugged

Edit: fixed ctimer version linked by JohnDoeAntler on discord
back from the dead.....kinda
Thanks given by:
(08-15-2020, 07:00 AM)Nyamaiku Wrote:  sry for grave digging, was using debug version of this but ctimer seems to be bugged

Edit: fixed ctimer version linked by JohnDoeAntler on discord

ohhh i had issues with c-timer not working i ended up using randomizer to do moves while catching enemy.
This fixes the c-timer bug where it doesn't work?
Thanks given by:

Users browsing this thread: 1 Guest(s)