OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: NightJay0044 on 27 Nov 2010, 06:36:57

Title: Making AI Switch classes
Post by: NightJay0044 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.. :)
Title: Re: Making AI Switch classes
Post by: kju 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.
Title: Re: Making AI Switch classes
Post by: Wolfrug 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.
Title: Re: Making AI Switch classes
Post by: laggy 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.
Title: Re: Making AI Switch classes
Post by: Mamba6 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.
Title: Re: Making AI Switch classes
Post by: savedbygrace 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 (http://www.ofpec.com/COMREF/index.php?action=details&id=701&game=All) 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 (http://www.ofpec.com/COMREF/index.php?action=details&id=313&game=All) them to another place and remove them from your group.

Here's (http://www.ofpec.com/forum/index.php?topic=31029.0) another thread covering the same issue.
Title: Re: Making AI Switch classes
Post by: NightJay0044 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..