Could you say more about the context?
Do you want to respawn in a SP mission? If yes, did u try team switch with playable (switchable unit)?
In MP, u can respawn on ur group positions but the challenge is to be another unit without passing thru lobby. The best thing could be to abort and retry from lobby as new JIP.
PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS
I have something simple for multiplayer, it looks like this:
It's kind of modular and stuff, I'll explain it to you if you want.
Sometimes I like to think as I started the whole "earplugs" thing.
W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.
Pierre, well it's basicly a 2 Man mission we just want to be able to spawn on each other, but I am also thinking about to use it on other missions. Will give JIP a try.
wak would be nice if you could! Looks great!
Regards,
Nerodenecro
Added 46 minutes later:
So,
I tried JIP looks nice at all but not..."mine".
Another Idea came to my mind.
Binding a marker to me and the other Soldier...
Works fine.
The only - is that you can respawn on the Player while he's dead and(or) that you can respawn on yourself.
But it works fine so far and it's simple! :D
wak I would still like to see your script!
Regards,
Nerodenecro
This post was edited by Nerodenecro (2015-09-25 10:44, 941 days ago)
The script lets you move to the position of a group member, the member must be alive and must not be in a vehicle. You also copy their stance when you're deployed so if they're in low cover or something your character will also prone.
First, make a folder called "BFD" in your mission, then create these two files inside it:
class BFD_RscButton {
deletable = 0;
fade = 0;
access = 0;
type = 1;
text = "";
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
colorBackground[] = {0,0,0,0.5};
colorBackgroundDisabled[] = {0,0,0,0.5};
colorBackgroundActive[] = {0,0,0,1};
colorFocused[] = {0,0,0,1};
colorShadow[] = {0,0,0,0};
colorBorder[] = {0,0,0,1};
soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
style = 2;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
shadow = 2;
font = "puristaMedium";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
offsetX = 0;
offsetY = 0;
offsetPressedX = 0;
offsetPressedY = 0;
borderSize = 0;
};
class BFD_Dialog {
idd = -1;
name = "BFD_Dialog";
movingEnable = 0;
enableSimulation = 1;
class controls {
class BFD_IGUIBack {
idc = 0;
type = 0;
text = "";
colorText[] = {1,1,1,1};
colorBackground[] = {0,0,0,0.5};
style = 128;
font = "puristaMedium";
sizeEx = 0;
shadow = 0;
x = 0.355625 * safezoneW + safezoneX;
y = 0.262 * safezoneH + safezoneY;
w = 0.2625 * safezoneW;
h = 0.518 * safezoneH;
};
class BFD_FrmMain {
idc = 1;
type = 0;
text = "";
colorText[] = {1,1,1,1};
colorBackground[] = {0,0,0,1};
style = 64;
shadow = 2;
font = "puristaMedium";
sizeEx = 0.02;
x = 0.355625 * safezoneW + safezoneX;
y = 0.262 * safezoneH + safezoneY;
w = 0.2625 * safezoneW;
h = 0.518 * safezoneH;
};
class BFD_TxtMain {
deletable = 0;
fade = 0;
access = 0;
type = 13;
idc = 2;
style = 0;
colorText[] = {1,1,1,1};
class Attributes {
font = "puristaMedium";
color = "#ffffff";
align = "left";
shadow = 1;
};
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
shadow = 1;
text = "Choose squadmate to deploy on:";
x = 0.363 * safezoneW + safezoneX;
y = 0.275 * safezoneH + safezoneY;
w = 0.243438 * safezoneW;
h = 0.042 * safezoneH;
sizeEx = 1 * GUI_GRID_H;
};
class BFD_LbMain {
idc = 3;
deletable = 0;
fade = 0;
access = 0;
type = 5;
rowHeight = 0;
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
colorScrollbar[] = {1,0,0,0};
colorSelect[] = {0,0,0,1};
colorSelect2[] = {0,0,0,1};
colorSelectBackground[] = {0.95,0.95,0.95,1};
colorSelectBackground2[] = {1,1,1,0.5};
colorBackground[] = {0,0,0,0.3};
soundSelect[] = {"\A3\ui_f\data\sound\RscListbox\soundSelect",0.09,1};
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
colorPicture[] = {1,1,1,1};
colorPictureSelected[] = {1,1,1,1};
colorPictureDisabled[] = {1,1,1,0.25};
colorPictureRight[] = {1,1,1,1};
colorPictureRightSelected[] = {1,1,1,1};
colorPictureRightDisabled[] = {1,1,1,0.25};
colorTextRight[] = {1,1,1,1};
colorSelectRight[] = {0,0,0,1};
colorSelect2Right[] = {0,0,0,1};
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
class ListScrollBar {
arrowEmpty = "\a3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\a3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
autoScrollDelay = 5;
autoScrollEnabled = 1;
autoScrollRewind = 0;
autoScrollSpeed = -1;
border = "\a3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
color[] = {1,1,1,1};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
height = 0;
scrollSpeed = 0.05;
shadow = 0;
thumb = "\a3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
width = 0;
};
x = 0.36875 * safezoneW + safezoneX;
y = 0.318 * safezoneH + safezoneY;
w = 0.23625 * safezoneW;
h = 0.364 * safezoneH;
style = 16;
font = "puristaMedium";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
shadow = 0;
colorShadow[] = {0,0,0,0.5};
period = 1.2;
maxHistoryDelay = 1;
};
class BFD_BtnSpawn : BFD_RscButton {
idc = 4;
text = "DEPLOY";
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R', 0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G', 0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B', 0.5])",1};
x = 0.36875 * safezoneW + safezoneX;
y = 0.724 * safezoneH + safezoneY;
w = 0.23625 * safezoneW;
h = 0.042 * safezoneH;
action = "call BFD_fnc_deploy";
};
class BFD_BtnRefresh : BFD_RscButton {
idc = 5;
text = "Refresh";
colorFocused[] = {0,0,0,0.5};
x = 0.36875 * safezoneW + safezoneX;
y = 0.682 * safezoneH + safezoneY;
w = 0.23625 * safezoneW;
h = 0.028 * safezoneH;
action = "call BFD_fnc_refreshList";
};
class BFD_BtnClose : BFD_RscButton {
idc = 6;
text = "X";
colorBackground[] = {0,0,0,0};
colorBackgroundActive[] = {0,0,0,0};
x = 0.605 * safezoneW + safezoneX;
y = 0.262 * safezoneH + safezoneY;
w = 0.013125 * safezoneW;
h = 0.028 * safezoneH;
action = "closeDialog 0";
};
};
};
if (!hasInterface) exitWith {};
params [["_includeAI", false], ["_handleRespawn", false]];
BFD_includeAI = _includeAI;
BFD_fnc_refreshList = {
private _units = (units group player) select {
alive _x &&
{vehicle _x isEqualTo _x} &&
{(BFD_includeAI || isPlayer _x)}
};
_units = _units - [player];
lbClear 3;
{
lbAdd [3, format ["%1 (Grid %2)", name _x, mapGridPosition _x]];
lbSetData [3, _forEachIndex, netId _x];
} forEach _units;
};
BFD_fnc_deploy = {
private _unit = objectFromNetId (lbData [3, lbCurSel 3]);
if (isNull _unit) exitWith {hint "No unit selected!"};
closeDialog 0;
switch (stance _unit) do {
case "STAND" : {player switchMove "amovpercmstpsraswrfldnon"};
case "CROUCH" : {player switchMove "amovpknlmstpsraswrfldnon"};
case "PRONE" : {player switchMove "amovppnemstpsraswrfldnon"};
};
player setPos (getPos _unit);
};
BFD_fnc_showDialog = {
createDialog "BFD_Dialog";
call BFD_fnc_refreshList;
};
if (_handleRespawn) then {
player addEventHandler ["Respawn", {call BFD_fnc_showDialog}];
};
Add this line somewhere in your description.ext:
#include "BFD\dialog.hpp"
The "modularity" is dependent on how you call it in init.sqf, it has 2 boolean (true/false) parameters:
If you wanted to have ai also appear in the list, you'd make the first parameter true.
If you wanted the dialog to appear each time a player respawns, you'd make the second parameter true.
Both values are false by default, so you can just do [] execVM "BFD\init.sqf";. This makes it so you don't have any AI appear on the list, and the dialog won't appear on respawn.
You can also add the dialog to a flag pole or a similar object in the base. That way when a player respawns, they can first go customize their loadout and then deploy on their group.
Here is the addAction code for that:
EDIT (2017-03-14): Revised the script a bit, should be working as advertised again.
This post was edited by 654wak654 (2017-03-14 14:13, 405 days ago)
Sometimes I like to think as I started the whole "earplugs" thing.
W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.
This looks amazing, but I am having an issue, I am sure it is something I have done wrong in implementing it.
I have the addaction on a crate, which works fine, the dialog opens and I have a list of the Ai units, but when I select one and press deploy, nothing happens.
I have this in my init.sqf (so works with AI and doesn't show dialog after respawn):-
And have created the BFD folder with the init.sqf and the dialog.hpp files in.
I have tried to incorporate this into an existing mission of mine, and will now try it on a fresh map, just to check its not being interfered with. will update this post as I do it.
**edit 1**
Tried on fresh map, still the same, dialog appears with AI units in list but when pressing deploy, nothing happens. I recreated the folder and the 2 files required rather than copying.
Tried using this in the main mission init (get the dialog after respawn now), but still no redeploying.
[true,true] execVM "BFD\init.sqf";
Any chance of uploading a sample mission with it working? as I can't fathom what's wrong. Would be appreciated.
This post was edited by Tay-uk (2015-09-26 11:00, 940 days ago)
I don't see any problem with your setup. Also double checked the forum post and my code, everything is working... Which is worse than the code being broken, since there is nothing broken to fix.
Sometimes I like to think as I started the whole "earplugs" thing.
W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.
Found the issue, it seems your units have to be named in the editor. With the names in your example P0, P1 and P2 it works, without the names it doesn't. Nice one, something simple.
That's a brilliant script that I bet will be popular if you released it ;).
Thank you for taking the time to make the script and for the example.
I think I fixed that problem. I was using the unit's vehicleVarName which whouldn't work if they weren't named in the editor, so I switched to netId and it seems to be working. Updated the original post, give it a try.
This post was edited by 654wak654 (2015-09-27 02:39, 940 days ago)
Sometimes I like to think as I started the whole "earplugs" thing.
W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.
Tried the new method, but can't seem to get it working. I just get the message "No unit selected". But I am seriously hungover and a bit crossed eyed, so will try again later.
**edit**
It works with the netId, it was just that I was in the single player editor.
One thing I did notice with the original version, I added it to a mission, named all my playable units so had 14 units on one big group, but only 6 of them showed in the selection. I then deleted them all and then re-added, and still only seem to be getting few of them on the list.
So to test I again put these scripts etc in a new fresh mission and added units one by one and it showed them all in the list. But I have no idea why they won't all show in my pre-existing mission, unless something in the mission (other scripts etc) are interfering with it.
This post was edited by Tay-uk (2015-09-27 22:08, 939 days ago)
New here, registered just to comment here and try to solve a problem..
654, I used your method, but it's not working. I created the folder, the files and used the code, just like Tay-UK, even read about the naming the units issue, but it ain't working. Placed a flag where you're supposed to go to activate the dialog, and indeed there's a "Deployment" option, but nothing happens... any ideas?