Page 1 of 2

Looking to see if a specific pup attachment is equipped

Posted: Fri Sep 25, 2015 7:28 pm
by bluesolarflare
Hello

I am continuing work on PUP automaton ai and while I have a lot of the basics coded in the core I am stuck on one particular part. I would like to have some line of code that can see what attachments are equipped by the auto so I can generate an if/then statement. Right now I would like to be able to determine if Damage Gauge is equipped so I can place it in my code to determine threshold values for Cures. Thanks in advance.

Re: Looking to see if a specific pup attachment is equipped

Posted: Fri Sep 25, 2015 7:34 pm
by kjLotus
there isn't one, of course!! you have to iterate the equipped attachments in automatonentity

Re: Looking to see if a specific pup attachment is equipped

Posted: Fri Sep 25, 2015 8:08 pm
by bluesolarflare
Thanks. I'm not 100% sure how to go about doing this exactly but I'll give it a shot

Re: Looking to see if a specific pup attachment is equipped

Posted: Fri Sep 25, 2015 8:14 pm
by kjLotus
just so you know, everything in ai_xxx is going to be blown away in a month or two as I finish the AI rewrite (which, one of the purposes was to make the automaton AI easier to implement)

Re: Looking to see if a specific pup attachment is equipped

Posted: Fri Sep 25, 2015 8:30 pm
by bluesolarflare
The additions I made in ai_automaton are very basic to get pup casting and wsing so I hope I can apply similar changes when that does get revamped

Re: Looking to see if a specific pup attachment is equipped

Posted: Fri Sep 25, 2015 8:48 pm
by kjLotus
there'll be a spot to put all the logic to decide "what to do" all in an obvious spot, so should be okay

Re: Looking to see if a specific pup attachment is equipped

Posted: Sun Sep 27, 2015 9:00 pm
by bluesolarflare
I hate to ask but would you be able to help me create the iteration for checking for attachments in automatonentity?

Re: Looking to see if a specific pup attachment is equipped

Posted: Sun Sep 27, 2015 9:48 pm
by kjLotus
loop over m_Equip.Attachments to see if one is set to the one you're looking for

Re: Looking to see if a specific pup attachment is equipped

Posted: Sun Sep 27, 2015 11:18 pm
by bluesolarflare
Thanks, I think that is where i am having an issue. m_Equip.Attachments if I am correct looks at the slot id. Would it be best to create the the loop inside ai_automaton_dummy or in automatonentity?

Here is an example of ai_automaton_dummy:

Code: Select all

    for (int i = 0; i < 12; i++)
    {
        if (m_Equip.Attachments[i] = 8643)
        {
            m_damageGauge = 1;
        }
		
    }
With the variable m_DamageGauge i can check for the value 1 or 0. Would this work?

Re: Looking to see if a specific pup attachment is equipped

Posted: Mon Sep 28, 2015 1:59 am
by kjLotus
inside automatonentity, because ai_automaton_dummy doesn't have the equipment as members. You'd also want to make it generic (take in the attachment id as a parameter) and return a boolean. then you can just call it from the ai