Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[2.2]Programmable AI via scripting
#31
@Bender_EX
the source code / dll has does not let you add armor.
it lets you see the values of your target, and based on that you can make your character press controls (up down left right defend jump attack).



Azriel~
Reply
Thanks given by:
#32
I'm pretty good at algorithms, but I don't get how can I start working with this dll file. Tried to read that, but can anybody explain what do I exactly do with this ddraw.dll and where do i put my script? Step by step, please?
Reply
Thanks given by:
#33
quick steps:
1. put the dll in the lf2 folder (i.e. /lf2/ddraw.dll).
2. make a folder "ai" in the lf2 folder (i.e. /lf2/ai)
3. in this ai folder, any [id].chai files ([id] being the id of ur char) will be used as an ai script for ur char, so you'll have 13.chai for an id 13: char.
4. start coding.

tip: if statements can't span multiple lines.



Azriel~
Reply
Thanks given by:
#34
1.1 Update released. Weeeeeeee
[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ʟᴇᴇᴘ.


Reply
Thanks given by:
#35
1 dumb question, how do you create a new .chai file?
Reply
Thanks given by:
#36
@rhino freak
right click > new > text file. rename it (press f2 when it's selected) to id.chai.
if you can't see the ".txt" extension. go to folder options (press alt when you are in an explorer window > tools > folder options), in the view tab, uncheck the box that says "hide extensions for known file types".

@topic:
global variables would really be nice, though if it doesn't work, i'll probably figure out a way to just have function(self, target, functionArray) (probably rename that to something shorter) and i'll post that up

edit:
don't worry, found a way around it. now i can just pass in self, target, F (functions), V (vars) to every function =D. wonder what the overhead would be like since there'll be so many map accesses
    CHAI_V1_0-Code:
{
clr();
 
var fn1 = fun(FN) {
	print("fn1");
	var f2 = FN["fn2"]; f2(FN);
}
 
var fn2 = fun(FN) {
	print("fn2");
	var f = FN["fn3"]; f(FN);
}
 
var fn3 = fun(FN) {
	print("fn3");
}
 
var FN = ["fn1":fn1, "fn2":fn2, "fn3":fn3];
var f = FN["fn1"]; f(FN); // because FN["fn1"]() doesn't work
 
return 1;
}




Azriel~
Reply
Thanks given by: Rhino.Freak , Alblaka
#37
Question:
Does the Parser seriously parse through the whole .chai's EVERY frame?
Or is it just parsing renewed whenever detecting a change in file?

OR is the instant adaption to changes in the .chai's a sole (and in that case entirely legit) feature of the DEBUG version only?
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:
#38
Does the Parser seriously parse through the whole .chai's EVERY frame?
Yes.

Multiple times per frame
[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ʟᴇᴇᴘ.


Reply
Thanks given by:
#39
Isn't that sort of ludicrously inefficient?
My Creations: (Click to View)

Return (String) System.getNewsOfTheDay();
Barely active, expect slow responses. If at all.


Greetz,
Alblaka
Reply
Thanks given by:
#40
still - do you do that to keep the RAM from getting yet more load due to AIs for all ids or for easier editing?
and would we get better performance if you only read in all AI.chais once (for the no console version at least)?
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)