Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[2.2]Programmable AI via scripting
(06-12-2013, 05:45 PM)zort Wrote:  I have here a patch that adds a previously unknown field in the sObject struct:
Code:
--- sgame.h    2013-06-12 13:18:41.033551073 -0400
+++ my_sgame.h    2013-06-12 13:40:13.569301698 -0400
@@ -213,7 +213,8 @@
     int frame3;
     int frame4;
     char facing;
-    char unkwn3[15];
+    char unkwn3[11];
+    int wait_counter;
     int ccatcher;
     int ctimer;
     int weapon_type;
I haven't actually tested this change. Please tell me if this is not the preferred way to submit patches.
EDIT: Changed name from delay_counter to wait_counter to reflect naming in data files :S
Currently there is not a preferred way to submit patches. Basically whatever works.
It's the time before you go to the next frame?

(06-14-2013, 07:21 PM)zort Wrote:  Could you enable the math add-on (http://www.angelcode.com/angelscript/sdk..._math.html)?
Will do.

(06-14-2013, 07:21 PM)zort Wrote:  Also, you know how for some reason you can't handle Frame (or Itr or whatever) thingies?:
Code:
Frame x = game.objects[self.num].data.frames[0];
=>
ERROR : Data type can't be 'const Frame'
You actually can but it is quite unintuitive the way it works.
In the above code you are declaring a new Frame object and setting it equal to an existing one. First of all if you could do that it would be wasteful in resources as the data is already stored in memory somewhere else, and on top of that you aren't allowed to do so anyway because I haven't registered a factory function for the types anyway.
The way to do it is by using handles (signified by using an @ symbol).
Also since all of the API objects are declared as "const" you will have to use "const" as well.
The following code loops through standing frames and displays their bodys:
    CPP-Code:
int n = 0;
for(const Frame <DVZ_ME#0> = target.data.frames[0];;@frame = target.data.frames[frame.next]){
    print("<frame> "+n+"\n");
 
    for(int i = 0;i<frame.bdy_count;++i){
        const Bdy <DVZ_ME#1> = frame.bdys[i];
 
        print("   bdy: \n"
              "      kind: "+bdy.kind+"  x: "+bdy.x+"  y: "+bdy.y+"  w: "+bdy.w+"  h: "+bdy.h+"\n"
              "   bdy_end:\n");
    }
 
    print("<frame_end>\n\n");
 
    n = frame.next;
    if(n >= 400 || n <= 0 || !target.data.frames[n].exists) break;
}


(06-14-2013, 07:21 PM)zort Wrote:  Also:
Code:
enum State {
    STANDING,WALKING,RUNNING,ATTACKING,JUMPING,DASHING,ROWING,DEFENDING,
    BROKEN_DEFENCE,CATCHING,CAUGHT,INJURED,FALLING,FROZEN,LYING,OTHER,DoP,
    DRINKING,BURNING,FIRERUNNING,LOUIS_DASH_ATTACKING=100,DEEP_STRAFING=301,
    TELEPORTING_ENEMY=400,TELEPORTING_FRIEND=401,RUDOLF_TRANSFORMING=500,
    RUDOLF_TRANSFORMING2=501,SELF_HEALING=1700,
}
Will add that as well.
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.
Reply
Thanks given by:


Messages In This Thread
[2.2]Programmable AI via scripting - by Boop - 06-08-2012, 06:31 PM
RE: [2.0]Programmable AI via scripting - by Boop - 06-30-2012, 01:54 PM
RE: [2.1]Programmable AI via scripting - by mfc - 07-05-2012, 10:33 AM
RE: [2.1]Programmable AI via scripting - by Boop - 07-05-2012, 11:53 AM
RE: [2.1]Programmable AI via scripting - by A-Man - 07-05-2012, 12:18 PM
RE: [2.2]Programmable AI via scripting - by A-Man - 07-19-2012, 03:08 PM
RE: [2.2]Programmable AI via scripting - by Boop - 07-19-2012, 03:15 PM
RE: [2.2]Programmable AI via scripting - by Kevin - 07-22-2012, 08:20 AM
RE: [2.2]Programmable AI via scripting - by Boop - 07-27-2012, 04:41 PM
RE: [2.2]Programmable AI via scripting - by A-Man - 09-15-2012, 05:23 PM
RE: [2.2]Programmable AI via scripting - by Boop - 05-05-2013, 04:44 PM
RE: [2.2]Programmable AI via scripting - by zort - 06-12-2013, 05:45 PM
RE: [2.2]Programmable AI via scripting - by Som1Lse - 06-14-2013, 10:39 PM
RE: [2.2]Programmable AI via scripting - by zort - 06-15-2013, 01:44 AM
RE: [2.2]Programmable AI via scripting - by zort - 06-14-2013, 07:21 PM
RE: [2.2]Programmable AI via scripting - by A-Man - 03-29-2016, 01:59 PM
RE: [2.2]Programmable AI via scripting - by Boop - 03-30-2016, 10:26 PM
RE: [2.2]Programmable AI via scripting - by Gad - 02-10-2017, 06:58 PM



Users browsing this thread: 23 Guest(s)