OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Knight Trane on 28 Oct 2009, 00:32:34

Title: Switching sides via Addaction and Trigger?
Post by: Knight Trane on 28 Oct 2009, 00:32:34
Hi guys,

Been a long time.

A friend wants to make an MP,Infiltration style mission.  So there are a few scripting hurdles we need to clear.


Any thoughts on any aspect would be helpful.
Thanks,
Title: Re: Switching sides via Addaction and Trigger?
Post by: laggy on 30 Oct 2009, 11:45:38
Not trying to market my work, but in this Armed Assault MP mission you will find a method that works quite well:

http://www.ofpec.com/missions_depot/index.php?action=details&id=204

It includes:

Script that senses if you are firing your weapon while detected.
Script that senses if an enemy have found a dead friend.
Script that by random can make an enemy suspect you (though setCaptive) and act accordingly, questioning etc.

I can explain better later if you are interested, I'm in a hurry now.

Cheers,

Laggy
Title: Re: Switching sides via Addaction and Trigger?
Post by: Knight Trane on 30 Oct 2009, 22:51:27
Thanks,

That all looks like good stuff.  I'll get my friend looking at those scripts.

Any thoughts on how to switch into a enemy unit?
Title: Re: Switching sides via Addaction and Trigger?
Post by: laggy on 31 Oct 2009, 07:34:49
If you want the infiltrators to use the same uniforms as their enemy:

- Group the players to a leading unit of the "enemy's enemy" side and then delete that leader. Players are now enemies of their "own side". For example: Group Russian players with U.S leader and the players will be treated as U.S troops, though in Russian uniforms.

Or better in my opinion:

- Open up mission.sqm (in notepad, while NOT loaded in editor) and switch side on group and units by text.
BE VERY CAREFUL WITH THE SYNTAX. Then load the mission in the editor and see how the players are enemies of their "own side". Make sure to have written everything you need in the init field of the units before, because if you open up a units editing sheet and save it, the units model will switch to "default side model" and you'll have to redo the notepad process.

Then use setCaptive command true and false.

Laggy