Jump to content
Sign in to follow this  
dr_eyeball

Respawn Dialog with script

Recommended Posts

This is just a fairly basic version of a MP Respawn Dialog.

It allows you to spawn at specific locations, which are selectable via a dialog.

Features:

- unlimited spawn locations (via markers)

- countdown timer

- map preview of spawn location

Limitations:

- it's bare bones at this stage

- there's no control over limiting where you can spawn (as you might want in a progressive spawn system).

- it is limited to one team, such as in coop missions.

- there are no weapon selections, etc (as you've seen in the Bezerk missions)

Download: Sample mission including scripts and dialog v1.0 files.

Download #1 - Uploadpower (temp 2 week link)

Screenshots:

- Full size screenshot

th_Respawn_Dialog.jpg

Basic Usage & Requirements:

to be advised...

- Basically include all the file contents (except mission.sqm) in your project.

- Add the markers from mission.sqm into your project.

more details soon...

Notes:

Ver 1.0 is using a partial alpha version of a standard dialog template, which I'm working on. The full version of the dialog template will be released within a week as a separate download. The dialog template should resolve most of the issues people are having with creating a dialog from scratch. More info on that upon release.

Edited by Dr_Eyeball
reformat

Share this post


Link to post
Share on other sites

THANKS THANKS THANKS, your totaly the man of the day.

yehaaa i can release my mission beta today. thank you very much Dr. Eyeball.

Yes!!!

Greetz, Kev

Share this post


Link to post
Share on other sites

@Dr_Eyeball

Great job. I was able to add this to a training mission I am working on.

Any plans to add the ability to chose weapons via a menu? That would be great.

The only annoying part is that the selection menu on the left can not be seen as first since it shows the player score.

Thanks for providing this. Like the work you have done for the ArmA community.

Share this post


Link to post
Share on other sites
Any plans to add the ability to chose weapons via a menu? That would be great.

No immediate plans, but I am planning on creating a weapons/gear selection dialog. I wanted it separate from the spawn dialog since I consider it a separate task and dying is a penalty, not a weapon browsing period.

I want to group the gear more sensibly:

- primary weapons & ammo

- secondary weapons & ammo

- side arms & ammo

- group hand grenades: flares, smoke canisters, hand grenades & timed grenades

- group GL grenades: smoke & grenades

- explosives - mines, satchels

- equipment - binoc's, NVG

Or possibly click on images rather than use a list, plus have common or previously selected load-outs too. It would be good to have weapon limiting too. Possibly have the same weapon dialog operate from inside a vehicle too.

Even better would be to have an Equipment building script, with all weapons visible to you. A bit like this image.

Have about 3 of each type visible, so if there's a group of you selecting weapons, there should be enough and have it respawn the weapon after you take one a few seconds later. Dropped weapons would probably just disappear. You could have all of this initialized via a single script and have it work on either a particular biulding type or building space.

The only annoying part is that the selection menu on the left can not be seen as first since it shows the player score.

You must have forgotten to add this line (to hide the spawn countdown & team scores dialog after dying):

description.ext:

RespawnDialog = false; // hide spawn countdown dialog

Edited by Dr_Eyeball
reformat

Share this post


Link to post
Share on other sites
Quote[/b] ]Notes:

Ver 1.0 is using a partial alpha version of a standard dialog template, which I'm working on. The full version of the dialog template will be released within a week as a separate download. The dialog template should resolve most of the issues people are having with creating a dialog from scratch. More info on that upon release.

Very interesting to read, can't wait to get my hands on such template :P

Share this post


Link to post
Share on other sites

Thanks Dr_Eyeball. Dialogs are out of my league, so nice to have someone like you in the ArmA community, helping us out.

Share this post


Link to post
Share on other sites

I normally start my missions with the 1-8th logo. I tried to combine what I am doing, with your respawn dialog, and I get errors at the start.

Here is what I put in my description.ext

Quote[/b] ]class RscStdText

{

type=0;

idc=-1;

style=2;

colorBackground[]={0,0,0,0};

colorText[]={1,1,1,1};

font="TahomaB14";

size=3;

};

class RscTitles

{

titles[]={intropic};

class intropic

{

idd=-1;

movingEnable=0;

duration=3;

fadein=2;

fadeout=2;

name="intropic";

controls[]={"Screen"};

class Screen : RscStdText

{

style=48;

sizeEx = 0.04;

text="Header.paa";

colorBackground[]={0,0,0,1};

x=0;

y=0;

w=1;

h=1;

};

};

I have this line in the init.sqs

Quote[/b] ]titlersc ["intropic","plain", 1]

The font="TahomaB14" seems to be in conflict with your dialogs. I no very little on dialogs, so if anyone knows what I need to do to clear up the conflict please help.

It runs fine when I do not use your respawn dialog, (Your respawn dialog runs fine as well on its own) so it must be a conflict between the two.

Share this post


Link to post
Share on other sites

