Jump to content
Sign in to follow this  
Gunter Severloh

How to create a Menu Dialog - Menu Respawn

Recommended Posts

Hi guys,

Here is a bunch of scripts I had ported over from Arma1 like the start of 2011,

dont ask me what mission or whos script it is as I dont recall, but i have had this script in my script resource folder and have

it in some of my missions for quite some time.

I will provide a demo, and full instructions on how to setup the script if you want to do it manually.

This script works in Arma1 (as its from Arma1 duh), and will work in Arma2, and Arma2CO,

i dont have Arma3, so if someone wants to try it in Arma3 and it works then let us know here. Have fun!

Menu Dialog - Menu respawn

Download the demo mission

http://webzoom.freewebs.com/warmod/File%20Downloads/Respawn%20Dialog-Menu%20Respawn%20Demo.zip

put the folder into mpmissions folder for the editor, then host the mission and see it in the editor,

also host it to play it as respawn dont work in SP.

=============

You will need to create some folders and a few scripts, just follow the steps:

Step A

Folders

1. create a folder and name it Dialogs

2. create a folder and name it Scripts

Dialogs Folder

1. Inside this folder create a folder and name it Common

Scripts inside Dialogs folder:

1. Create a script and name it Respawn_Dialog.hpp

then put the following code inside the script:

// Desc: A respawn selection dialog
// By: Dr Eyeball
// Version: 1.0 (May 2007)
//-----------------------------------------------------------------------------
// SPWN_ is the unique prefix associated with all unique classes for this dialog.

//-----------------------------------------------------------------------------
// IDD's & IDC's
//-----------------------------------------------------------------------------
#define SPWN_IDD_RespawnDialog 389

#define SPWN_IDC_RespawnList 891
#define SPWN_IDC_RespawnMap 892
#define SPWN_IDC_AcceptButton 893
#define SPWN_IDC_Countdown 894

//-----------------------------------------------------------------------------
// Personalisation - Custom modifications to the standard control classes
//-----------------------------------------------------------------------------

class SPWN_Button: RscButton
{
 x = 1*Dlg_COLWIDTH;
 y = 0.1;
 w = 0.1;
 h = Dlg_CONTROLHGT;
};

class SPWN_BaselineButton: SPWN_Button
{
 w = 0.15;
 y = 1.0-Dlg_CONTROLHGT; // last row
};

class SPWN_CaptionText: RscText
{
};

//-----------------------------------------------------------------------------
// Main dialog
//-----------------------------------------------------------------------------
class SPWN_RespawnDialog
{
 idd = SPWN_IDD_RespawnDialog;

 movingEnable = true;
 controlsBackground[] = { SPWN_Background, SPWN_Frame };

 class SPWN_Background: Dlg_FullBackground
 {
   colorBackground[] = {Dlg_Color_Gray_3, 0.7};
 };

 class SPWN_Frame: Dlg_FullBackgroundFrame
 {
   text = " Respawn Location Selection ";
 };

 //---------------------------------------------
 objects[] = 
 { 
 };

 controls[] = 
 {
   SPWN_RespawnListCaption,
   SPWN_RespawnList,

   SPWN_RespawnMapCaption,
   SPWN_RespawnMap,

   SPWN_AcceptButton
 };
 //---------------------------------------------
 // captions
 class SPWN_RespawnListCaption: SPWN_CaptionText
 {
   idc = SPWN_IDC_Countdown;
   x = 0.01;
   y = 0.03;
   w = 0.51;
   text = "Respawn Locations";
 };
 class SPWN_RespawnMapCaption: SPWN_CaptionText
 {
   x = 0.01;
   y = 0.32;
   w = 0.51;
   text = "Respawn Locations Map";
 };
 //---------------------------------------------
 // Controls
 class SPWN_RespawnList: RscListBox
 { 
   idc = SPWN_IDC_RespawnList;
   x = 0.01;
   y = 0.07;
   w = 0.51;
   h = 0.2;

   onLBSelChanged = "[_this] call SPWN_ViewSpawnPoint";
   onLBDblClick = "[_this] call SPWN_AcceptButton";
 };
 class SPWN_RespawnMap: RscMapControl
 {
   idc = SPWN_IDC_RespawnMap; 
   x = 0.01;
   y = 0.36;
     w    = 0.51;
     h    = 0.6; 
 };
 //---------------------------------------------
 // buttons
 class SPWN_AcceptButton: SPWN_BaselineButton
 {
     idc = SPWN_IDC_AcceptButton;
     x = 5*Dlg_COLWIDTH;
     text = "Ok";
     action = "[] call SPWN_AcceptButton";
 };
 //---------------------------------------------
};

2. Create a script and name it Respawn_Dialog.sqf (note its a sqf this time)

then put the following code inside the script:

// Desc: A respawn selection dialog
// By: Dr Eyeball
// Version: 1.0 (May 2007)
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
// The following IDD & IDC variables should match their equivalents for the dialog (from "Dialogs\RespawnDialog.hpp")
SPWN_IDD_RespawnDialog = 389;

SPWN_IDC_RespawnList = 891;
SPWN_IDC_RespawnMap = 892;
SPWN_IDC_AcceptButton = 893;
SPWN_IDC_Countdown = 894;

SPWN_RespawnLocationsCaption = "Respawn Locations";

//-----------------------------------------------------------------------------
// Control functions
//-----------------------------------------------------------------------------
SPWN_FillComboList = 
{
 _idc2 = _this select 0;
 _DualList = _this select 1;

 _control = SPWN_display displayCtrl _idc2;

 lbClear _idc2;
 {
   _Item = _x select 0;
   _Data = _x select 1;
   _index = lbAdd [_idc2, _Item];
   lbSetData [_idc2, _index, _Data];
 } forEach _DualList;

 lbSetCurSel [_idc2, 0];
};
//-----------------------------------------------------------------------------
// Respawn Selection functions
//-----------------------------------------------------------------------------

//----------------------
SPWN_ViewSpawnPoint =
{
 _selection = _this select 0;  

 _control = _selection select 0;
 _selectedIndex = _selection select 1; 

 _basePos = getPos player;
 _spawnMarkerName = _control lbData _selectedIndex;
 _spawnPos = getmarkerpos _spawnMarkerName; 

 //RespawnLocation = _spawnMarkerName; // interferes

 //---- show map location using panning & zooming
 _ctrl = SPWN_display displayctrl SPWN_IDC_RespawnMap;
 ctrlMapAnimClear _ctrl; // reset while scrolling list

 _ctrl ctrlmapanimadd [0.1, 0.30, _basePos]; // show home base
 ctrlmapanimcommit _ctrl;

 _ctrl ctrlmapanimadd [0.8, 0.90, _spawnPos]; // show map location
 ctrlmapanimcommit _ctrl;

 _ctrl ctrlmapanimadd [0.1, 0.20, _spawnPos]; // zoom map location
 ctrlmapanimcommit _ctrl;
};
//----------------------
SPWN_AcceptButton =
{
 _selectedIndex = lbCurSel SPWN_IDC_RespawnList;

 RespawnLocation = lbData [sPWN_IDC_RespawnList, _selectedIndex]; // assign marker name to global var

 player globalChat format["Spawn location %1 selected. Marker name='%2'", 
   _selectedIndex, lbData [sPWN_IDC_RespawnList, _selectedIndex] ]; // debug

 closeDialog 0;
};
//----------------------
SPWN_Start =
{
 _Params = _this;

 _MyDualList =
 [ // [spawn description, marker name]
   ["1 - Base", "m_Start"],
   ["2 - Spawn2", "m_WestSpawn2"],
   ["3 - Spawn3", "m_WestSpawn3"],
   ["4 - Spawn4", "m_WestSpawn4"],
   ["5 - Spawn5", "m_WestSpawn5"]
 ];

 [sPWN_IDC_RespawnList, _MyDualList] call SPWN_FillComboList;
 //---------------------
 // find & focus current respawn location marker
 _MatchingIndex = 0;
 _Size = lbSize SPWN_IDC_RespawnList;
 for [{_i = 0}, {_i < _Size}, {_i = _i + 1}] do
 {
   if (RespawnLocation == lbData [sPWN_IDC_RespawnList, _i]) then 
   {
     _MatchingIndex = _i;
   };
 };

 lbSetCurSel [sPWN_IDC_RespawnList, _MatchingIndex];
};
//-----------------------------------------------------------------------------
// Init
//-----------------------------------------------------------------------------

