Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed
Kread's AI Packages
Version: 1.2
Author: Kread-EX
Release Date: 9/11/2010
Introduction This script provides pre-programmed AI Packages, in order to make your life easier when you want to create intelligent enemies. Note that this is only a tool, meant to be used in conjunction with battle events, and doesn't dispense the developper to put a little effort in designing the enemies. Misuse of this script can result in horribly overpowered monsters. Warning given. Although developped for XP, this script is cross-engine and will adapt itself to RMVX.
Instructions There are 5 provided Packages: Healy: Enemies using this AI package will try to heal and cure as much as possible, and only if needed. Only if healing is useless, the default AI will resume. Protect: Enemies using this package will firstly try to buff themselves, then heal, then debuff the party. If nothing of this can work, the default AI will resume. Support: This package doesn't give any priority. The character will just spam support skills with 0 power. If none of the skills can work, the default AI will resume. I recommand to give a rating of 1 to support skills with this package, and a high rating to attack skills, so the default AI won't try to use ineffective skills. Wild: Then again, this package doesn't give priority. The characters will just calculate the average damage caused by all their attacks and always select the most damaging. Balanced: No priorities again, and no orientation either. Basically, this package choose a random skill but only if it works and against a acceptable target. Best used in conjunction with Battle Events.
In the beginning of the script, you have a few constants named AIHealy, AIProtect, AISupport, AIWild and AIBalanced. Very simple, just put in here the IDs of enemies using the selected package, separated by commas. For VX users: The ever-so-convenient note boxes are here. Just add one of these in the box. <package: healy> <package: protect> <package: support> <package: wild> <package: balanced>
If you need to change a package during a battle, use a Call Script command: $game_troop.enemies[member_index].package = :healy, :protect, :support, :wild or :balanced.
Compatibility Should work with all Battle systems, except TBS. Might clash with Tankentai, but I'm not sure.
Terms and Conditions You are free to adapt this work to suit your needs. You can use it for both non-commercial and commercial purposes. Credit is appreciated.
__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.
Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed
Is this script incompatible with Melody? Always get the same error from melody V when I assign a package through noteboxes. Also get a no method from the script call to switch packages.
Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed
I don't experience any error with Melody... Plus, the error you are showing comes from a method I haven't touched. Could you give me more info? Like what other battle scripts you are using, their order in the editor...
__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.
Is this script incompatible with Melody? Always get the same error from melody V when I assign a package through noteboxes. Also get a no method from the script call to switch packages.
Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed
QUOTE (Kread-EX @ Sep 24 2010, 11:32 PM)
I don't experience any error with Melody... Plus, the error you are showing comes from a method I haven't touched. Could you give me more info? Like what other battle scripts you are using, their order in the editor...
Only battle scripts I'm using are the Engine Melody's I through V. They're in their original order, and I've tried this with the AI Package script before and after them. My project file isn't using YEM AI or YEM Enemy levels either. Just to make sure, I tried using this with the original Melody 1.00_m demo and I get the same error. I forgot to mention that I'm using ATB in Sideview, if that makes a difference. In my enemy's notebox, "<package: protect>" is pasted exactly like that. Before the fight even starts, I get the error I posted above.
Since I couldn't get the battle to start while the enemy had a package assigned, I tried to assign one through the script call during battle. When switch 10 is turned on, my battle event tab calls "$game_troop.enemies[46].package = :wild" and the switch gets turned off. I receive this error both on my project and the Melody 1.00m demo- 54345.png ( 3.94K )
Number of downloads: 4
I'm not familiar with script calls, so I'm pretty sure this is an error on my part and I applied it in an incorrect manner?
When I switched the battle system type to PressTurn battle, I was able to assign a package, but my above method of switching packages gave me the same error.
*edit- I only get the error I posted before in ATB when an enemy starts off with the protect, balanced, or wild package.
This post has been edited by crazydragon: Sep 25 2010, 07:42 AM
Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed
For your error during the script call, it's because you are calling a non-existent enemy. The index you need to put in $game_troop.enemies[index] is not the ID in the database, but the order in the troop. In your example, you are trying to pinpoint the 46th enemy in the current troop.
I'm searching for the incompatibility problem with ATB. I'll get back to you once I found it.
__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.
Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed
Ah I see. That makes sense : P. Unfortunately when I tried this, I still received the same error. It now reads like this=
$game_troop.enemies[1].package = :wild
My troop only has 1 enemy so this should be the correct number, right? I've tried it with the packages that work with ATB (healy and support) and still received the same error. Just to make sure, I'm supposed to be calling this from "Script..." under "Advanced" from the third tab in Event Commands, right?
Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed
No, with only 1 enemy, the correct number is 0. ^^
As for your ATB problem, I don't seem to be able to replicate it at all. All packages work for me... Are you sure you are using the version 1.1? Because the first version of the script had a bug making the wild package only working with RMXP.
__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.
Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed
Oh, I completely forgot to take strings into consideration. I believe the error appears when the skill is supposed to miss (physical ones for instance). Anyway, I fixed the problem so you need to download the script again. Now the enemies will not use the skill if it misses when they test it.
__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.
Script 'Kread's AI Package' Line 575: SyntaxError occured.
Error after I uploaded your new version.
__________________________
Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.
QUOTE ('Exiled One')
"If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
That's a facepalm to myself, because I should of notice something so simple.
__________________________
Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.
QUOTE ('Exiled One')
"If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others."
Group: Member
Posts: 21
Type: None
RM Skill: Undisclosed
QUOTE (Kread-EX @ Apr 18 2011, 05:58 AM)
I've put the code directly in the first post. Until Pockethouse is up again (I hope it will).
Question could this be made to work with AI controlled party members?
Also would their be a way to make it so that an AI could learn as the game goes on enemies weaknesses?
IE: Learning AI:
CODE
Enemy: Slime Weaknesses: Blank Strengths: Blank
Controlled Character uses attack (melee damage) Normal Melee attack is ineffective so Learning AI now knows not to use this. Learning AI party member uses (melee piercing) ineffective it will now no longer try this one on this enemy/enemy type. Controlled Character uses Fire spell (fire element) enemy takes more than 100% damage. Learning AI now will attempt to use this spell type. (but it should try other types or base them off of players trials and errors.) Controlled Character uses Water Element spell. Slime heals. Learning AI says ok I will never ever use water on this slime.
I think that would be a great idea have several learning ai's for use with a AI party member. (Perhaps even allow information to be entered for stuff the AI should already know. IE: Learning AI Party Member is a Vampire Slayer: It should know most if not all weaknesses/strengths of vampires and not make mistakes when battling them even if it messes up on other enemies.)
Would it also be possible to right an AI that checks for enemies health/status and uses the correct strength spells? IE: Will not cast Fire 3 when the enemy could/would die from a Fire 1 spell. (Hmm maybe a slightly bad idea since I am not sure if an AI should always know that unless you always show an enemies hp to the player. Just I don't think over killing and wasting precious mp is a good idea lol.)