Jump to content
Rosso777

Player script edited for AI

Recommended Posts

Here is the original script set for a player model, but how would I mod it to also apply to an AI?


 

if(isTouchingGround player && alive player && _curpos select 2 < 1)then

                    {

                        _nearestObjects = nearestObjects [player, ['Exile_Construction_Abstract_Static','AbstractConstruction','Exile_Construction_Flag_Static'], 2.8];

                        if(_nearestObjects isEqualTo [])then

                        {

                            _last_no_glitch_pos = _curpos;

                            _last_no_glitch_vectorDir = vectorDir player;

                            _last_no_glitch_vectorUp = vectorUp player;

                        };

                    };

 

Share this post


Link to post
Share on other sites

It’s not as easy as changing “player” to “CAmanbase”, right?

Share this post


Link to post
Share on other sites
5 hours ago, Rosso777 said:

It’s not as easy as changing “player” to “CAmanbase”, right?

No. Player is an object. "CAManBase" a string (class) used as kind of object.

You need to define on which units you want to apply the code.

Share this post


Link to post
Share on other sites
6 minutes ago, pierremgi said:

 

You need to define on which units you want to apply the code.

 

Do you mean OPFOR, East, West, etc.? Or specifically naming units (unit1, unit2), etc.? - If this were the case, I am not sure how I would do that using a dynamic AI spawner like A3XAI.

Share this post


Link to post
Share on other sites
23 hours ago, pierremgi said:

You should learn the basics of scripting. You can't mix side, objects, strings, arrays,...

 

Yes, I know you are right. I need to slow down and stop getting ahead of myself; taking on projects that are much too big for me as a newbie. @wogz187 has been telling me the same thing but I've been much too excited to stop reverse-engineering things. I need to slow down, for sure.

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×