Looking to see if a specific pup attachment is equipped
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Looking to see if a specific pup attachment is equipped
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.
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
there isn't one, of course!! you have to iterate the equipped attachments in automatonentity
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Looking to see if a specific pup attachment is equipped
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
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)
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Looking to see if a specific pup attachment is equipped
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
there'll be a spot to put all the logic to decide "what to do" all in an obvious spot, so should be okay
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Looking to see if a specific pup attachment is equipped
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
loop over m_Equip.Attachments to see if one is set to the one you're looking for
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: Looking to see if a specific pup attachment is equipped
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:
With the variable m_DamageGauge i can check for the value 1 or 0. Would this work?
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;
}
}
Re: Looking to see if a specific pup attachment is equipped
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