Author Topic: Hoz Graph v.2 (ACCEPTED)  (Read 1146 times)

0 Members and 1 Guest are viewing this topic.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Hoz Graph v.2 (ACCEPTED)
« on: 22 Jan 2009, 06:37:10 »
Here is my simple bar graph. You can configure it to move at the speed you wish.

Hoz Graph v.2

Simple non intrusive graph dialog.

Configure the options in the line that goes into the init.sqf.
   Hoz_Graph_Options = [20, true];
   Hoz_Graph_Options = [LengthOfTime, ShowTextCounter];
If you set ShowTextCounter to false then you may need to adjust the dialog height as it will be off a couple of pixels.

Copy the hoz_grapher folder into your mission.
Copy the line from the description.ext file into your description.ext file.
Add these two lines to the init.sqf:
   Hoz_Graph_Options = [20, true];
   hoz_graph = compile preprocessFileLineNumbers "hoz_graph\hoz_graph.sqf";
Configure the options.
When you want the dialog to display. Use this command.
   TitleRsc ["HOZ_GRAPH", "PLAIN",0]; when you want the dialog to display.
Note: Once the graph progression begins HOZ_GRAPH_ENABLED becomes true until the graph is fully completed then it becomes false.
You can use this variable to trigger other events.

Demo Mission:
The included mission demonstrates how to add the progression graph to an addaction script. Once the player executes the
action the graph starts to count down from 20 seconds and progresses until completed.

« Last Edit: 06 Feb 2009, 16:43:52 by hoz »
Xbox Rocks

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Hoz Graph v.2
« Reply #1 on: 22 Jan 2009, 07:58:01 »
Some suggestions:
* Although you can use a trigger to work out when the window is closed (condition: time > 0 and !HOZ_GRAPH_ENABLED), allow the player to pass an optional call-back function to the script which will be called when the time runs out, e.g.:
Code: [Select]
Hoz_Graph_Options = [20, true, { hint "Timeout!"; [] exec "timeRanOut.sqs" }];
* If "time" is set to 0, don't run the timer. Instead allow the mission-maker to move the graph manually. Then later the player can call a script or function to manually change the progress:
Code: [Select]
TitleTxt ["", "PLAIN"]; // Would be used to close the overlay in this case.
* If the mission goes through midnight, then the elapsed time would be wrong. Would be nice to account for that special case (or, at least, tell the mission maker that the script is not compatible in that circumstance).

Regardless, a nice little feature that doesn't really need my suggested improvements, but you know me...
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)