Jump to content

Recommended Posts

Is there any way I can make my Ai Squadron invincible through the in-game command console?

Share this post


Link to post
Share on other sites

Welcome to BI Forums Phantom_Fuzz!

5 hours ago, Phantom_Fuzz said:

in-game command console?

Are you referring to the bar at the bottom of the screen when your commanding your AI?

Or the debug menu when you press escape?

 

In general i would agree with POLPOX, but you can also edit each of your AI units special states and disable damage

in the editor for your mission or add   this allowdamage false;   to each one of the init box's of the AI in your command.

  Is that about what your after?

  • Like 2

Share this post


Link to post
Share on other sites

Please learn how to make any one man invincible.

Test, test, test.

Share this post


Link to post
Share on other sites

@phantomfuzz,

Quote

Ai Squadron invincible through the in-game command console?


You can paste this into the debug console,

{_x allowDamage false} forEach units group player;

or
Paste this into the init properties field of any unit in the group,

{_x allowDamage false} forEach units group this;


Have fun!

  • Like 2

Share this post


Link to post
Share on other sites
On 5/4/2020 at 7:12 AM, Gunter Severloh said:

Welcome to BI Forums Phantom_Fuzz!

Are you referring to the bar at the bottom of the screen when your commanding your AI?

Or the debug menu when you press escape?

 

In general i would agree with POLPOX, but you can also edit each of your AI units special states and disable damage

in the editor for your mission or add   this allowdamage false;   to each one of the init box's of the AI in your command.

  Is that about what your after?

Yes I am talking about the debug console, sorry for not clarifying. I'd like to be able to do it in-game since i'm doing gamemodes that i didn't make or edit.

Share this post


Link to post
Share on other sites
7 hours ago, wogz187 said:

@phantomfuzz,


You can paste this into the debug console,


{_x allowDamage false} forEach units group player;

or
Paste this into the init properties field of any unit in the group,


{_x allowDamage false} forEach units group this;


Have fun!

Thank you very much! I'll try this out and tell you if it worked

(Edit) It worked, thank all of you for the help.

  • Like 1

Share this post


Link to post
Share on other sites

I know this topic is a bit old but what command would I need to use to make my sqaud invincible but not the player?

Share this post


Link to post
Share on other sites

Init field:

 

{ if !( isPlayer _x ) then { _x allowDamage false; }; } forEach units group this;

 

Or debug console:

 

{ if !( isPlayer _x ) then { _x allowDamage false; }; } forEach units group player;

  • Like 1

Share this post


Link to post
Share on other sites

try to write the whole thing manually instead of using copy and paste

  • Like 1

Share this post


Link to post
Share on other sites
56 minutes ago, rainbow47 said:

Unfortunately still getting the same errror. Not sure what i am doing wrong.

 

 

That above code is gonna work 100% the time unless you're somehow typing it wrong. At this point you'd have to post a pic or video of you typing that and showing the error to get any help

Share this post


Link to post
Share on other sites

This was a weird one, took me a long time to figure out what was going on. First I tried retyping everything, which worked. Then I tried focusing on "_x allowDamage false" because that's where the error is happening. I went letter by letter and replaced every one, still getting the error. Then I noticed that if you are navigating the text via arrow keys, once you get to "e" in allowDamage, then you have to hit the arrow 3 times before the cursor advances to the space. Interesting...by default I "show all symbols" in notepad++ but I don't see any control characters...Finally the answer came to me. I changed the encoding to ANSI:

{ if !( isPlayer _x ) then { _x allowDamage false; }; } forEach units group this;

So the short answer is retyping everything would have worked, or just retyping the contents of the Then code block, even more specifically just highlighting the "e[space]" in allowDamage false and retyping "e[space]"

 

There is a long answer, but we really don't want to go into it, trust me. So the even shorter answer: Encoding is a bitch

  • Like 2

Share this post


Link to post
Share on other sites
7 minutes ago, dreadedentity said:

This was a weird one, took me a long time to figure out what was going on.

 

Any time you copy code from this forum, re-paste it into a code block to check for corrupt characters:

P5f4Lfz.png

 

Delete any red dots, re-copy, and you're done.

  • Like 4

Share this post


Link to post
Share on other sites

@rainbow47 there was a reason for this:

2 hours ago, sarogahtyp said:

try to write the whole thing manually instead of using copy and paste

 

  • Like 3

Share this post


Link to post
Share on other sites

My first approach to use my own script 😂

 

Thank you very much for your help guys. I've learnt a lot!

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

×