Home   Help Search Login Register  

Author Topic: How to make the AI react to commands of player?  (Read 1117 times)

0 Members and 1 Guest are viewing this topic.

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
How to make the AI react to commands of player?
« on: 07 Jan 2009, 00:28:35 »
Hi guys!

Is it possible to make the AI fellows react to the command(s) of the player with a custom voice sentence?

An example:

Player to sniper:
"7, move to that bush at 12 'o clock!"

Sniper (standard ArmA radio response):
"Roger!"

And then additionally, as an reaction to the order of the player (custom voice):
"Asshole!"


Is this possible?
I want to implement this in the mission I'm making... Like there was a sniper that had a bad attitude and complains when the player (squad leader) gives an order.

Thanks for your help!
Current project: Black Lands (Arma 3)

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: How to make the AI react to commands of player?
« Reply #1 on: 07 Jan 2009, 00:39:15 »
Maybe the unitReady command can help.  Biki says this about unitReady:

Quote
Check if the unit is ready. Unit is busy when it is given some command like move, until the command is finished.

So if the unit's status changes from unitReady to NOT unitReady, then maybe player has issued him a Move command.   I have no idea if the normal AI behavior of following player changes this status or not.  But if used in controlled situations it might work for you.
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Re: How to make the AI react to commands of player?
« Reply #2 on: 07 Jan 2009, 00:52:09 »
Thanks, johnnyboy!

Btw. this is exactly for your idea for "Evil's Last Will", do you remember? ;)
I'll try it out and report here later, maybe because I didn't get it to work, but we'll see.

And... Haha :D Great signature!! :good:
Current project: Black Lands (Arma 3)

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to make the AI react to commands of player?
« Reply #3 on: 07 Jan 2009, 10:54:02 »
Locked the topic, did you? :D Other people might have ideas too you know!

Anyway, with certain commands that lets the unit leave the formation (such as Move and Engage, I think), you can use the formLeader command to check who is that unit's formation leader:

Code: [Select]
if (formLeader badAssGuy != leader badAssGuy) then {badAssGuy sideradio "Asshole"}
Something like that? :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Re: How to make the AI react to commands of player?
« Reply #4 on: 07 Jan 2009, 22:29:02 »
??? Strange... No, I didn't lock it, or maybe by accident... :dunno:

However, it's open now. :) Thank you for your answer, Wolfrug!
Current project: Black Lands (Arma 3)