Home   Help Search Login Register  

Author Topic: Making AI Switch classes  (Read 1326 times)

0 Members and 1 Guest are viewing this topic.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Making AI Switch classes
« on: 27 Nov 2010, 06:36:57 »
Hi, I'm creating a mission where I want the player to be able to move into a city as a civilian but yet he is an enemy to local militia there, so he has to avoid the militia there.. :)..

Then when he meets his contact in the city he dresses into his sniper uniform and then he has to be transporting to his location by his local asset..

How do I make this happen, where he's dressed as a civilian first then when he meets his contact he gathers his guillie suit and his gear (sniper rifle, rounds)? I know it's difficult but sorry that's what it's going to take for me to create missions, is something really difficult that will keep me interested.. :)
Who's hyped for Arma4, long live Arma!

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: Making AI Switch classes
« Reply #1 on: 28 Nov 2010, 08:39:31 »
The header contradicts with your description, doesn't it?  ???

If you need to switch the player model, use selectPlayer.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Making AI Switch classes
« Reply #2 on: 28 Nov 2010, 13:20:48 »
Indeed. Simply create another unit, which looks the way you want, and then when the appropriate cutscene kicks in, use selectPlayer to select the other unit and teleport him in/teleport out your old unit. Simple as that. :)

I suggest you use a custom identity, however, for the playable character, since it's not possible to 'extract' the identity information (e.g. face, voice, etc) from the "default" player character, meaning that the switched-to unit would, for instance, suddenly be named James Jamesson instead of NightJay, be black, and have a very deep voice ;)

Good luck!

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

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Making AI Switch classes
« Reply #3 on: 28 Nov 2010, 15:18:33 »
and to effectively change side on a unit you can open the mission.sqm in notepad (while the mission is not opened in ArmA2 editor) and write any side you want on the player unit, EAST,WEST etc. This is the best way to make a civilian model "stick to a side" in my opinion.

Note: if you open up the units init page in the editor afterward, it will change the model of the unit, so try to avoid that.
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Mamba6

  • Members
  • *
Re: Making AI Switch classes
« Reply #4 on: 13 Dec 2010, 04:53:16 »
To avoid the issue of editing the mission.sqm and so forth, you can always group the unit to an officer of the appropriate side, and give him a probability of spawning to zero. A little simpler and less hassle.
People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. - George Orwell

Barbarians! - B/1/18

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Making AI Switch classes
« Reply #5 on: 19 Dec 2010, 06:51:06 »
Kju is right partner; your thread title is not descriptive of what you need. Has nothing to do with AI.

Group your civilian to a blufor unit, and then delete the blufor unit at start. You now have a civilian that is friendly to civilians but hostile to opfor.

When it comes time for your transition, you will obviously have to implement it with a cutscene. Use that time to do as mentioned above and create the unit as you need, use the selectplayer command to change the player over and rather than delete your former self which may show in the debrief as a casualty(not sure), simply setpos them to another place and remove them from your group.

Here's another thread covering the same issue.

Offline NightJay0044

  • Former Staff
  • ****
  • Let's make OFPEC great again
    • My Steam Workshop
Re: Making AI Switch classes
« Reply #6 on: 21 Dec 2010, 20:59:51 »
Changing your character to disguise themselves as the enemy is 100% possible with Arma2. Yeah I'll try these things and find out..
Who's hyped for Arma4, long live Arma!