_ok = createDialog "SPWN_RespawnDialog";
if !(_ok) exitWith { hint "createDialog failed" };

SPWN_display = findDisplay SPWN_IDD_RespawnDialog; 

_Params = _this;
[_Params] call SPWN_Start;

// show the countdown time
while { dialog && playerRespawnTime > -1 } do
{
 _timeRemaining = format["%1 - %2 seconds", SPWN_RespawnLocationsCaption, playerRespawnTime];
 ctrlSetText [sPWN_IDC_Countdown, _timeRemaining];
 sleep 1.0;
};
ctrlSetText [sPWN_IDC_Countdown, SPWN_RespawnLocationsCaption];

Common Folder

1. create a script and name it DialogColorConstants.hpp

then put the following code inside the script:

// Desc: A large selection of #define color constants.
// By: Dr Eyeball
// Version: 0.01 alpha (May 2007)

//-----------------------------------------------------------------------------
// Color Scheme - constants
//-----------------------------------------------------------------------------
#define Dlg_ColorScheme_DialogBackground Dlg_Color_Gray_10
#define Dlg_ColorScheme_DialogText Dlg_Color_white

#define Dlg_ColorScheme_ControlBackground Dlg_Color_Gray_10
#define Dlg_ColorScheme_ControlText Dlg_Color_white

#define Dlg_ColorScheme_ButtonBackground Dlg_Color_Gray_10
#define Dlg_ColorScheme_ButtonText Dlg_Color_white

#define Dlg_ColorScheme_HighlightBackground Dlg_Color_paleBlue2
#define Dlg_ColorScheme_HighlightText Dlg_Color_white

//-----------------------------------------------------------------------------
// Color attributes
//-----------------------------------------------------------------------------

#define Dlg_ColorAttribute_Clear {0, 0, 0, 0}

//-----------------------------------------------------------------------------
// Main base colors
//-----------------------------------------------------------------------------

#define Dlg_Color_Black 0,0,0
#define Dlg_Color_White 1,1,1

// additive primaries
#define Dlg_Color_Red 1,0,0
#define Dlg_Color_Lime 0,1,0
#define Dlg_Color_Blue 0,0,1

// subtractive primaries
#define Dlg_Color_Yellow 1,1,0
#define Dlg_Color_Fuchsia 1,0,1 // Dlg_Color_Magenta
#define Dlg_Color_Aqua 0,1,1 // Dlg_Color_Cyan

// shades
#define Dlg_Color_Maroon 0.5,0,0
#define Dlg_Color_Green 0,0.5,0
#define Dlg_Color_Navy 0,0,0.5

#define Dlg_Color_Olive 0.5,0.5,0
#define Dlg_Color_Purple 0.5,0,0.5
#define Dlg_Color_Teal 0,0.5,0.5

// grays
#define Dlg_Color_Gray 0.5,0.5,0.5 // Dlg_Color_DkGray
#define Dlg_Color_Silver 0.75,0.75,0.75 // Dlg_Color_LtGray
#define Dlg_Color_LtGray 0.75,0.75,0.75 // Dlg_Color_Silver
#define Dlg_Color_DkGray 0.5,0.5,0.5 // Dlg_Color_Gray

// 0.1 is darkest (near black) 0.9 is lightest (near white)
#define Dlg_Color_Gray_1 0.1,0.1,0.1
#define Dlg_Color_Gray_2 0.2,0.2,0.2
#define Dlg_Color_Gray_3 0.3,0.3,0.3
#define Dlg_Color_Gray_4 0.4,0.4,0.4
#define Dlg_Color_Gray_5 0.5,0.5,0.5
#define Dlg_Color_Gray_6 0.6,0.6,0.6
#define Dlg_Color_Gray_7 0.7,0.7,0.7
#define Dlg_Color_Gray_8 0.8,0.8,0.8
#define Dlg_Color_Gray_9 0.9,0.9,0.9

