Jump to content
Sign in to follow this  
celery

Tutorial hint?

Recommended Posts

How does one call a hint box like the ones in the official missions? For example the one at the start of the SP mission Laser Show. I checked missions_e.pbo and the Laser Show mission folder was alarmingly ascetic with no trace of scripts beyond a few lines of init.

Share this post


Link to post
Share on other sites

I think that's related to one of the BIS functions, advanced hints. Not 100% sure, I'm not at home to check.

Share this post


Link to post
Share on other sites

You can ParseText to add colors, images, alignment and make them look really good.

Share this post


Link to post
Share on other sites

	hint parseText format ["
	<t align='left' color='#e5b348' size='1.2'><t shadow='1'shadowColor='#000000'>Cargo Drop</t></t>
	<img color='#ffffff' image='BTK\Cargo Drop\Images\img_line_ca.paa' align='left' size='0.79' />
	<t align='left' color='#eaeaea' size='1.0'>You have to <t color='#fdd785'>get out</t> to load cargo!</t>
	<img color='#ffffff' image='BTK\Cargo Drop\Images\img_line_ca.paa' align='left' size='0.79' />
"];

All credits goes to BTK. :)

Share this post


Link to post
Share on other sites

I specifically mean this kind of hint, guys. How is it called or constructed without additional media?

a2_tuthint.jpg

Share this post


Link to post
Share on other sites

Yes, advanced hints. Requires Functions module.

waitUntil {!isNil "bis_fnc_init"};

[] call bis_fnc_hints;

BIS_AdvHints_THeader =  "Tacos are good";
BIS_AdvHints_TInfo =  "Go buy some tacos.";
BIS_AdvHints_TAction =  "Take money with you.";
BIS_AdvHints_TBinds = "";
BIS_AdvHints_Text = call BIS_AdvHints_formatText;
BIS_AdvHints_HideCond = "[bIS_WP_Pistols] call BIS_checkptReached";
call BIS_AdvHints_showHint;

That codes creates this:

tacos.jpg

You can find this code inside the BootCamp shared folder for Arrowhead. I only changed the text because they use stringtable identifiers.

I left BIS_AdvHints_HideCond unchanged. Not totally sure how that works, except that when you reach a spot it will hide the advanced hint :)

bis_fnc_hints must be called first to initialize. Looks like this for the curious:

scriptName "modules_e\Functions\objects\fn_hints.sqf";
/*
File: fn_hints.sqf
Author: Jiri Wainar

Description:
Advanced hint system
*/

BIS_AdvHints_Path = "ca\modules_e\functions\hints\";
_system = "fn_hints_";

call compile preprocessfilelinenumbers (BIS_AdvHints_Path + _system + "main.sqf");
call compile preprocessfilelinenumbers (BIS_AdvHints_Path + _system + "functions.sqf");
call compile preprocessfilelinenumbers (BIS_AdvHints_Path + _system + "functions_animations.sqf");
call compile preprocessfilelinenumbers (BIS_AdvHints_Path + _system + "functions_navigation.sqf");
call compile preprocessfilelinenumbers (BIS_AdvHints_Path + _system + "functions_targeticons.sqf");

bis_fnc_hints_nav_helper = BIS_AdvHints_Path + _system + "nav_helper.fsm";

if (isnil "BIS_debugMode") then {BIS_debugMode = false};
if (isnil "BIS_MissionName") then {BIS_MissionName = "MISSING MISSION NAME"};
if (isnil "BIS_Objectives") then {BIS_Objectives = ["MISSING OBJECTIVES"]};

//set defaults
[] call BIS_AdvHints_setDefaults;

Edited by AZCoder

Share this post


Link to post
Share on other sites

Oh just to be complete, here's the flashlight code. I found it in mission.fsm of TE05_Night_ops.Zargabad. I like this one because it has more options, like getKeyBind and KeyPress.

call BIS_AdvHints_setDefaults;
BIS_AdvHints_THeader = localize "STR_EP1_mission.fsmFSM_States_Flashlight0";
BIS_AdvHints_TInfo = localize "STR_EP1_mission.fsmFSM_States_Flashlight1";
BIS_AdvHints_TAction = localize "STR_EP1_mission.fsmFSM_States_Flashlight2";
BIS_AdvHints_TBinds = [
localize "STR_EP1_hunt3",
{'HeadLights' call BIS_getKeyBind}
];
BIS_AdvHints_Text = call BIS_AdvHints_formatText;
BIS_AdvHints_KeyPress = "HeadLights";
BIS_AdvHints_Spawn = [] spawn BIS_AdvHints_showHintSpawn;

As before, it requires that call bis_fnc_hints is called first. BIS simply put that in a common shared folder for all bootcamp missions.

Edited by AZCoder

Share this post


Link to post
Share on other sites

How do you make the hint that AZCoder provided go away? It stays on the screen and I don't know how to get it off.

Edit: Nervermind, I figured it out. Just change the "BIS_AdvHints_HideCond" (Hide Condition)

waitUntil {!isNil "bis_fnc_init"};

[] call bis_fnc_hints;

BIS_AdvHints_THeader = "Tacos are good";

BIS_AdvHints_TInfo = "Go buy some tacos.";

BIS_AdvHints_TAction = "Take money with you.";

BIS_AdvHints_TBinds = "";

BIS_AdvHints_Text = call BIS_AdvHints_formatText;

BIS_AdvHints_HideCond = "[bIS_WP_Pistols] call BIS_checkptReached";

call BIS_AdvHints_showHint;

Edited by Xero

Share this post


Link to post
Share on other sites

Addendum:

[] Spawn {
BIS_AdvHints_THeader = "Tacos are good.";
BIS_AdvHints_TInfo = "You should buy tacos.";
BIS_AdvHints_TAction = "Exchange legal currency for Tacos.";
BIS_AdvHints_TBinds = "";
BIS_AdvHints_Text = call BIS_AdvHints_formatText;
[color="DarkRed"]BIS_AdvHints_Duration = 5;[/color]
BIS_AdvHints_HideCode = "hintSilent '';";
call BIS_AdvHints_showHint;
};

With this code, the highlighted line obviously exits the hint after 5 seconds, displaying the little timer icon and duration bar that you see in OA missions. If you omit this line, a message is displayed at the bottom of the hintbox saying "Press Space to continue", and in so doing, you can hide the hint.

Has anyone used the HideCond thing successfully? I tried using getvariable and regular variables with it but nothing.

Share this post


Link to post
Share on other sites
Awesome, thanks AZC! :)

Is Celery gonna swap religions?? Could it be that he will become a member of the .sqf church? :p

Share this post


Link to post
Share on other sites

I quite like the one AZCoder managed to produce. Any ideas how to get it to disappear over a set time though, or even show a clock timer?

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  

×