I see that you have created

Quote[/b] ]Dialog Template, plus Standard Dialogs
. Do you have plans to combine your respawn dialog with it?

Also would you consider adding the ability for a mission maker to had there one custome title / logo at the start of the mission, to prevent conflicts?

Sorry to be a pain. Love the new Dialog Template you created, and the ability for view distance.

Share this post


Link to post
Share on other sites

How do I implement this into the mission I am working on? There's no readme or anything. Noobs like me have no idea what to do.

And you also said this was for only 1 team? Can you make it for both teams? The map I'm making is PvP and I want to have selectable spawns for both sides.

Share this post


Link to post
Share on other sites

@rekster: TahomaB14 error:

I tried your code together with the RespawnDialog and a different image and it works fine. Except, your code extract is missing a "};" at the end of it only.

Best if you include the exact error message you get. If I can't reproduce the problem, then I can't advise you. PM me a link to the pbo file, if you want.

I might include the Respawn dialog as a Standard dialog in the Dialog Framework. It needs a small tidy up fix for JIP, since it appears to display when you're joining, but doesn't seem to affect anything, then closes automatically upon spawning.

@zootia: Respawn dialog for both teams

I think you can simply modify the code to use the other team's spawn markers. Try something like: (not tested)

_MyDualList = [];
if (playerSide == west) then 
{
 _MyDualList =
 [ // [spawn description, marker name]
  ["1 - Base", "m_West_Start"], // renamed to "m_West_Start"
  ["2 - Town centre", "m_WestSpawn1"],
  ["3 - Runway helipad", "m_WestSpawn2"],
  ["4 - Field hospital", "m_WestSpawn3"],
  ["5 - Vehicle junkyard", "m_WestSpawn4"]
 ];
};
if (playerSide == east) then 
{
 _MyDualList =
 [ // [spawn description, marker name]
  ["1 - Base", "m_East_Start"],
  ["2 - Town centre", "m_EastSpawn1"],
  ["3 - Runway helipad", "m_EastSpawn2"],
  ["4 - Field hospital", "m_EastSpawn3"],
  ["5 - Vehicle junkyard", "m_EastSpawn4"]
 ];
};

Edit: Changed "side player" to "playerSide"

Edited by Dr_Eyeball

Share this post


Link to post
Share on other sites

Oh okay. But my first question, How do I get this script in my mission in the first place? I copied all the files except the mission.sqs into the mission directory and obviously that didnt work. I tested the map and I started out in the ocean south of ramhadi lol

Share this post


Link to post
Share on other sites

Check the first post. It says

Add the markers from mission.sqm into your project.
If you get that far that's good progress and so the markers are probably all you're missing.

Add markers for:

m_Start
m_WestSpawn1
m_WestSpawn2
m_WestSpawn3
m_WestSpawn4

or whatever you named the markers.

Edited by Dr_Eyeball
reformat

Share this post


Link to post
Share on other sites

Thanks, I got it working for 1 team. However, After I add the both team respawn script you provided in the above reply, I wont work again.

This is what I changed

Quote[/b] ]//----------------------

SPWN_Start =