//-----------------------------------------------------------------------------
// Extended colors - based on 'html'/'web' colors
//-----------------------------------------------------------------------------
#define Dlg_Color_AliceBlue 0.937500,0.968750,1.000000
#define Dlg_Color_AntiqueWhite 0.976563,0.917969,0.839844
#define Dlg_Color_Aquamarine 0.496094,1.000000,0.828125
#define Dlg_Color_Azure 0.937500,1.000000,1.000000
#define Dlg_Color_Beige 0.957031,0.957031,0.859375
#define Dlg_Color_Bisque 1.000000,0.890625,0.765625
//#define Dlg_Color_Black 0.000000,0.000000,0.000000
#define Dlg_Color_BlanchedAlmond 1.000000,0.917969,0.800781
//#define Dlg_Color_Blue 0.000000,0.000000,1.000000
#define Dlg_Color_BlueViolet 0.539063,0.167969,0.882813
#define Dlg_Color_Brown 0.644531,0.164063,0.164063
#define Dlg_Color_Burlywood 0.867188,0.718750,0.527344
#define Dlg_Color_CadetBlue 0.371094,0.617188,0.625000
#define Dlg_Color_Chartreuse 0.496094,1.000000,0.000000
#define Dlg_Color_Chocolate 0.820313,0.410156,0.117188
#define Dlg_Color_Coral 1.000000,0.496094,0.312500
#define Dlg_Color_CornFlowerBlue 0.390625,0.582031,0.925781
#define Dlg_Color_CornSilk 1.000000,0.968750,0.859375
#define Dlg_Color_Crimson 0.859375,0.078125,0.234375
#define Dlg_Color_Cyan 0.000000,1.000000,1.000000 // Dlg_Color_Aqua
#define Dlg_Color_DarkBlue 0.000000,0.000000,0.542969
#define Dlg_Color_DarkCyan 0.000000,0.542969,0.542969
#define Dlg_Color_DarkGoldenRod 0.718750,0.523438,0.042969
#define Dlg_Color_DarkGray 0.660156,0.660156,0.660156
#define Dlg_Color_Darkgreen 0.000000,0.390625,0.000000
#define Dlg_Color_DarkKhaki 0.738281,0.714844,0.417969
#define Dlg_Color_DarkMagenta 0.542969,0.000000,0.542969
#define Dlg_Color_DarkOliveGreen 0.332031,0.417969,0.183594
#define Dlg_Color_DarkOrange 1.000000,0.546875,0.000000
#define Dlg_Color_DarkOrchid 0.597656,0.195313,0.796875
#define Dlg_Color_DarkRed 0.542969,0.000000,0.000000
#define Dlg_Color_DarkSalmon 0.910156,0.585938,0.476563
#define Dlg_Color_DarkSeaGreen 0.558594,0.734375,0.558594
#define Dlg_Color_DarkSlateBlue 0.281250,0.238281,0.542969
#define Dlg_Color_DarkSlategray 0.183594,0.308594,0.308594
#define Dlg_Color_DarkTurquoise 0.000000,0.804688,0.816406
#define Dlg_Color_DarkViolet 0.578125,0.000000,0.824219
#define Dlg_Color_DeepPink 1.000000,0.078125,0.574219
#define Dlg_Color_DeepskyBlue 0.000000,0.746094,1.000000
#define Dlg_Color_DimGray 0.410156,0.410156,0.410156
#define Dlg_Color_DodgerBlue 0.117188,0.562500,1.000000
#define Dlg_Color_Firebrick 0.695313,0.132813,0.132813
#define Dlg_Color_FloralWhite 1.000000,0.976563,0.937500
#define Dlg_Color_ForestGreen 0.132813,0.542969,0.132813
#define Dlg_Color_Gainsboro 0.859375,0.859375,0.859375
#define Dlg_Color_GhostWhite 0.968750,0.968750,1.000000
#define Dlg_Color_Gold 1.000000,0.839844,0.000000
#define Dlg_Color_GoldenRod 0.851563,0.644531,0.125000
//#define Dlg_Color_Gray 0.500000,0.500000,0.500000
//#define Dlg_Color_Green 0.000000,0.500000,0.000000
#define Dlg_Color_GreenYellow 0.675781,1.000000,0.183594
#define Dlg_Color_Honeydew 0.937500,1.000000,0.937500
#define Dlg_Color_HotPink 1.000000,0.410156,0.703125
#define Dlg_Color_IndianRed 0.800781,0.359375,0.359375
#define Dlg_Color_Indigo 0.292969,0.000000,0.507813
#define Dlg_Color_Ivory 1.000000,1.000000,0.937500
#define Dlg_Color_Khaki 0.937500,0.898438,0.546875
#define Dlg_Color_Lavender 0.898438,0.898438,0.976563
#define Dlg_Color_LavenderBlush 1.000000,0.937500,0.957031
#define Dlg_Color_LawnGreen 0.484375,0.984375,0.000000
#define Dlg_Color_LemonChiffon 1.000000,0.976563,0.800781
#define Dlg_Color_LightBlue 0.675781,0.843750,0.898438
#define Dlg_Color_LightCoral 0.937500,0.500000,0.500000
#define Dlg_Color_LightCyan 0.875000,1.000000,1.000000
#define Dlg_Color_LightGoldenrodYellow 0.976563,0.976563,0.820313
#define Dlg_Color_LightGreen 0.562500,0.929688,0.562500
#define Dlg_Color_Lightgrey 0.824219,0.824219,0.824219
#define Dlg_Color_LightPink 1.000000,0.710938,0.753906
#define Dlg_Color_LightSalmon 1.000000,0.625000,0.476563
#define Dlg_Color_LightSeaGreen 0.125000,0.695313,0.664063
#define Dlg_Color_LightSkyBlue 0.527344,0.804688,0.976563
#define Dlg_Color_LightSlateGray 0.464844,0.531250,0.597656
#define Dlg_Color_LightSteelBlue 0.687500,0.765625,0.867188
#define Dlg_Color_LightYellow 1.000000,1.000000,0.875000
//#define Dlg_Color_Lime 0.000000,1.000000,0.000000
#define Dlg_Color_LimeGreen 0.195313,0.800781,0.195313
#define Dlg_Color_Linen 0.976563,0.937500,0.898438
#define Dlg_Color_Magenta 1.000000,0.000000,1.000000
//#define Dlg_Color_Maroon 0.500000,0.000000,0.000000
#define Dlg_Color_MediumAquamarine 0.398438,0.800781,0.664063
#define Dlg_Color_MediumBlue 0.000000,0.000000,0.800781
#define Dlg_Color_MediumOrchid 0.726563,0.332031,0.824219
#define Dlg_Color_MediumPurple 0.574219,0.437500,0.855469
#define Dlg_Color_MediumSeaGreen 0.234375,0.699219,0.441406
#define Dlg_Color_MediumSlateBlue 0.480469,0.406250,0.929688
#define Dlg_Color_MediumSpringGreen 0.000000,0.976563,0.601563
#define Dlg_Color_MediumTurquoise 0.281250,0.816406,0.796875
#define Dlg_Color_MediumVioletRed 0.777344,0.082031,0.519531
#define Dlg_Color_MidnightBlue 0.097656,0.097656,0.437500
#define Dlg_Color_Mintcream 0.957031,1.000000,0.976563
#define Dlg_Color_MistyRose 1.000000,0.890625,0.878906
#define Dlg_Color_Moccasin 1.000000,0.890625,0.707031
#define Dlg_Color_NavajoWhite 1.000000,0.867188,0.675781
//#define Dlg_Color_Navy 0.000000,0.000000,0.500000
#define Dlg_Color_OldLace 0.988281,0.957031,0.898438
//#define Dlg_Color_Olive 0.500000,0.500000,0.000000
#define Dlg_Color_OliveDrab 0.417969,0.554688,0.136719
#define Dlg_Color_Orange 1.000000,0.644531,0.000000
#define Dlg_Color_OrangeRed 1.000000,0.269531,0.000000
#define Dlg_Color_Orchid 0.851563,0.437500,0.835938
#define Dlg_Color_PaleGoldenrod 0.929688,0.906250,0.664063
#define Dlg_Color_PaleGreen 0.593750,0.980469,0.593750
#define Dlg_Color_PaleTurquoise 0.683594,0.929688,0.929688
#define Dlg_Color_PaleVioletRed 0.855469,0.437500,0.574219
#define Dlg_Color_PapayaWhip 1.000000,0.933594,0.832031
#define Dlg_Color_PeachPuff 1.000000,0.851563,0.722656
#define Dlg_Color_Peru 0.800781,0.519531,0.246094
#define Dlg_Color_Pink 1.000000,0.750000,0.792969
#define Dlg_Color_Plum 0.863281,0.625000,0.863281
#define Dlg_Color_PowderBlue 0.687500,0.875000,0.898438
//#define Dlg_Color_Purple 0.500000,0.000000,0.500000
//#define Dlg_Color_Red 1.000000,0.000000,0.000000
#define Dlg_Color_RosyBrown 0.734375,0.558594,0.558594
#define Dlg_Color_RoyalBlue 0.253906,0.410156,0.878906
#define Dlg_Color_SaddleBrown 0.542969,0.269531,0.074219
#define Dlg_Color_Salmon 0.976563,0.500000,0.445313
#define Dlg_Color_SandyBrown 0.953125,0.640625,0.375000
#define Dlg_Color_SeaGreen 0.179688,0.542969,0.339844
#define Dlg_Color_Seashell 1.000000,0.957031,0.929688
#define Dlg_Color_Sienna 0.625000,0.320313,0.175781
//#define Dlg_Color_Silver 0.750000,0.750000,0.750000
#define Dlg_Color_SkyBlue 0.527344,0.804688,0.917969
#define Dlg_Color_SlateBlue 0.414063,0.351563,0.800781
#define Dlg_Color_SlateGray 0.437500,0.500000,0.562500
#define Dlg_Color_Snow 1.000000,0.976563,0.976563
#define Dlg_Color_SpringGreen 0.000000,1.000000,0.496094
#define Dlg_Color_SteelBlue 0.273438,0.507813,0.703125
#define Dlg_Color_Tan 0.820313,0.703125,0.546875
//#define Dlg_Color_Teal 0.000000,0.500000,0.500000
#define Dlg_Color_Thistle 0.843750,0.746094,0.843750
#define Dlg_Color_Tomato 1.000000,0.386719,0.277344
#define Dlg_Color_Turquoise 0.250000,0.875000,0.812500
#define Dlg_Color_Violet 0.929688,0.507813,0.929688
#define Dlg_Color_Wheat 0.957031,0.867188,0.699219
//#define Dlg_Color_White 1.000000,1.000000,1.000000
#define Dlg_Color_WhiteSmoke 0.957031,0.957031,0.957031
//#define Dlg_Color_Yellow 1.000000,1.000000,0.000000
#define Dlg_Color_YellowGreen 0.601563,0.800781,0.195313

