Author Topic: AI Editor Tutorials Thread  (Read 3195 times)

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
AI Editor Tutorials Thread
« on: March 15, 2008, 03:57:21 am »
Welcome to the first of many tutorials on making advanced cutscnes.
This brief tutorial will discuss the best method for having 2 PCs discuss the situation by utilizing the LEAST amount of event commands posssible. However, the wrench is thrown in when Crono is in different positions in the party. Therefore, I have included a simple formulae for making sure your dialoug lines are said in the smoothest manner possible.

Think of this as an "advanced" follow-up of Chrono'99's post here:
http://www.chronocompendium.com/Forums/index.php/topic,2060.msg59848.html#msg59848

For instance, here's an snippit of the event editor:


Above is location {0C5} Giant's Claw Last Tyrano
(which is Event number "085")




You can see in the highlighted spaces in image #1 where they would link to the PC's Arbitrary code, which calls that PC's Object to say display dialog.



Now take a look at image #2, which is Crono's Object code. You can see that the highlighted spaces will make another PC say their line instead. This isn't very effective because, if say, you have Magus in your party, EVERYONE else has speech priority over Magus. So, the best way we can rectify this, is to call another CallObjFunction within Crono's command. In doing this, EVERYONE who gets a chance to speak depending on which position they are in the party.

Check out my modification here:



As you can see, this is MUCH simpler and saves alot of commands and precious space (and we all know that space in a Chrono Trigger ROM is precious... we need all the commands we can get!)

The highlighted parts represent the parts we will be dealing with in this tutorial. So, how do we know the best way to call other PCs from Crono without accidently calling Crono again (crashing the game due to infinite loop) OR calling the same PC three times?

The formulae below is to be followed if, for instance, you don't want any problems.


Notes:
PC1, Arbit3 (would be CallObjFunction "PC1", Arbitrary3)

CallObjFunction would obviously lead to the set Arbitrary in which there would be various commands such as text boxes, character animations and such.


Here's the commands order according to the above screenshot:

PC1, Arbit3
PC0, Arbit4


Normal Circumstance:         Crono points away!:
PC1, Arbit3               PC0, Arbit3
PC0, Arbit4               PC0, Arbit4


Case0 (Crono is PC0)
PC1 - says text
PC0 - pointed to PC2, Arbit4

Case1 (Crono PC1)
PC1 - pointed to PC2, Arbit3
PC0 - says text

Case2 (Crono PC2)
PC1 - says text
PC0 - says text


Now let's break down the pattern here. In Cases 1 & 2, Crono isn't leading the the party and the characters have smooth dialog without problems.

In Case 0, Crono is the leader of the party so we need to point to another party member. As such, we point to PC2 (who is not going to cause conflict) with the sequence.



Here's a VERY BAD formulae so you can see what I mean:

Quote
BAD formulae

Normal Circumstance:         Crono points away?:
PC1, Arbit3               PC2, Arbit3
PC0, Arbit4               PC1, Arbit4

Case0 (Crono is PC0)
PC1 - says text
PC0 - pointed to PC1, Arbit4

Case1 (Crono PC1)
PC1 - pointed to PC2, Arbit3
PC0 - says text

Case2 (Crono PC2)
PC1 - says text
PC0 - says text

/BAD formulae



See the flaw in the pattern? Cases 1 & 2 would still work perfecly, but if the player has Crono as PC0 (1st PC/Party leader), Case 0 would then cause whomever is PC1 (2nd party member) to say two things in a row! They would be interacting/talking to themselves! Whoops!


I hope this removes some confusion in dealing with such patterns so you don't lose you sanity in trying to get the best party dialougs with Crono in various slots. This we use less commands which equals more workable space available in the ROM. (which of course is very precious!) ...AND it allows all players an event chance to speak. Groovy!


HAPPY HACKING!
Mwa ha ha ha ha ha! :twisted:


Stay tuned for my next tutorial, which will cover advanced cutscenes with 5+ party members!!  :D
« Last Edit: September 03, 2008, 07:33:53 pm by Zakyrus »

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Tutorials for various editors
« Reply #1 on: September 03, 2008, 07:16:55 pm »


