|
Post by reverendwolf on Sept 2, 2007 20:13:40 GMT -5
So, i've been going over some things, and i see that traits can be used to create AI for battle characters.
first, is that so?
second, could a script similar to this one work? I've written it in psuedo-code because the game isn't in front of me and i've only had a total of 3 hrs experience with it anyway, mostly used on VFX and Map editing
turn start set var_LeaderHP = check hp (party leader) set var_MercHP = check hp (mercenary) set var_LeaderPercent = ([check max hp (party leader)] / 100) * 25 set var_MercPercent = ([check max hp (mercenary)] / 100) * 35
if var_leaderHP < var_mercHP if var_leaderHP < var_leaderPercent set flag HealLeader = 1 set flag HealMerc = 0 run script [MercAIHeal] else run script [MercAIAttack] end if else if var_mercHP < var_mercPercent set flag healleader = 0 set flag healmerc = 1 run script [mercAIheal] else run script [mercAIattack] end if turn end
|
|
|
Post by realitybites on Sept 3, 2007 8:08:23 GMT -5
Hmm quite interesting, it seems your trying for 2 player AI, like a leader, and a second AI member, well I hate to break it to ya, but that is one of the hardest things to do in RPGM2, mainly because RPGM2 can't completely determine the Z coordinates. So far what you have looks good, might I suggest taking a look at Nash's 3rd Gen ACBS?
|
|
|
Post by doyleman on Sept 3, 2007 8:16:33 GMT -5
thats not a 2 player game script o.O
It seems more like a party memeber AI that will heal when the leaders HP is so far down, attack otherwise.
What I dont get is the MercAIAttack/Heal and the mercAIAttack/Heal. Lowercase, but are they the same person?
|
|
|
Post by Dungeon Warden on Sept 3, 2007 9:37:39 GMT -5
A word of warning when using Traits in battle. The script will run twice - once at the beginning of a round (allowing you to effect things like battle order) and again during the turn of whoever has the trait script. The Trait Flag will tell you if the trait is running at the beginning (flag = off) or during the action (flag = on). Note that the game doesn't explain what this flag does (there are three flags what weren't translated - check my advanced FAQ for more information).
A word of caution: Writing battle scripts requires expert knowledge of the battle commands and formulas. Some of the "code" lines that you wrote would actually take several lines of RPG Maker 2 commands to work properly. In particular, you need to switch the active character whenever you want to check or change the stats of the target or instigator. You can read about these commands in my FAQ, but be warned that you will likely spend a huge amount of time debugging the scripts.
Fortunately, there are a few scripts already written that can simplify the process. For example, there are scripts to test the MP and HP of both the instigator and target.
As far as I can tell (you could have just said what you wanted to do instead of writing an unusable script) your idea should work. It is not hard to change the target of a healing ability as long as you understand how the Trait variables and flags work (again, check my FAQ for details).
P.S. Trait scripts replace a character's battle actions, so the player can't select the actions of that character. This is so you can have NPC's join the party (you can see an example of this in the sample game - Fu-Ma).
|
|
|
Post by reverendwolf on Sept 3, 2007 16:03:04 GMT -5
damien- doyle's right-- not a 2p script, but an AI character the player hires and doesn't control. i'm not so ambitious to try and tackle that sort of stuff if Nash hasn't yet. From what I've seen around these boards and the Pavillion, he's the authority on CBSystems. I'll let him play with the hard stuff while I tinker and just try to figure this thing out.
doyle- The uppercase/lowercase difference is nil, that was just due to my laziness in typing.
Warden- thanks for that info. i noticed the "Heal" trait in the default scripts, but unfortunately a lot of the script lines i can't understand can't be "edited," so i don't really understand what they do. it seems to be, as far as i can read and understand, fairly close to what i'm looking for.
please understand, i wrote the "code" because i have a hard time with programming unless i write it down. not knowing really what-could-do-what i simply wrote what i wanted to do in the order i wanted to do it. i'm not an expert at programming in any language, though i ca pretty much understand and decipher most things if i read enough. the script is taking me a while though, because a lot of the options have to be set as you (type? select? organize?) the script lines, and some of them can't be edited after the fact for me to see really what they can affect.
thanks again, guys.
|
|
|
Post by realitybites on Sept 3, 2007 22:25:21 GMT -5
damien- doyle's right-- not a 2p script, but an AI character the player hires and doesn't control. i'm not so ambitious to try and tackle that sort of stuff if Nash hasn't yet. From what I've seen around these boards and the Pavillion, he's the authority on CBSystems. I'll let him play with the hard stuff while I tinker and just try to figure this thing out. doyle- The uppercase/lowercase difference is nil, that was just due to my laziness in typing. Warden- thanks for that info. i noticed the "Heal" trait in the default scripts, but unfortunately a lot of the script lines i can't understand can't be "edited," so i don't really understand what they do. it seems to be, as far as i can read and understand, fairly close to what i'm looking for. please understand, i wrote the "code" because i have a hard time with programming unless i write it down. not knowing really what-could-do-what i simply wrote what i wanted to do in the order i wanted to do it. i'm not an expert at programming in any language, though i ca pretty much understand and decipher most things if i read enough. the script is taking me a while though, because a lot of the options have to be set as you (type? select? organize?) the script lines, and some of them can't be edited after the fact for me to see really what they can affect. thanks again, guys. Ah, I thought it was 2p AI, my bad.
|
|
|
Post by Dungeon Warden on Sept 4, 2007 9:06:00 GMT -5
From what I've seen around these boards and the Pavillion, [Nash's] the authority on CBSystems. Actually, Nash is the authority on action battle systems and customization. I'm the authority on editing the default battle system and working with Trait scripts. In other words, look to Nash if you want to create anything new, look to me if you want to alter and expand the current system. Warden- thanks for that info. i noticed the Heal trait in the default scripts, but unfortunately a lot of the script lines i can't understand can't be edited, so i don't really understand what they do. it seems to be, as far as i can read and understand, fairly close to what i'm looking for. As I said, you really need to understand the commands and variables in order to do any AI design. If you read the notes in my FAQ and play around with the different options, you'll eventually understand how everything works. please understand, i wrote the code because i have a hard time with programming unless i write it down. not knowing really what-could-do-what i simply wrote what i wanted to do in the order i wanted to do it. i'm not an expert at programming in any language, though i ca pretty much understand and decipher most things if i read enough. the script is taking me a while though, because a lot of the options have to be set as you (type? select? organize?) the script lines, and some of them can't be edited after the fact for me to see really what they can affect. What you need to do is learn to create a flow chart. This allows you to write programs in a way that doesn't require any special code and is easy to visualize and edit. Flow charts were created for the very problem you mentioned. Do some research
|
|