//-----------------------------------------------------------------------------
// Extended colors - a few odd pastel colors
//-----------------------------------------------------------------------------
#define Dlg_Color_MoneyGreen 0.75,0.859375,0.75
//#define Dlg_Color_SkyBlue 0.6484375,0.7890625,0.9375
#define Dlg_Color_Cream 1,0.98046875,0.9375
#define Dlg_Color_MedGray 0.625,0.625,0.640625

2. create a script and name it DialogControlClasses.hpp

then put the following code inside the script:

// Desc: The top section contains the standard dialog #define constants, used for 
// controls, styles & fonts. The bottom section contains the standard base dialog 
// control class definitions, from which you can inherit.
//
// Notes: There are many slightly different versions of this file around.
// By: public code taken from various sources: BIS pbo's, tutorials, WIKI & other scripts
// Colors and coeff's referenced from quickmap.hpp, by mi2slow & Vienna.
//
// Version: 0.01 alpha (May 2007, Dr Eyeball)
//-----------------------------------------------------------------------------

// Constants to standardize and help simplify positioning and sizing
#define Dlg_ROWS 36 // determines default text and control height
#define Dlg_COLS 90 // guide for positioning controls

// (Calculate proportion, then /100 to represent as percentage)
#define Dlg_CONTROLHGT ((100/Dlg_ROWS)/100)
#define Dlg_COLWIDTH ((100/Dlg_COLS)/100)

#define Dlg_ROWHGT_MOD 1.0
#define Dlg_TEXTHGT_MOD 1.3
#define Dlg_ROWSPACING 0.01

#define Dlg_ROWHGT (Dlg_CONTROLHGT/Dlg_ROWHGT_MOD)
#define Dlg_TEXTHGT (Dlg_ROWHGT/Dlg_TEXTHGT_MOD)

//-----------------------------------------------------------------------------
// Fonts
#define FontM "TahomaB"
#define FontHTML "TahomaB"
//"CourierNewB64" "TahomaB" "Bitstream" "Zeppelin32"

//-----------------------------------------------------------------------------
// Control Types 
#define CT_STATIC 0 
#define CT_BUTTON 1 
#define CT_EDIT 2 
#define CT_SLIDER 3 
#define CT_COMBO 4 
#define CT_LISTBOX 5 
#define CT_TOOLBOX 6 
#define CT_CHECKBOXES 7 
#define CT_PROGRESS 8 
#define CT_HTML 9 
#define CT_STATIC_SKEW 10 
#define CT_ACTIVETEXT 11 
#define CT_TREE 12 
#define CT_STRUCTURED_TEXT 13 
#define CT_CONTEXT_MENU 14 
#define CT_CONTROLS_GROUP 15 
#define CT_3DSTATIC 20
#define CT_3DACTIVETEXT 21
#define CT_3DLISTBOX 22
#define CT_3DHTML 23
#define CT_3DSLIDER 24
#define CT_3DEDIT 25
#define CT_XKEYDESC 40 
#define CT_XBUTTON 41 
#define CT_XLISTBOX 42 
#define CT_XSLIDER 43 
#define CT_XCOMBO 44 
#define CT_ANIMATED_TEXTURE 45 
#define CT_OBJECT 80 
#define CT_OBJECT_ZOOM 81 
#define CT_OBJECT_CONTAINER 82 
#define CT_OBJECT_CONT_ANIM 83 
#define CT_LINEBREAK 98 
#define CT_USER 99 
#define CT_MAP 100 
#define CT_MAP_MAIN 101 

//-----------------------------------------------------------------------------
// Static styles 
#define ST_POS 0x0F 
#define ST_HPOS 0x03 
#define ST_VPOS 0x0C 

#define ST_LEFT 0x00 
#define ST_RIGHT 0x01 
#define ST_CENTER 0x02 
#define ST_DOWN 0x04 
#define ST_UP 0x08 

#define ST_VCENTER 0x0c 
#define ST_TYPE 0xF0 

#define ST_SINGLE 0 
#define ST_MULTI 16 
#define ST_TITLE_BAR 32 
#define ST_PICTURE 48 
#define ST_FRAME 64 
#define ST_BACKGROUND 80 
#define ST_GROUP_BOX 96 
#define ST_GROUP_BOX2 112 
#define ST_HUD_BACKGROUND 128 
#define ST_TILE_PICTURE 144 
#define ST_WITH_RECT 160 
#define ST_LINE 176 

//-----------------------------------------------------------------------------
// standard base dialog control class definitions
//-----------------------------------------------------------------------------
class RscText
{
 type = CT_STATIC;
 idc = -1;
 style = ST_LEFT;

 colorBackground[] = {Dlg_Color_Black,1};
 colorText[] = {Dlg_Color_White,1};
 font = FontM;

 sizeEx = Dlg_TEXTHGT;
 h = Dlg_CONTROLHGT;

 text = "";
};
//-------------------------------------
class RscFrame: RscText
{
 style = ST_FRAME;
 x = 0.0;
 y = 0.0;
 w = 1.0;
 h = 1.0;
};
//-------------------------------------
class RscActiveText
{
 type = CT_ACTIVETEXT;
 idc = -1;
 style = ST_LEFT;

 color[] = {Dlg_Color_White,1};
 colorActive[] = {Dlg_Color_Red,1};
 font = FontM;

 sizeEx = Dlg_TEXTHGT;

 soundEnter[] = {"ui\ui_over", 0.2, 1};
 soundPush[] = {, 0.2, 1};
 soundClick[] = {"ui\ui_ok", 0.2, 1};
 soundEscape[] = {"ui\ui_cc", 0.2, 1};
 default = false;
};
//-------------------------------------
class RscButton
{
 type = CT_BUTTON;
 idc = -1;
 style = ST_CENTER;

 colorText[] = {Dlg_Color_White,1};
 colorDisabled[] = {Dlg_Color_Aqua,0.1};
 colorBackground[] = {Dlg_Color_Gray_2,1};
 colorBackgroundActive[] = {Dlg_Color_Yellow,0.4};
 colorBackgroundDisabled[] = {Dlg_Color_Red,0.1};
 colorFocused[] = {Dlg_Color_Black,1};
 colorShadow[] = {Dlg_Color_Pink,0.2};
 colorBorder[] = {Dlg_Color_White,0.2};
 font = FontHTML;

 sizeEx = Dlg_TEXTHGT;