{

_Params = _this;

_MyDualList = [];

if (side player == west) then

{

_MyDualList =

[ // [spawn description, marker name]

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

["2 - Road to Parisio", "m_WestSpawn1"],

["3 - Road to Yoro", "m_WestSpawn2"],

["4 - North Somato", "m_WestSpawn3"],

["5 - North of Arrival", "m_WestSpawn4"]

];

};

if (side player == east) then

{

_MyDualList =

[ // [spawn description, marker name]

["1 - Base", "m_East_Start"],

["2 - Town centre", "m_EastSpawn1"],

["3 - Runway helipad", "m_EastSpawn2"],

["4 - Field hospital", "m_EastSpawn3"],

["5 - Vehicle junkyard", "m_EastSpawn4"]

];

};

[sPWN_IDC_RespawnList, _MyDualList] call SPWN_FillComboList;

//---------------------

from the dialog.sqs

With your default dialog.sqs, Only west could respawn. Now both West and East can't. When I die I go the the respawn screen but there's no text to choose from.

Share this post


Link to post
Share on other sites

I forgot, once you die, your side changes to civilian, so you can't compare to side west/east. Change:

side player

to

playerSide

I tested that. It works better. Not sure if anything else required yet.

Edited by Dr_Eyeball
reformat

Share this post


Link to post
Share on other sites

Dr. Eyeball,

Thanks for another excellent contribution. I now have this integrated into a developing MP game and it works perfectly for my mission. I am also very much looking forward to the weapon selection system as well. Keep us updated!

If you need hosting support let me know and I can arrange it through the tacticalgamer servers.

Share this post


Link to post
Share on other sites

I am having trouble with the script, I changed the marker names and added another side but it doesn't want to work. Any advice you have to just simply adding an additional side to the script.

But like I said, for some reason it just doesn't want to work. It worked fine before I edited the script with my marker names and added that third side. Everything about the Respawn Dialog is the same but this section where I entered my own markers and extra side.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//----------------------

SPWN_Start =

{

_Params = _this;

_MyDualList = [];

if (playerSide == west) then

[

_MyDualList =

[ // [Spawn description, marker name]

["1 - US Main", "m_West_Start"], // renamed to "m_West_Start"

["2 - US Mobile Spawn", "m_WestSpawn1"]

];

if (playerSide == east) then

[

_MyDualList =

[ // [Spawn description, marker name]

["1 - SLA Main", "m_East_Start"],

["2 - SLA Mobile Spawn", "m_EastSpawn1"]

];

if (playerSide == resistance) then

[

_MyDualList =

[ // [Spawn description, marker name]

["1 - RACS Main", "m_guerrila_Start"],

["2 - RACS Mobile Spawn", "m_guerrilaSpawn1"]

];

};

[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];

Share this post


Link to post
Share on other sites

You've just got your brackets all wrong. You're mixing/missing {} with []. Curley brackets are for the if-statement, square brackets for the nested array.

I haven't tested this but syntactically, it should look something like:

if (playerSide == west) then
{
 _MyDualList =
 [ // [spawn description, marker name]
  ["1 - US Main", "m_West_Start"], // renamed to "m_West_Start"
  ["2 - US Mobile Spawn", "m_WestSpawn1"]
 ];
};
if (playerSide == east) then
{
 _MyDualList =
 [ // [spawn description, marker name]
  ["1 - SLA Main", "m_East_Start"],
  ["2 - SLA Mobile Spawn", "m_EastSpawn1"]
 ];
};
if (playerSide == resistance) then
{
 _MyDualList =
 [ // [spawn description, marker name]
  ["1 - RACS Main", "m_guerrila_Start"],
  ["2 - RACS Mobile Spawn", "m_guerrilaSpawn1"]
 ];
};

Edited by Dr_Eyeball
reformat

Share this post


Link to post
Share on other sites

It worked just fine, thanks.

I came up with a problem, when testing in MP, some of the spawn points went way way off the map to the far edge. Do you know what could cause this. In Preview, it worked just fine, spawned where I should have spawned.

Also do you know how I can not show the scores after you die? And just go to the spawn menu.

-UPDATED-

It is working fine now, no more spawning all the way accross the island.

Share this post


Link to post
Share on other sites

For some reason when I die and I select where I want to spawn at, it doesn't want to accept my selection some times. Say I die once, I have to select my spawn location and hit OK twice. Once for the first time I was alive and again for the upcoming time I want to spawn in.

Then say if I die twice, I have to select where I want to spawn and hit OK three times. It is like everytime I die, that is one spawn selection and OK that I doesn't want to work.

Any thoughts?

Share this post


Link to post
Share on other sites

I'm very excited that I came across this. Brilliant work.

I'd like to modify the spawn points to be available after completion of some objectives.

Let's say the first objective results into <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">AA = true;

then could I make second spawn point available after that by using:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _MyDualList =

[ // [Spawn description, marker name]

["Home base", "m_Start"],if(AA==true) then

["2 - Balmopan", "m_WestSpawn1"]

];

Unfortunately the finesse of sqf;s just escapes me.... icon_rolleyes.gif

Share this post


Link to post
Share on other sites

VanhA,

You are better off just building up the array from scratch:

// [spawn description, marker name]
_MyDualList = [["Home base", "m_Start"]];
if(AA==true) then 
{
 _MyDualList = _MyDualList+[["2 - Balmopan", "m_WestSpawn1"]]; 
};

Offtopic - "embedded if statements" (See Suma's recent post here).

This is not correct nor tested, but just FYI, maybe you could use your suggested syntax like this: (but I"m only guessing)

_MyDualList =
[ // [spawn description, marker name]
 ["Home base", "m_Start"],
 if(AA==true) then {["2 - Balmopan", "m_WestSpawn1"]} else {["", ""]},
 if(BB==true) then {["3 - C", "m_WestSpawn2"]} else {["", ""]}
];

(except unfortunately it will have blank entries in list, unless there's a way to handle the array comma's).

Edited by Dr_Eyeball
reformat

Share this post


Link to post
Share on other sites

The first one does not work like that. I'll have to try to modify it somehow. It gives no error in editor mode but when transferred it gives an error indicating the opening syntax for that command does not comply with it somehow...

Does that Suma's version work if I only apply the first spawnpoint as entries?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _MyDualList =

[ // [Spawn description, marker name]

["Home base", "m_Start"],

if(AA==true) then {["2 - Balmopan", "m_WestSpawn1"]} else {["Home base", "m_Start"]},

if(BB==true) then {["3 - C", "m_WestSpawn2"]} else {["Home base", "m_Start"]}

];

Well, I'll try these later... I hope I'll get it functioning...trial and error wink_o.gif

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  

×