bigshot 64 Posted January 1, 2007 I have a single player mission i created and would like to play it in multiplayer coop environment. My problem is that i dont want players to be able to select some of the playable units in the multiplayer selection screen...anyway to either "hide" these units from them or at least make them unselectable to players? Thanks guys Share this post Link to post Share on other sites
mattxr 9 Posted January 1, 2007 ?? If you only want certain units to be playable make them "Playable" in the editor, if not don't, just leave them as Ai Share this post Link to post Share on other sites
bigshot 64 Posted January 1, 2007 hi Matt...well if i make them non-playable then i cant use those units as respawns if some of us humans in the squad should die (and we will, hehe). I need to keep those units in there for respawnability for the humans...yet at the same time i dont want them to be able to select those units when joining the game initially (those units are located in a different area where we meet and JOIN with later in the mission) Share this post Link to post Share on other sites
benreeper 0 Posted January 2, 2007 Don't make the units playable in the editor. They'll still be in the game when you play it. --Ben Share this post Link to post Share on other sites
sickboy 13 Posted January 2, 2007 Don't put the units on playable, that you don't wish to be playable yet... then you probably want to initiate a script that will make the units playable when you wish: http://community.bistudio.com/wiki/setPlayable Have fun! Share this post Link to post Share on other sites
jphilapy 0 Posted January 2, 2007 hi Matt...well if i make them non-playable then i cant use those units as respawns if some of us humans in the squad should die (and we will, hehe). I need to keep those units in there for respawnability for the humans...yet at the same time i dont want them to be able to select those units when joining the game initially (those units are located in a different area where we meet and JOIN with later in the mission) Howdy bigshot, If you make the units nonplayable you will still be able to respawn into them as long as they are in your squad. Just make sure you use group as your respawn type. Anyway on a general note, is there any way at all to hide playable units from the roles screen? It would be nice as this would make it unessary for us to have to recreate units in the editor when we want those units to keep respawning. Jeff Share this post Link to post Share on other sites
sickboy 13 Posted January 2, 2007 ... Check my post above urs..it contains the way to hide playable units, and make them playable later for JIP etc.. Share this post Link to post Share on other sites
whisper 0 Posted January 2, 2007 Thing is, setPlayable set a unit as playable (well, I didn't test, but I guess ) But how can I do the opposite? Unset a unit as playable? Why such a complicated feature? Well, I want to use the playable units as "placeholders" for player before they actually join the fight. For example, imagine a Dynamic War mission like we've seen some in OFP before, ie AI squads sent to some objectives, blabla, etc... I want a player connecting to be able to get in place of any AI squad leader available. I could simply set the squad leader as playable at mission startup, but... What if, in the middle of the dynamic mission assigned to AI, the squad leader dies and another one takes SL role? After that, a player want to connect.... but can't take control... So, what I thought was this : Somewhere far away from any battle, etc... I put X playable units. On the main battle area, I build everything for a dynamic war system, with AI squad running everywhere, doing their own things. On connection, player will take place of a AI left alone somewhere useless, and I make some kind of GUI appear, listing the available AI squad and their role. Player chose his target squad, clic "Join" button, and I make him go there with selectPlayer command. This way, it's completely independant of which AI is SL, alive, etc... I can even spawn new squads for resupply in the war, etc... Thing is, the units player has left is now free, and another player can take the spot. Which means I've no limit on number of player. Which is kind of bad for server, you'd agree So I need to put the unit originally chosen by the player as "no playable" anymore, until said player disconnects. Well... I could deleteVehicle it, then make a new unit and use setPlayable on player disconnection... Share this post Link to post Share on other sites
sickboy 13 Posted January 2, 2007 ... And what stops you with running a script that makes new teamleaders playable? So run a script on a group that checks if the current leader is the same as the last known leader, if not...make it playable with the command, and updat ethe lastknown leader with the new leader... example: add in init.sqs: checkgrp=compile preprocessfile "checkgrp.sqf"; Then, multiply for each group: [group] spawn checkgrp; (exchange 'group' with the actual group name, by putting in the init lines of a group: grp1 = group this   (etc) you will create variables with the groups in). Content of checkgrp.sqf:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_run","_group","_last"]; _group=_this select 0; _last=leader _group; _run=true; while{_run=true} do {   if(({alive _x} count (units _group))> 0)then   {     if((leader _group)!=_last)then     {       setplayable (leader _group);       _last=(leader _group);     };   } else {     _run=false;   };   sleep 5; }; Or for instance<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_run","_group","_last"]; _group=_this select 0; _last=leader _group; _run=true; while{_run=true} do {   waitUntil{(leader _group)!=_last};   if(({alive _x} count (units _group))> 0)then   {     setplayable (leader _group);     _last=(leader _group);   } else {     _run=false;   };   sleep 0.1; }; I think you should only run all the above only on the server, but im not sure... If so... make a gamelogic and name it: server Then in the init sqs, add: ?!local server: exit; just before the lines for checkgrp. Don't find an -> unplayable option though You might do a sidechat on the player's position when he joins to display which leaders are still alive and which are dead... as a simple workaround Share this post Link to post Share on other sites
whisper 0 Posted January 2, 2007 Well... In fact I really need the player to have this "available squads listing" so that he can chose the role and mission he wants. + I wanted to have a respawn system bringing back the player to this selection screen, so it's probably better to have the same system on player connection than later in game. Share this post Link to post Share on other sites
sickboy 13 Posted January 2, 2007 ... Well, I can't think of another way to do it just now, maybe someone else The only problem I see with the method posted, is that even dead roles will show on the assignment screen where players join, as I can't find a makeunplayable function, but for the rest it seems to give the functionality you wish? You could aswell try the: http://community.bistudio.com/wiki/deleteVehicle command, altough it states that you can't execute that on player units, still, if they are dead and not occupied by a player, I think it will work in arma to delete them, as such they will probably not popup on the assignment screen any longer Share this post Link to post Share on other sites
bigshot 64 Posted January 3, 2007 Don't put the units on playable, that you don't wish to be playable yet... then you probably want to initiate a script that will make the units playable when you wish:http://community.bistudio.com/wiki/setPlayable Have fun! hiya...thanks for tryin to help...but i already tried that the other day and it doesnt work for me in this situation...even using the setplayable command you still cant respawn into them later on in battle...this was tried with MY squad joining up with a new squad...i was unable to respawn into any of the units of the new squad we just joined up with. oh well Share this post Link to post Share on other sites
Harold of the Rocks 0 Posted April 12, 2007 Hey Bigshot, I'm a novice editor myself and don't know if I can help solve your problem entirely. A few quick thoughts though... 1) Using a setPlayable script after the mission starts... does this resolve your 'selection screen' issue (making them unviewable)? I'm curious if that is resolved for you. I would think it should work. 2) Just out of curiosity, when your two groups merge... which group's leader retains command of the merged group? Could this be part of the problem? I'm thinking if the player's group leader relinquishes command to the second group's leader that it could mess with the respawn. I don't know this for a fact, but it might mess with the group respawn function in the sense that it might be determined at the initialization and if the player's group changes along the way, they end up joining a group that was never initialized as respawnable... does that make sense? I also thought that "side" was a potential respawn setting... maybe no longer? Or maybe that isn't entirely desirable based on your mission setup. Sorry this probably didn't answer any questions... I'm hoping that you might be able to provide some info that a editing wizard could work with, or my own queries might solicit a helpful response. Peace. Share this post Link to post Share on other sites