Jump to content
Sign in to follow this  
Thats_Life 2.0

How to create a selection menu?

Recommended Posts

Hoi,

I don't know how it's called and cannot find anything related to it. So be gentle..

At the start of the Harvest red campaign there is a selection menu to choose if you want to do a training. In the top left of your screen there is a kind of hint with the option yes and no.

How do I make something like that?

I now have some training objectives and I know that some people doesn't like them so I want them to give the option to skip them . But how...:o

Share this post


Link to post
Share on other sites

@Demonized.

I mean something like this:

http://www.youtube.com/watch?v=EK5ePUWr-8g

5.05 min.

@Neokika

Allready have that, but have sometimes some blue text, some bug I think.

Regular there appering some blue text (old conversation system) instead of white text (new conversation system). Any idea what that is? (offtopic ;))

Share this post


Link to post
Share on other sites

yeah that is not action in the conversation bits, only when player look at the guy at the skeet range before shooting shotgun, conversation is started by addAction on the guy there.

It is afaik what Neokika posted.

Question: why do you need to use this as it will be much more simpler if you just addAction to a player and he can then choose either start tutorial or skip tutorial?

Example for use:

place this line in init.sqf:

start_tutorial = false;

place a trigger in editor with condition:

start_tutorial

and in on act: what you need to start the tutorial missions:

example:

_null = [] execVM "start_extra_missions.sqf"

name the trigger, example: tutorial_trigger

create a script named tutorial_option.sqf and run it on only 1 player (team leader or something) with

tutorial=false; _null = [this] execVM "tutorial_option.sqf";

tutorial_option.sqf

_unit = _this select 0;
if (player != _unit) exitWith {};
_tut1 = _unit addAction ["Start tutorial", "tutorial.sqf",["start"]];
_tut2 = _unit addAction ["Skip tutorial", "tutorial.sqf",["skip"]];

waitUntil {tutorial};
//remove all the actions after 1 of them is selected.
{_unit removeAction _x} foreach [_tut1,_tut2];

create a script named start tutorial.sqf

// in beginning of script that starts tutorial.
_actionArr = _this select 3;
_unit = _actionArr select 1;
if (player != _unit) exitWith {};
// if skip is selected then trigger will be deleted.
if ("skip" in _actionArr) then {
  tutorial=true;
  hint "skipping tutorial";
  _delTrg = [] spawn {
     waitUntil {start_tutorial};
     deleteVehicle tutorial_trigger;
  };
} else {
  tutorial = true;

  // broadcast a variable so that a trigger can pick it up on server and start the tutorial.
  start_tutorial=true;
  publicVariable "start_tutorial";
};

Edited by Demonized
updated for MP use.

Share this post


Link to post
Share on other sites
yeah that is not action in the conversation bits, only when player look at the guy at the skeet range before shooting shotgun, conversation is started by addAction on the guy there.

It is afaik what Neokika posted.

Question: why do you need to use this as it will be much more simpler if you just addAction to a player and he can then choose either start tutorial or skip tutorial?

Example for SP use:

create a script named tutorial_option.sqf and run it on the player with

tutorial=false; _null = [this] execVM "tutorial_option.sqf";

tutorial_option.sqf

_unit = _this select 0;
_tut1 = _unit addAction ["Start tutorial", "tutorial.sqf",["start"]];
_tut2 = _unit addAction ["Skip tutorial", "tutorial.sqf",["skip"]];

waitUntil {tutorial};
//remove all the actions after 1 of them is selected.
{_unit removeAction _x} foreach [_tut1,_tut2];

create a script named start tutorial.sqf

// in beginning of script that starts tutorial.
if ("skip" in (_this select 3)) exitWith {tutorial=true; hint "skipping tutorial"};
tutorial = true;

///run codes here or activate a trigger or what ever you do to start the tutorial.
<code>

I'll try to explain. I've got a mission that's actually is a trainings mission.

I've got 3 trainings objectives and the 4th is a objective were at the place a bomb will be triggered.

I want to give the player the option to skip the 3 trainings objective, but they need to do the 4th objective, because it's part of my campaign story.

So I need something to skip the 3 objectives with this selection menu. Because it's looks nice ;)

So I can use it direct at the start of the mission. Then it skips the 3 objectives and only the last objective is visible or not cancelled or something..

And I saw theat it is only for SP. So I cannot use it for COOP (host)?

Share this post


Link to post
Share on other sites

i modified previous post, should work for MP now, as long as only 1 person gets the option. example the leader of group or something.

Share this post


Link to post
Share on other sites

Works great,

Thanks...

But you don't know how to do it like in the campaign? So with a hint box around the text and without scrolling first?

Otherwise this will do :yay:

Share this post


Link to post
Share on other sites
Works great,

Thanks...

But you don't know how to do it like in the campaign? So with a hint box around the text and without scrolling first?

Otherwise this will do :yay:

Hi,

The method your mentioning is exactly what I sent you before: New Conversation System Tutorial

:D

_neo_

Share this post


Link to post
Share on other sites

Ow really? thought it was only normal conversation text ;)

Because I use this conversation system for the story, for the storytelling.

Any idea's for a quick start to get it running?

What Demonized mentioned is also really helpfull. Going to use that deffinitly. Got it already running ;), but if I can use the otherone neokika mentioned I use that one for this and the other for other things. Just had a great idea for it...

EDIT:

Just downloaded the testmission, but it's the same way as Demonized.

---------- Post added at 02:03 PM ---------- Previous post was at 12:24 PM ----------

@Demonized

How can I change the text appering at the start.

It now shows the same name as the first option I can choose from.

Edited by Thats_Life 2.0

Share this post


Link to post
Share on other sites

_tut1 = _unit addAction ["Any TEXT heRE!!", "tutorial.sqf",["start"]];

You see line that makes the text for the option when you scroll mousebutton.

Is that what you mean?

also one more thing you may want is to use this line instead on _tut1:

_tut1 = _unit addAction ["Any TEXT heRE!!", "tutorial.sqf",["start"],0,true];

You see the ,0,true i have underlined, "0" means action will be shown at top of scroll menu and "teuw" means that once mission is started, text in the field Any TEXT heRE!! will be showed in center of screen automatically without scrolling.

Share this post


Link to post
Share on other sites
_tut1 = _unit addAction ["Any TEXT heRE!!", "tutorial.sqf",["start"]];

You see line that makes the text for the option when you scroll mousebutton.

Is that what you mean?

also one more thing you may want is to use this line instead on _tut1:

_tut1 = _unit addAction ["Any TEXT heRE!!", "tutorial.sqf",["start"],0,true];

You see the ,0,true i have underlined, "0" means action will be shown at top of scroll menu and "teuw" means that once mission is started, text in the field Any TEXT heRE!! will be showed in center of screen automatically without scrolling.

The names of the text when I scroll I changes, but can I change the text that will be showed in the center of the screen? Now it's the same as _tut1. I want that text to be different then _tut1, the text when you scroll.

And can the scroll menu already be open, instead of scrolling first? And a box around the text? Like in the campaign?

Thanks for your help, much appreciated :D

Edited by Thats_Life 2.0

Share this post


Link to post
Share on other sites
can I change the text that will be showed in the center of the screen?
no, when using true, the text showed in center screen on mission start will always be same as in text of _tut1.

Share this post


Link to post
Share on other sites
no, when using true, the text showed in center screen on mission start will always be same as in text of _tut1.

Okee thanks for the help.

I gess you don't know the rest...

But it's working great.

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  

×