tedbell 0 Posted November 19, 2007 Is there a way to automatically switch to a random available team-member in single-player mode? This would take the place of hitting 'Team Switch' on the death screen, or 'T' midgame. Thanks! Share this post Link to post Share on other sites
W0lle 1052 Posted November 19, 2007 What has this to do with Addons&Mods? Moving. Share this post Link to post Share on other sites
Junker 0 Posted November 19, 2007 Is there a way to automatically switch to a random available team-member in single-player mode? This would take the place of hitting 'Team Switch' on the death screen, or 'T' midgame.Thanks! have you tried making all your team playable ?? Tried the switchable unit function Biki Clicky Share this post Link to post Share on other sites
tedbell 0 Posted November 19, 2007 Thanks for moving this post and the BIKI link, but I am confused. You can designate that units are switchable through a script using addSwitchableUnit, but isn't this the same as making the unit PLAYABLE in the editor? Where is the mechanism to auto switch upon death? I do not see that in the BIKI. I only see a function to bring up the team switch dialogue box. Help! It seems that you could use switchableUnits to get the list of available units and selectPlayer to switch to one of them, but I am not sure how to do this. Share this post Link to post Share on other sites
vova _fox 0 Posted November 19, 2007 Quote[/b] ]This would take the place of hitting 'Team Switch' on the death screen, or 'T' midgame. it happen when enableenddialog command is used wtf? you don't write enableenddialog in your script? Why 'death screen' is shown after death? It because when you death automatically run 'onPlayerKilled.sqs' script. If you don't have this script in your mission folder, it will be exec from 'ca.pbo\data\scripts\onPlayerKilled.sqs' ca.pbo\data\scripts\onPlayerKilled.sqs : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> titleCut["", "BLACK OUT",1] ~1 _animace = ["\ca\data\scripts\deathDefault.sqs", "\ca\data\scripts\death1.sqs"] _this exec ( _animace select floor(random((count _animace) - 0.5 ))) exit and the first strings in "\ca\data\scripts\deathDefault.sqs" and "\ca\data\scripts\death1.sqs" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;init enableEndDialog All that means: if you dont use the enableenddialog command you never see the 'death screen'. All that you need is create onPlayerKilled.sqs script in you mission folder, after this you dont' see 'death screen' after death. Finaly you must write teamswitch algoritm, like this for example: onPlayerKilled.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _group=group player ? {alive _x} count (units _group) == 0 : goto "end" _leader=leader _group ~0.5 addSwitchableUnit _leader selectplayer _leader exit #end ~2 enableenddialog sorry for english please Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted November 19, 2007 I'm thinking he means that he needs a way to make the game auto team switch you on death. Correct me if I'm wrong though. hey, does onPlayerDeath.sqf work in single player? Actually, come to think of it, I think I had that exact need working in a little project I was working on. Lemme look around and see what I come up with. Share this post Link to post Share on other sites
vova _fox 0 Posted November 19, 2007 Single mission with onPlayerKilled.sqs script. Download and change as you wish. http://www.rapidshare.ru/472100 Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted November 19, 2007 Yeah, onPlayerKilled is what I meant there of course. It's not like it's a script I use a whole lot if you know what I mean. Share this post Link to post Share on other sites
tedbell 0 Posted November 20, 2007 Awesome, excellent and brilliant! Thank you for the code and explanation! Now I am off to generate more errors in ArmA scripts! THANK YOU GUYS! BTW your English is just fine vova_fox ... Share this post Link to post Share on other sites