 offsetX = 0;
 offsetY = 0;
 offsetPressedX = 0;
 offsetPressedY = 0;
 borderSize = 0.001;
 soundEnter[] = {"ui\ui_ok", 0.2, 1};

 soundPush[] = {, 0.2, 1};
 soundClick[] = {"ui\ui_ok", 0.2, 1};
 soundEscape[] = {"ui\ui_cc", 0.2, 1};
 default = false;
 text = "";
 action = "";
};
//-------------------------------------
class RscEdit
{
 type = CT_EDIT;
 idc = -1;
 style = ST_LEFT;

 colorText[] = {Dlg_Color_Black,1};
 colorSelection[] = {Dlg_Color_Gray_5,1};
 font = FontHTML;

 sizeEx = Dlg_TEXTHGT;

 autocomplete = false;
 text = "";
};
//-------------------------------------
class RscLB_LIST
{
 // type = defined in derived class
 idc = -1;
 style = ST_LEFT;

 color[] = {Dlg_Color_White,1};
 colorText[] = {Dlg_Color_White,1};
 colorSelect[] = {Dlg_Color_White,1};
 colorSelect2[] = {Dlg_Color_White,1};
 colorScrollbar[] = {Dlg_Color_White,1};
 colorBackground[] = {Dlg_Color_Gray_4,1};
 colorSelectBackground[] = {Dlg_Color_Gray_2,1};
 colorSelectBackground2[] = {Dlg_Color_Gray_4,0.75};
 font = FontHTML;

 sizeEx = Dlg_TEXTHGT;
 h = Dlg_CONTROLHGT;
 rowHeight = Dlg_CONTROLHGT;

 soundSelect[] = {"ui\ui_cc", 0.2, 1}; // unchecked
 soundExpand[] = {"ui\ui_cc", 0.2, 1}; // unchecked
 soundCollapse[] = {"ui\ui_cc", 0.2, 1}; // unchecked
};
//-------------------------------------
class RscListBox: RscLB_LIST
{
 type = CT_LISTBOX;

 onLBSelChanged = "";
 onLBDblClick = "";
};
//-------------------------------------
class RscCombo: RscLB_LIST
{
 type = CT_COMBO;

 wholeHeight = 0.3;
};
//-------------------------------------
class RscObject
{
   type = CT_OBJECT;

   scale = 1.0;
   direction[] = {0, 0, 1};
   up[] = {0, 1, 0};
};
//-------------------------------------
class Rsc3DStatic
{
   type = CT_3DSTATIC;
   style = ST_LEFT;

   color[] = {Dlg_Color_Black,1};
   font = FontHTML;

   size = 0.04;

   selection = "display";
   angle = 0;
};
//-------------------------------------
class RscPicture
{
   type = CT_STATIC;
   idc = -1;
   style = ST_PICTURE;

   colorBackground[] = {0, 0, 0, 0};
   colorText[] = {Dlg_Color_White, 1};
   font = Zeppelin32;

   sizeEx = Dlg_TEXTHGT;
 text = "";
};
//-------------------------------------
class RscHTML
{
 type = CT_HTML;
 idc = -1;
 style = ST_LEFT;

   colorText[] = {Dlg_Color_White, 1};
   colorLink[] = {0.05, 0.2, 0.05, 1};
   colorBold[] = {0, 1, 1, 1};
   colorBackground[] = {0, 0, 0, 0.5};
   colorLinkActive[] = {0, 0, 0.2, 1};
   colorPicture[] = {Dlg_Color_Black, 1};
   colorPictureLink[] = {Dlg_Color_Black, 1};
   colorPictureSelected[] = {Dlg_Color_Black, 1};
   colorPictureBorder[] = {Dlg_Color_Black, 1};

   prevPage = "\ca\ui\data\arrow_left_ca.paa";
   nextPage = "\ca\ui\data\arrow_right_ca.paa";
   filename = "";

   class HeadingStyle {
       font = "Zeppelin32";
       fontBold = "Zeppelin33";
       sizeEx = Dlg_TEXTHGT;
   };

   class H1: HeadingStyle {
       sizeEx = Dlg_TEXTHGT * 1.5;
   };

   class H2: HeadingStyle {
       sizeEx = Dlg_TEXTHGT * 1.4;
   };

   class H3: HeadingStyle {
       sizeEx = Dlg_TEXTHGT * 1.3;
   };

   class H4: HeadingStyle {
       sizeEx = Dlg_TEXTHGT * 1.2;
   };

   class H5: HeadingStyle {
       sizeEx = Dlg_TEXTHGT * 1.1;
   };

   class H6: HeadingStyle {
       sizeEx = Dlg_TEXTHGT;
   };

   class P: HeadingStyle {
       sizeEx = Dlg_TEXTHGT;
   };
};
//-------------------------------------
class RscMapControl 
{
 type = CT_MAP_MAIN;
 idc = -1;
 style = ST_PICTURE;

 colorSea[] = {0.56, 0.8, 0.98, 0.5};
   colorForest[] = {0.6, 0.8, 0.2, 0.5};
   colorRocks[] = {0.6, 0.45, 0.27, 0.4};
   colorCountlines[] = {0.7, 0.55, 0.3, 0.6};
   colorCountlinesWater[] = {0, 0.53, 1, 0.5};
 colorMainCountlines[] = {0.65, 0.45, 0.27, 1};
 colorMainCountlinesWater[] = {0, 0.53, 1, 1};
 colorPowerLines[] = {Dlg_Color_Black, 1};
 colorLevels[] = {Dlg_Color_Black, 1};
   colorForestBorder[] = {0.4, 0.8, 0, 1};
   colorRocksBorder[] = {0.6, 0.45, 0.27, 0.4};
   colorNames[] = {Dlg_Color_Black, 1};
   colorInactive[] = {Dlg_Color_White, 0.5};
 colorBackground[] = {Dlg_Color_White, 1};
 colorText[] = {Dlg_Color_White, 1};

 font = "Zeppelin32";
 sizeEx = 0.05;

 fontLabel = "Zeppelin32";
   sizeExLabel = 0.0286458;
   fontGrid = "Zeppelin32";
   sizeExGrid = 0.0286458;
   fontUnits = "Zeppelin32";
   sizeExUnits = 0.0286458;
   fontNames = "Zeppelin32";
   sizeExNames = 0.0286458;
   fontInfo = "Zeppelin32";
   sizeExInfo = 0.0286458;
   fontLevel = "Zeppelin32";
   sizeExLevel = 0.0286458;

 ptsPerSquareSea    = 6;
 ptsPerSquareTxt    = 8;
 ptsPerSquareCLn    = 8;
 ptsPerSquareExp    = 8;
 ptsPerSquareCost = 8;
 ptsPerSquareFor = "4.0f";
 ptsPerSquareForEdge = "10.0f";
 ptsPerSquareRoad = 2;
 ptsPerSquareObj = 10;

   text = "\ca\ui\data\map_background2_co.paa";
 x = 0.1;
 y = 0.1;
 w = 0.3;
 h = 0.3;
 ShowCountourInterval = 0;
 scaleDefault = 0.1;
 onMouseButtonClick = "";
 onMouseButtonDblClick = "";

 class ActiveMarker {
   color[] = {0.3, 0.1, 0.9, 1};
   size    = 50;
 };

