OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Killzone on 31 Aug 2007, 20:37:33

Title: making created units playable
Post by: Killzone on 31 Aug 2007, 20:37:33
I was wondering if its possible to make created units (using a script) to also be playable. I am making an addaction menu for reinforcements and I know how to create a unit but it is not playable.


Thanks in advance.  :D
Title: Re: making created units playable
Post by: LCD on 31 Aug 2007, 20:41:32
setPlayable (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=s#setPlayable) comand i think :D

LCD OUT
Title: Re: making created units playable
Post by: JasonO on 31 Aug 2007, 22:14:09
Does anyone know if the command is local or does it need to be made global (I presume at least on the server).
Title: Re: making created units playable
Post by: LCD on 31 Aug 2007, 22:20:48
da SP comand (more what killzone asked 4 i think) is AddSwitchableunit (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=a#addSwitchableUnit)

@ jasonO i donno... nd da wikicimmand referance has 1 very helpful line on it... "Multiplayer: Behaviour unknown. "

:D

LCD OUT
Title: Re: making created units playable
Post by: Killzone on 31 Aug 2007, 22:35:20
LCD I appreciate the help but I dont get how to use it. I must admit the comref confuses the heck out of me   ???

it says:

setPlayable Ap

I dont know what ap is or how to use it in  a script

I Tried


"SoldierWSaboteurAssault" createunit [getpos supply,group (leader),"d = this",1,"Private"];

setPlayable leader

I also tried

"SoldierWSaboteurAssault" createunit [getpos supply,group (leader),"d = this",1,"Private"];

setPlayable D

Thinking that they wanted the units name but neither worked. Can you give me an example.

Thanks again. 
Title: Re: making created units playable
Post by: Cheetah on 31 Aug 2007, 22:40:05
Code: [Select]
soldier = "SoldierWSaboteurAssault" createunit [getpos supply,group (leader),"d = this",1,"Private"];
setPlayable soldier;

Untested, but should work..
Title: Re: making created units playable
Post by: LCD on 31 Aug 2007, 22:40:53
also u shud try da addswitchableunit thingy :D

LCD OUT