sorry, may I ask how to write the script so that the AI will do D>J when target is on his right and D<J when target is on his left? (no matter which direction they are facing) Thank you very much.
Thread Rating:
|
[2.2]Programmable AI via scripting
|
|
Hi, of course you may
. Welcome to LFE. In the future you should make a separate thread for any questions you have (so this thread doesn't get cluttered).You can do it by reading the x variable of self and target. If target.x > self.x then you should do DrJ() else you should do DlJ() . In code form this looks like this: Code: if (target.x > self.x)If you were a perfectionist you could change to an else if ( target.x < self.x) and add another else to decide what to do if they are on the same x. The version I posted will do D<J if they are on the same x coordinate. ![]() 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ʟᴇᴇᴘ.
08-22-2012, 02:11 PM
Announcing version 3.0:
Download: http://www.mediafire.com/?pxd026nqoqgw0 Change log (Click to View)
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: YinYin
working on a list for the data struct
(08-22-2012, 02:11 PM)Someone else Wrote:so that's basically like loadTarget(i) except allowing multiple ones with any name we want? that will make my basic AI a lot easier to handle (08-22-2012, 02:11 PM)Someone else Wrote:could you mash up a quick example for this? edit: game.objects[self.num].data.frames[self.frame].opoint.oid this example does not work this one does: self.data.frames[self.frame].opoint.oid
08-22-2012, 05:18 PM
(08-22-2012, 02:42 PM)YinYin Wrote: edit: game.objects[self.num].data.frames[self.frame].opoint.oidFixed. Version 3.1 I guess. Download: http://www.mediafire.com/?pxd026nqoqgw0
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.
09-14-2012, 04:50 PM
Version 3.2:
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.
09-15-2012, 05:23 PM
Pretty much appreciated. Good job and Thanks ^^.
Also, did you guys figure a way to make the armor work? Do u think its even possible? I really wanna help you with what you're doing, but i guess I need some more time to grasp what you've learnt before (these reverse engineering and hex stuff). Thanks again! ![]() A-Engine: A new beat em up game engine inspired by LF2. Coming soon A-Engine Dev Blog - Update #8: Timeout
09-24-2012, 02:38 PM
In this thread, you posted a method for patching the exe to load rarara.dll. But this dll seems to work without any patching in LF2.exe (v2.0a). I am interested in knowing how.
Also, does this dll work on exes that have resource edits?
09-24-2012, 03:03 PM
(09-24-2012, 02:38 PM)Electric Shock Wrote: In this thread, you posted a method for patching the exe to load rarara.dll. But this dll seems to work without any patching in LF2.exe (v2.0a). I am interested in knowing how.LF2 requires ddraw.dll to display the graphics on-screen. At first, it'll search for the dll in the folder the exe is located in; if the dll is not there, it'll go to into the windows\system32\-folder. Basically, the patched ddraw.dll executes the AI-related stuff and then calls the original dll. This means that (09-24-2012, 02:38 PM)Electric Shock Wrote: Also, does this dll work on exes that have resource edits?Yes. I'm using it with an overly patched exe (resources + dll-framework + various hex-edits around the place) and it's working flawlessly
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~ "Freeze, you're under vrest!" - Mark, probably. » Gallery | » Sprites | » DeviantArt Thanks given by: A-Man , Electric2Shock
11-20-2012, 10:46 AM
the program looks realy good, but I cant open the 7z file, the 7zip say that is corrupted, can u plz upload it again with winrar or winzip?
|
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)

Chat




. Welcome to LFE. In the future you should make a separate thread for any questions you have (so this thread doesn't get cluttered).



![[Image: signature.png]](http://s3.postimg.org/wedqxlk3n/signature.png)