   class Legend {
       x = 0.729;
       y = 0.05;
       w = 0.237;
       h = 0.127;
       font = "Zeppelin32";
       sizeEx = 0.0208333;
       colorBackground[] = {0.906, 0.901, 0.88, 0.8};
       color[] = {Dlg_Color_Black, 1};
   };

   class Bunker {
   color[] = {0, 0.35, 0.7, 1};
       icon = "\ca\ui\data\map_bunker_ca.paa";
       size = 14;
       importance = 1.5 * 14 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Bush {
       icon = "\ca\ui\data\map_bush_ca.paa";
       color[] = {0.55, 0.64, 0.43, 1};
       size = 14;
       importance = 0.2 * 14 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class BusStop {
       icon = "\ca\ui\data\map_busstop_ca.paa";
       color[] = {0, 0, 1, 1};
       size = 10;
       importance = 1 * 10 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Command {
       icon = "#(argb,8,8,3)color(1,1,1,1)";
       color[] = {0, 0.9, 0, 1};
       size = 18;
       importance = 1;
       coefMin = 1;
       coefMax = 1;
   };

   class Cross {
   color[] = {0, 0.35, 0.7, 1};
       icon = "\ca\ui\data\map_cross_ca.paa";
       size = 16;
       importance = 0.7 * 16 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Fortress {
       icon = "\ca\ui\data\map_bunker_ca.paa";
   color[] = {0, 0.35, 0.7, 1};
       size = 16;
       importance = 2 * 16 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Fuelstation {
       icon = "\ca\ui\data\map_fuelstation_ca.paa";
   color[] = {1.0, 0.35, 0.35, 1};
       size = 16;
       importance = 2 * 16 * 0.05;
       coefMin = 0.75;
       coefMax = 4;
   };

   class Fountain {
       icon = "\ca\ui\data\map_fountain_ca.paa";
       color[] = {0, 0.35, 0.7, 1};
       size = 12;
       importance = 1 * 12 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Hospital {
       icon = "\ca\ui\data\map_hospital_ca.paa";
       color[] = {0.78, 0, 0.05, 1};
       size = 16;
       importance = 2 * 16 * 0.05;
       coefMin = 0.5;
       coefMax = 4;
   };

   class Chapel {
       icon = "\ca\ui\data\map_chapel_ca.paa";
   color[] = {0, 0.35, 0.7, 1};
       size = 16;
       importance = 1 * 16 * 0.05;
       coefMin = 0.9;
       coefMax = 4;
   };

   class Church {
       icon = "\ca\ui\data\map_church_ca.paa";
   color[] = {0, 0.35, 0.7, 1};
       size = 16;
       importance = 2 * 16 * 0.05;
       coefMin = 0.9;
       coefMax = 4;
   };

   class Lighthouse {
       icon = "\ca\ui\data\map_lighthouse_ca.paa";
       color[] = {0.78, 0, 0.05, 1};
       size = 20;
       importance = 3 * 16 * 0.05;
       coefMin = 0.9;
       coefMax = 4;
   };

   class Quay {
       icon = "\ca\ui\data\map_quay_ca.paa";
   color[] = {0, 0.35, 0.7, 1};
       size = 16;
       importance = 2 * 16 * 0.05;
       coefMin = 0.5;
       coefMax = 4;
   };

   class Rock {
   color[] = {0.35, 0.35, 0.35, 1};
       icon = "\ca\ui\data\map_rock_ca.paa";
       size = 12;
       importance = 0.5 * 12 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Ruin {
       icon = "\ca\ui\data\map_ruin_ca.paa";
       color[] = {0.78, 0, 0.05, 1};
       size = 16;
       importance = 1.2 * 16 * 0.05;
       coefMin = 1;
       coefMax = 4;
   };

   class SmallTree {
       icon = "\ca\ui\data\map_smalltree_ca.paa";
       color[] = {0.55, 0.64, 0.43, 1};
       size = 12;
       importance = 0.6 * 12 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Stack {
       icon = "\ca\ui\data\map_stack_ca.paa";
   color[] = {0, 0.35, 0.7, 1};
       size = 20;
       importance = 2 * 16 * 0.05;
       coefMin = 0.9;
       coefMax = 4;
   };

   class Tree {
       icon = "\ca\ui\data\map_tree_ca.paa";
       color[] = {0.55, 0.64, 0.43, 1};
       size = 12;
       importance = 0.9 * 16 * 0.05;
       coefMin = 0.25;
       coefMax = 4;
   };

   class Tourism {
       icon = "\ca\ui\data\map_tourism_ca.paa";
       color[] = {0.78, 0, 0.05, 1};
       size = 16;
       importance = 1 * 16 * 0.05;
       coefMin = 0.7;
       coefMax = 4;
   };

   class Transmitter {
       icon = "\ca\ui\data\map_transmitter_ca.paa";
   color[] = {0, 0.35, 0.7, 1};
       size = 20;
       importance = 2 * 16 * 0.05;
       coefMin = 0.9;
       coefMax = 4;
   };

   class ViewTower {
       icon = "\ca\ui\data\map_viewtower_ca.paa";
   color[] = {0, 0.35, 0.7, 1};
       size = 16;
       importance = 2.5 * 16 * 0.05;
       coefMin = 0.5;
       coefMax = 4;
   };

   class Watertower {
       icon = "\ca\ui\data\map_watertower_ca.paa";
       color[] = {0, 0.35, 0.7, 1};
       size = 32;
       importance = 1.2 * 16 * 0.05;
       coefMin = 0.9;
       coefMax = 4;
   };

   class Waypoint {
       icon = "\ca\ui\data\map_waypoint_ca.paa";
     color[] = {0, 0.35, 0.7, 1};
     size = 32;
     coefMin = 1.00;
     coefMax = 1.00;
     importance = 1.00;
   };

   class WaypointCompleted {
       icon = "\ca\ui\data\map_waypoint_completed_ca.paa";
     color[] = {Dlg_Color_Black, 1};
     size = 24;
     importance = 1.00;
     coefMin = 1.00;
     coefMax = 1.00;
   };
};
//-------------------------------------
class RscMap 
{
   access = ReadAndWrite;

   class controls {
       class Map : RscMapControl {
           moveOnEdges = 0;
           x = 0;
           y = 0;
           w = 0.83;
           h = 1;
       };
   };
};

//=============================================================================
// Some common class definitions - most dialogs need a background
class Dlg_FullBackground: RscText
{
 colorBackground[] = {Dlg_Color_Gray_3,1};
 x = 0.0;
 y = 0.0;
 w = 1.0;
 h = 1.0;
};
//-------------------------------------
class Dlg_FullBackgroundFrame: RscFrame
{
 text = " Selection Dialog ";
 x = 0.0;
 y = 0.0;
 w = 1.0;
 h = 1.0;
};

What you should have so far

1. You should have a folder that is titled Dialogs,

inside that folder you should have 2 scripts named:

Respawn_Dialog.hpp

Respawn_Dialog.sqf

2. You should have a folder that is titled Common which is inside the Dialogs folder.

The Common folder should have 2 scripts inside it and they are:

DialogColorConstants.hpp

DialogControlClasses.hpp

=====================

Inside your mission folder

Inside your mission folder you should have the following folders and files that we just created above:

A folder named Dialogs with 2 scripts, and inside the Dialogs folder you should have another

folder named common with 2 scripts inside that.

=========

Step B

In this next step we will need to create another folder and other scripts, follow the steps below:

1. Create a folder and name it Scripts

inside this folder we need to create a script, so create a script and name it:

respawn_player.sqf

inside this script add this code:

// Desc: A respawn control script

for [{}, {true}, {true}] do
{
 //waitUntil { !(alive player) };
 while { alive player } do { sleep 1.0 };

 nul=[] execVM "Dialogs\Respawn_Dialog.sqf";

 // wait for respawn countdown to finish and for the selection to be made from the dialog
 // (Upon auto respawning after countdown, you will respawn at "RespawnWest" marker.)
 //waitUntil { alive player && !dialog };
 while { !alive player || dialog } do { sleep 1.0 };

 // player spawned at "RespawnWest" marker initially, so move him to final selected spawn location
 player setPos getMarkerPos RespawnLocation;
};

Lets recap:

Inside your mission folder

Inside your mission folder you should have the following folders and files that we just created above:

A folder named Scripts with 1 script inside named respawn_player.sqf

=========

Step C

in this next step we will need to create 2 scripts, follow the steps below:

1. Create a script and name it description.ext

inside the description.ext script put the following codes:

class Header 
{
 gameType=Coop;
 minPlayers=1;
 maxPlayers=5;
};

#include "Dialogs\Common\DialogColorConstants.hpp"
#include "Dialogs\Common\DialogControlClasses.hpp"

#include "Dialogs\Respawn_Dialog.hpp"

Respawn = "BASE";
RespawnDelay = 3;
RespawnDialog = false; // hide spawn countdown dialog

2. Create a script and name it init.sqf

inside the init.sqf put the following code:

RespawnLocation = "m_Start"; // marker name, init start location
player setPos getMarkerPos RespawnLocation;

//player addeventhandler ["Killed", {_this execVM "scripts\respawn_player.sqf"}]; // would rather use event handler
player execVM "scripts\respawn_player.sqf"; // infinite loop, controls respawning

Lets recap:

Inside your mission folder

Inside your mission folder you should have the following folders and files that we just created above:

A folder named Scripts with 1 script inside named respawn_player.sqf

============

Step D

Overview

Overall Folders and scripts what you should have in your missions folder

Folders

[/b] Dialogs,

inside you should have 2 scripts named:

Respawn_Dialog.hpp

Respawn_Dialog.sqf

Inside the Dialogs folder above you should have a folder named

Common

The Common folder should have 2 scripts inside it and they are:

DialogColorConstants.hpp

DialogControlClasses.hpp

Inside the mission folder is:

Scripts folder with 1 script inside named respawn_player.sqf

Dialogs -(folder)

Scripts - (folder)

description.ext

init.sqf

mission.sqm - (mission you created in the editor)

Step E - Editor

Start the game and open your mission in the editor, and follow the steps below:

1. Put down a player, if the mission is a coop then put more units down and make them playable.

Move the units far away from where you want to start, where its isolated.

2. Create a marker (solid) and name it respawn_west

move the marker to the same spot as the units you created, so the units are in the marker area.

Base Marker

3. Create a marker and name it base, under text put start spawn

place this marker at the base where you plan to start your mission.

4. Create a marker and name it m_Start

This is the spawn point like above where you will start, so where ever this marker is at you will start there when the missions starts.

2nd Respawn Marker

5. Create a marker and name it spawn2, under text put spawn2

5a. Create a marker and name it m_WestSpawn2

3rd Respawn Marker

6. Create a marker and name it spawn3, under text put spawn3

6a. Create a marker and name it m_WestSpawn3

=============

Repeat the markers above for 5 markers, if you need more then 5 markers for respawn then you have to define it in the

Respawn_Dialog.sqf which is in the Dialogs folder.

============

Thats basically it.

So when you start you will spawn at the marker m_Start

when you die a menu will popup with a map, choose from the list which spawn you want,

if you click on a spawn the map will zoom there, if you choose that spot then hit ok at the bottom and you will spawn there.

note that there is an error message that will popup randomly which I have no idea on fixing but its random and rare.

Edited by Gnter Severloh
  • Like 1

Share this post


Link to post
Share on other sites

There base markers and scripted that way, and tbh I have no idea if that would be possible.

If you want a mobile respawn I can show you how, but not with the menu script posted above.

Share this post


Link to post
Share on other sites

I would be more than greatful if you could show how to do mobile respawn

:D

I have been trying to find something like whats in Norrins Revive without the revive part but have not come across anything like it.

Edited by LockJaw-65-

Share this post


Link to post
Share on other sites

This works fine for ArmA3. There is that random error message however but does not effect the game in any way. I tried renaming a spawn point as something more meaningful than "spawn4" such as a town or landmark but it still came up on the spawn list as "spawn4".

Where should I be modifying that?

Thank you so much for this. It will make my servers much better with a few more tweaks.

Share this post


Link to post
Share on other sites
LockJaw-65-

I would be more than greatful if you could show how to do mobile respawn

Mobile respawn

What this does.

This will allow you to respawn at a vehicle you define by the script, so in the example and scripts below

the name which is what is defined is named car

=======================================

1. Name a vehicle car this will be your respawn vehicle

2. create an init script and put in it:

init.sqf

execVM "respawnmkr.sqf";

3. create another script name it:

respawnmkr.sqf

while {true} do { //moves markers defines in editor to the position of vehicle every 10seconds
"Respawn_West" setmarkerpos getpos car; 
sleep 10; 
};

4. create another script

description.ext

respawn = base;
respawndelay = 3;

5. create a marker name it

respawn_west for blufor, the code is set for blufor if you want opfor which would be respawn_east then you

need to define it that in the code and create a marker in your mission accordingly.

Jaycerulz

This works fine for ArmA3. There is that random error message however but does not effect the game in any way. I tried renaming a

spawn point as something more meaningful than "spawn4" such as a town or landmark but it still came up on the spawn list as "spawn4".

Where should I be modifying that?

Glad it works, i dont have Arma3 to test it so thats good news.

Ya you cant just name the marker anything you want as its imbedded in the script itself.

I have another menu respawn script that does exactly as your looking to do, where the respawn marker will grab the

nearest location and then list that location on the menu, heres a link to the thread where I posted it:

http://forums.bistudio.com/showthread.php?151391-How-to-create-more-than-one-respawn&p=2353070&viewfull=1#post2353070

Share this post


Link to post
Share on other sites

Many thanks that works great.

While we on this I just saw your link right above this post. Is it possible to make more than one mobile and a static respawn then when you die you can select which one to respawn at?

Share this post


Link to post
Share on other sites

Good question, as far as another mobile respawn, what you can do is run the same thing twice but just define a new name,

so for instance the name for the first code uses the name car for the vehicle, but for multiple vehicles just give

the vehicle a new name and then define it in the script.

like this:

while {true} do { //moves markers defines in editor to the position of vehicle every 10seconds
"Respawn_West" setmarkerpos getpos car;car2
sleep 10; 
};

Lets say your new vehicle was named car2.

I dont know if this would work but by concept I think it would.

The other method would be to recreate the script with a different name, which is currently respawnmkr.sqf and then

add the name for the new car in the script itself,a nd be sure to add to the init script.

As far as choosing which one you could respawn to, i really dont know, other then getpos command could be used.

Share this post


Link to post
Share on other sites

Günter

Thanks for your work, I set the scripts as you said but when I die this comes up

http://i773.photobucket.com/albums/yy13/gazac48/1_zpsa8aea902.png (649 kB)

when I click ok I get this

http://i773.photobucket.com/albums/yy13/gazac48/2_zps964d287f.png (695 kB)

See there is no markers showing, if I pick from list I go there and the game playon

The next time I die the error does not show, but still no markers shown in map

Thanks Gary

Edited by gazac

Share this post


Link to post
Share on other sites

Hi, Thanks.

The first pic is showing an error I haven't been able to solve, it wont harm nothing the respawn still works, just hit ok,

it may come up once in a while.

The 2nd pic is what you want, the map with the menu.

For the markers have you placed markers where you wish to respawn, other then the one marker shown in your pic?

In the Respawn_Dialog.sqf located in the Dialogs folder, you have this code:

// Desc: A respawn selection dialog
// By: Dr Eyeball
// Version: 1.0 (May 2007)
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
// The following IDD & IDC variables should match their equivalents for the dialog (from "Dialogs\RespawnDialog.hpp")
SPWN_IDD_RespawnDialog = 389;

SPWN_IDC_RespawnList = 891;
SPWN_IDC_RespawnMap = 892;
SPWN_IDC_AcceptButton = 893;
SPWN_IDC_Countdown = 894;

SPWN_RespawnLocationsCaption = "Respawn Locations";

//-----------------------------------------------------------------------------
// Control functions
//-----------------------------------------------------------------------------
SPWN_FillComboList = 
{
 _idc2 = _this select 0;
 _DualList = _this select 1;

 _control = SPWN_display displayCtrl _idc2;

 lbClear _idc2;
 {
   _Item = _x select 0;
   _Data = _x select 1;
   _index = lbAdd [_idc2, _Item];
   lbSetData [_idc2, _index, _Data];
 } forEach _DualList;

 lbSetCurSel [_idc2, 0];
};
//-----------------------------------------------------------------------------
// Respawn Selection functions
//-----------------------------------------------------------------------------

//----------------------
SPWN_ViewSpawnPoint =
{
 _selection = _this select 0;  

 _control = _selection select 0;
 _selectedIndex = _selection select 1; 

 _basePos = getPos player;
 _spawnMarkerName = _control lbData _selectedIndex;
 _spawnPos = getmarkerpos _spawnMarkerName; 

 //RespawnLocation = _spawnMarkerName; // interferes

 //---- show map location using panning & zooming
 _ctrl = SPWN_display displayctrl SPWN_IDC_RespawnMap;
 ctrlMapAnimClear _ctrl; // reset while scrolling list

 _ctrl ctrlmapanimadd [0.1, 0.30, _basePos]; // show home base
 ctrlmapanimcommit _ctrl;

 _ctrl ctrlmapanimadd [0.8, 0.90, _spawnPos]; // show map location
 ctrlmapanimcommit _ctrl;

 _ctrl ctrlmapanimadd [0.1, 0.20, _spawnPos]; // zoom map location
 ctrlmapanimcommit _ctrl;
};
//----------------------
SPWN_AcceptButton =
{
 _selectedIndex = lbCurSel SPWN_IDC_RespawnList;

 RespawnLocation = lbData [sPWN_IDC_RespawnList, _selectedIndex]; // assign marker name to global var

 player globalChat format["Spawn location %1 selected. Marker name='%2'", 
   _selectedIndex, lbData [sPWN_IDC_RespawnList, _selectedIndex] ]; // debug

 closeDialog 0;
};
//----------------------
SPWN_Start =
{
 _Params = _this;

 _MyDualList =
 [ // [spawn description, marker name]
 [b]  ["1 - Base", "m_Start"],
   ["2 - Spawn2", "m_WestSpawn2"],
   ["3 - Spawn3", "m_WestSpawn3"],
   ["4 - Spawn4", "m_WestSpawn4"],
   ["5 - Spawn5", "m_WestSpawn5"][/b]
 ];

 [sPWN_IDC_RespawnList, _MyDualList] call SPWN_FillComboList;
 //---------------------
 // find & focus current respawn location marker
 _MatchingIndex = 0;
 _Size = lbSize SPWN_IDC_RespawnList;
 for [{_i = 0}, {_i < _Size}, {_i = _i + 1}] do
 {
   if (RespawnLocation == lbData [sPWN_IDC_RespawnList, _i]) then 
   {
     _MatchingIndex = _i;
   };
 };

 lbSetCurSel [sPWN_IDC_RespawnList, _MatchingIndex];
};
//-----------------------------------------------------------------------------
// Init
//-----------------------------------------------------------------------------

_ok = createDialog "SPWN_RespawnDialog";
if !(_ok) exitWith { hint "createDialog failed" };

SPWN_display = findDisplay SPWN_IDD_RespawnDialog; 

_Params = _this;
[_Params] call SPWN_Start;

// show the countdown time
while { dialog && playerRespawnTime > -1 } do
{
 _timeRemaining = format["%1 - %2 seconds", SPWN_RespawnLocationsCaption, playerRespawnTime];
 ctrlSetText [sPWN_IDC_Countdown, _timeRemaining];
 sleep 1.0;
};
ctrlSetText [sPWN_IDC_Countdown, SPWN_RespawnLocationsCaption];

Whats in bold is all you need to worry about, so heres what you do:

1. create 5 markers

2. name the first marker m_Start this marker is where you will first spawn at when you start the mission.

3. create 4 more markers after step 2 above, and name them each:

m_WestSpawn2

m_WestSpawn3

m_WestSpawn4

m_WestSpawn5

4. save and your done.

The method i described is how it works, in the spawn menu itself it will list the word Spawn for each marker and not

m_westspawn2 or the next number.

As you can see from your pic its defined in the code, if you want to change the name of the list on the menu then

change the following that are in bold to what you want:

[ // [spawn description, marker name]

["1 - Base", "m_Start"],

["2 - Spawn2", "m_WestSpawn2"],

["3 - Spawn3", "m_WestSpawn3"],

["4 - Spawn4", "m_WestSpawn4"],

["5 - Spawn5", "m_WestSpawn5"]

Should work doing that, i dont recall having any issues changing those names.

Try it out and let me know how it runs, i dont own Arma3 so i cannot look at it in Arma3.

Share this post


Link to post
Share on other sites

@ Gunter very nice step by step setup! I am very glad some of the old members are still around arma2 forums helping out(:

Share this post


Link to post
Share on other sites

Thank you, and your welcome, I try to do my part for all of the forum sections wherever the help is needed, if i know, and can help, then I will be there.

Share this post


Link to post
Share on other sites

this is really nice Günter, thanks

ported tutorial scripts like this should be cross reference linked under Mission Editing and Scripting Information?

so we don't lose helpful stuff like this in the shuffle.

Share this post


Link to post
Share on other sites

Nothing here is ported, its all from Arma1 and it works with all the games, havent had anyone tell me how its running in Arma3 as I cannot test it myself, but it should work.

The thread is already under mission editing and scripting, where it belongs, as its just about respawn using a menu.

To not lose it, just bookmark it, I do that with all sorts of stuff from the community, I have many links spread out amongst many catagories, so i ahve my own library.

If you guys are interested, heres another type of respawn similar to the Respawn map menu dialog (Pick spawn from menu)

http://forums.bistudio.com/showthread.php?151391-How-to-create-more-than-one-respawn&p=2353070&viewfull=1#post2353070

the way this one works is when you get killed ingame and black box shows up, and lists buttons for available spawns that you have placed.

A secondary option of the menu respawn is if you want to spawn where you died, just hit escape, fairy easy to use, and less scripts.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×