Looking to see if a specific pup attachment is equipped

bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

Looking to see if a specific pup attachment is equipped

Post by bluesolarflare » Fri Sep 25, 2015 7:28 pm

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.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Fri Sep 25, 2015 7:34 pm

there isn't one, of course!! you have to iterate the equipped attachments in automatonentity

bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

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

Post by bluesolarflare » Fri Sep 25, 2015 8:08 pm

Thanks. I'm not 100% sure how to go about doing this exactly but I'll give it a shot

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Fri Sep 25, 2015 8:14 pm

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)

bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

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

Post by bluesolarflare » Fri Sep 25, 2015 8:30 pm

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

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Fri Sep 25, 2015 8:48 pm

there'll be a spot to put all the logic to decide "what to do" all in an obvious spot, so should be okay

bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

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

Post by bluesolarflare » Sun Sep 27, 2015 9:00 pm

I hate to ask but would you be able to help me create the iteration for checking for attachments in automatonentity?

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Sun Sep 27, 2015 9:48 pm

loop over m_Equip.Attachments to see if one is set to the one you're looking for

bluesolarflare
Posts: 129
Joined: Wed May 27, 2015 4:23 pm

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

Post by bluesolarflare » Sun Sep 27, 2015 11:18 pm

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?

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

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

Post by kjLotus » Mon Sep 28, 2015 1:59 am

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

Post Reply