Here's the AI I'm using for the Trihorn enemies in Searing Chasm.
I simply used the Lavos attack mode/Nizbel, and give it Nizbel's Sprite w/ ChronoTweaker and some new stats.




AI - Broken Down
--

Note: The "SwitchState" nodes are pretty obvious so they're not listed below.


Condition_Unknown(0B,03,3E,7F) (check to see if "Fire Dampened" before attacking)
  ~SetWanderMode(00,06,01) - make enemy wander a bit
  ~Attack (Nearest)
  ~Tech: Growl (Black Tyrano Style)- with "Rrrrrrr!" message. (no damage)
  ~Raises Defense / Display Message: "Trihorn's Fire has re-kindled!"
  (sets all the condition_Unknown flags to be inactive)


Default(00,00,00): (main "attack" script)
 ~Do random of these functions:
  ~Tech: Flare - with "Rrrrrrr!" message.
  ~Tech: Fire2 - with "Rrrrrrr!" message.
  ~Tech: Flare - with "Rrrrrrr!" message.
  ~Attack (nearest)

(Multiple Flare attacks for higher rate of it occuring)


SECTION END - ( Seperator for attack script)


Condition_Unknown(0B,03,3E,C7) (check to see if "Fire Dampened" while getting hit)
  ~Display "Trihorn's Fire is smoldering!"

If Hit by Element(Ice, 00, 00): 
  ~Lowers Defense / Display Message: "Water/Ice dampens fire! Def lowered!"
  (sets the Condition_Unknown flags above to be active - eg. "Fire Dampened") *****

Default(00,00,00): (main "counter-attack" script)
  ~SetWanderMode(00,06,01) - make enemy wander a bit
 (You could add some wicked counter moves here with a randomizer)

SECTION END - ( Seperator for attacked/counter-attack script & End of code)


***** The SetStat command changes the desired enemy's stat while setting the conditions for the Condition_Unknown command to check (in this case "Fire Dampened"). One thing I know for sure is that the enemy's Speed stat has alot to do with the amount of turns it takes before the Condition_Unknown (at the top of the script/Attack part) runs and thus is able to reset the flag. A Speed of 8 will take a few turns if you're using highly leveled PCs, whereas with a Speed of 18 - they'd recover quickly no matter what.


Hope this helps anyone that's just starting to play around with the AIEditor.


~Z

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Tutorials for various editors
« Reply #2 on: September 03, 2008, 07:31:49 pm »
I think we should try to keep TF tutorials in the TF how to thread and we can make seperate tutorials for each editor?

If it's alright with you Zakyrus?  We can rename this AI Editor Tutorial?   and move the first post of this to the TF how to thread.  I can also rename my Haste2/Ice storm thread to Tech Editor Tutorial?

It would help for if people are looking for help for a specific tool.

--JP

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: Tutorials for various editors
« Reply #3 on: September 03, 2008, 07:32:50 pm »
I think we should try to keep TF tutorials in the TF how to thread and we can make seperate tutorials for each editor?

If it's alright with you Zakyrus?  We can rename this AI Editor Tutorial?   and move the first post of this to the TF how to thread.  I can also rename my Haste2/Ice storm thread to Tech Editor Tutorial?

It would help for if people are looking for help for a specific tool.

--JP

Excellent idea, jsondag2! Consider it done! (In spite of the fact of the first post being a TF  tutorial.)

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: AI Editor Tutorials Thread
« Reply #4 on: September 03, 2008, 07:48:17 pm »
(Summons the Mods)

Can you guys make this happen?  You can delete the messages discussion about the reorganizing....and this message.


--JP

Zakyrus

  • Entity
  • Magical Dreamer (+1250)
  • *
  • Posts: 1359
  • "Bouncy, bouncy, bouncy... --!!"
    • View Profile
Re: AI Editor Tutorials Thread
« Reply #5 on: September 04, 2008, 09:00:06 pm »
Combines Mod Summon with jsondag2's Mod Summon to make Dual-Tech!!

Yes, please delete all messages that have nothing to do with AIEditing as split the first post into a seperate thread.
...and if you make this a sticky, I *might* promise to make some more AIEditor tuts.  8)