AI Condition Script Clarification

CharlockCharlock REGISTERED, Tester Posts: 293 Seed
I've been working on a mod for a while now and one of the things I'd like to introduce to the game is the ability for baby critters to grow up in the wild, with no intervention from the player. This is the first step in a much grander scheme, of course.

One of the things I've noticed with the growth behaviors in the "Pet" critter scripts is a refrence to "AIConditionSourceIsOwner," which is pretty straight forward. Looking at the other AICondition scripts, I see a couple of interest, like "AIConditionSourceIsCharacter" and "AIConditionSourceIsTarget." Unfortunately, there isn't much in these scripts to help determine what each means, in relation to how "source" is defined.

If a developer could shine some light on the purpose of these other scripts, I would greatly appreciate it!

AIConditionSourceIsOwner = Pet Owner (LocalPlayer)
AIConditionSourceIsCharacter= ??
AIConditionSourceIsTarget = ??

In the meantime, I'll keep digging and if I managed to figure it out before I get a response here, I'll update this topic.

Thanks!
"I’ve been drunk for about a week now, and I thought it might sober me up to sit in a library."

Comments

  • CaptainMusclesCaptainMuscles REGISTERED Posts: 1 Podling
    These conditions will be triggered when the source parameter (the object that initiated the event) of an incoming event meets the prerequisites. I don't have a list of the events that do this handy, but a search in AICharacter.lua for "AIEvent_" will get a list of all the events being handled, with a little backtracking needed to verify which include a source.

    AIConditionSourceIsOwner - true if args.Source is the character's owner (AICharacter.m_playerOwner - set by AIActionSetOwner)
    AIConditionSourceIsCharacter - true if args.Source inherits from BaseCharacter
    AIConditionSourceIsCharacter - true if args.Source is the character's current target
  • CharlockCharlock REGISTERED, Tester Posts: 293 Seed
    Thanks @CaptainMuscles and nice to meet you! I did exactly what you suggested last night and I was able to track down a couple of instances of each condition, which made things a lot clearer.

    I've got a sense now of what I need to use to accomplish my goal (or at least part of it) and I'll be trying it in the next few days to see what I can break.
    "I’ve been drunk for about a week now, and I thought it might sober me up to sit in a library."
Sign In or Register to comment.