Jump to content
Sign in to follow this  
saetheer

Strategic Map Module

Recommended Posts

Hey,

I've started with the Strategic Map module after the livestream. It was pretty easy to setup initaially and to get it work in editor.

However, I use a whiteboard with this init.

this addAction ["Open Strategic Map", "scripts\actions.sqf"];

action.sqf

openstrategicmap = true;
sleep 5;
openstrategicmap = false;

I have then an ingame trigger with only a condition: openstrategicmap

I have also synched the trigger to the Open strategic Map Module as it should. This way the module will only activate when the trigger is true.

Also in I've defined the variable in init.sqf

openstrategicmap = true;

I also have an Strategic Map Mission Module synched with it all that action

player setPos (getMarkerPos "marker")

And with all this. it works in the editor, and in multiplayer. But it only works for me and not for my buddies. While online I am the onlyone able to use the strategic map and teleport around.

I know I can use other solutions for teleporting around, but that is not the case. I wish to try out the strategic map module.

Anyone know anything? Hopefully I've remembered all the information needed.

Share this post


Link to post
Share on other sites

I am not quite sure but I think you are opening the server, right? so player is your local player, what does happen if you buddies use it? you should be teleported.

isn't the map module a game logic? I am quite new to arma scripting myself..

https://community.bistudio.com/wiki/Game_Logic

Note: In multiplayer, a game logic will always be local to the host computer, if it was placed in the mission editor. This works on both dedicated and player-hosted servers.

If a game logic is created via scripting after mission start, then the logic will be local to the client that created it.

Share this post


Link to post
Share on other sites

hm you could create it on every client via a script, that should work just fine

Will test that..

Share this post


Link to post
Share on other sites

The issue is that a non of my buddies that are connected to my server can open it at all.

Anyway, I scrapped and trying a new way. In hopes to get it to work with multiplayer.

Perhaps someone could be of help?

Using the whiteboard and init field:

this addAction ["Open Strategic Map", "scripts\osm.sqf"];

The osm.sqf script runs when it should.

I'm using the [] call BIS_fnc_strategicMapOpen and with help from the parameters in the function viewer:

Parameter(s):
	0: DISPLAY - parent display. When empty, mission display is used.
	1: ARRAY - default view position in format [x,y,y] or [x,y]
	2: ARRAY - list of missions in format:
		0: ARRAY - mission position in format [x,y,y] or [x,y]
		1: CODE - expression executed when user clicks on mission icon
		2: STRING - mission name
		3: STRING - short description
		4: STRING - name of mission's player
		5: STRING - path to overview image
		6: NUMBER - size multiplier, 1 means default size
		7: ARRAY - parameters for the -on click- code; referenced from the script as (_this select 9)
	3: ARRAY - list of ORBAT groups in format:
		0: ARRAY - group position in format [x,y,y] or [x,y]
		1: CONFIG - preview CfgORBAT group
		2: CONFIG - topmost displayed CfgORBAT group
		3: ARRAY - list of allowed tags
		4: NUMBER - maximum number of displayed tiers
	4: ARRAY - list of markers revealed in strategic map (will be hidden when map is closed)
	5: ARRAY - list of custom images in format:
		0: STRING - texture path
		1: ARRAY - color in format [R,G,B,A]
		2: ARRAY - image position
		3: NUMBER - image width (in metres)
		4: NUMBER - image height (in metres)
		5: NUMBER - image angle (in degrees)
		6: STRING - text displayed next to the image
		7: BOOL - true to display shadow
	6: NUMBER - value in range <0-1> defining weather on strategic map (i.e. density of clouds)
	7: BOOL - true for night version of strategic map (darker with blue tone)

osm.sqf


[[],[],[ [[getmarkerpos "cars"],[player setPos (getmarkerpos "cars")],["Teleport to Car Garage"],[],[],[],[],[]],[[getmarkerpos "heli"],[player setPos (getmarkerpos "heli")],["Teleport to Helipad"],[],[],[],[],[]]],[],[],[],[],FALSE] call BIS_fnc_strategicMapOpen;

For me, this should have worked, but it seems to just teleport instead of letting me choose from mission markers.

Share this post


Link to post
Share on other sites

I also tried this,

osm.sqf

// Mission arrays
_2M1 = [getmarkerpos "spawn",[],"Mainbase","Mainbase for relaxing",player,[],1,player setpos (getmarkerpos "spawn")]; // Spawn location. Marker name: spawn
_2M2 = [getmarkerpos "UGV",[],"FOB","FOB to prepare attack",player,[],1,player setpos (getmarkerpos "UGV")]; // FOB. Marker name: UGV
_2M3 = [getmarkerpos "helo4",[],"Attack Heli","Choose your tools",player,[],1,player setpos (getmarkerpos "helo4")]; // Attack heli. marker name: helo4

[[], [2129,5655],[_2M1,_2M2,_2M3],[],[],[],[0],[FALSE]] call BIS_fnc_strategicMapOpen;

This opens the map, and displays the three mission markers. However, once the map is opened, the player is teleported to the last array variable, _2M3. It also doesn't matter what mission icon I click. it wont teleport.

Hopefully some script-guru's will soon help me out here. I'm soon scripted myself beyond my skill, knowledge and are completly lost. :P

Share this post


Link to post
Share on other sites

I have the strategic map working properly. For anyone who comes here looking for this, here is how I did it:

As suggested by Saetheer, start by placing a whiteboard with

this addAction ["Open Strategic Map", "scripts\osm.sqf"];

in the init line. Then structure the osm.sqf as follows:

start_mission01 =
{
[color="#FF0000"]	<here put the code to be executed when the player selects the first mission>[/color]
};

start_mission02 =
{
[color="#FF0000"]	<here put the code to be executed when the player selects the first mission>[/color]
};

_missionsData 	= [
	[[color="#FF0000"]<Position (array) of mission 01>[/color],start_mission01,"[color="#FF0000"]<Text to Display>[/color]","[color="#FF0000"]<Description>[/color]","","[color="#FF0000"]<image>[/color]",1,[]],
	[[color="#FF0000"]<Position (array) of mission 02>[/color],start_mission02,"[color="#FF0000"]<Text to Display>[/color]","[color="#FF0000"]<Description>[/color]","","[color="#FF0000"]<image>[/color]",1,[]]
];

disableserialization;

_parentDisplay 	= [] call bis_fnc_displayMission;
_mapCenter 	= [color="#FF0000"]<position (array) to  centre the strategic map on when first opened>[/color];
_ORBAT 		= [];
_markers 	= [];
_images 	= [];
_overcast 	= overcast;
_isNight 	= !((dayTime > 6) && (dayTime < 20));
_scale		= 0.3;
_simul		= true;

[
findDisplay 46,
_mapCenter,
_missionsData,
_ORBAT,
_markers,
_images,
_overcast,
_isNight,
_scale,
_simul
] call Bis_fnc_strategicMapOpen;

changing the red stuff to meet your needs.

Here's a complete example from a recent mission of mine:

startAAA =
{
cutText ["","BLACK FADED",0,True];
player enableSimulation false;
"mrk_startAAA" setMarkerSize [1,1];
player setpos getmarkerpos "mrk_startAAA";
{_x setpos getmarkerpos "mrk_startAAA";_x enableAI "ANIM";_x switchMove ""} forEach [a2,a3,a4,a5];
a2 joinAsSilent [group player, 2];
a3 joinAsSilent [group player, 3];
a4 joinAsSilent [group player, 4];
a5 joinAsSilent [group player, 5];
group player setBehaviour "STEALTH";
player setdir 64;
var_start = true;
var_startAAA = true;
player say ["start_AAA",500];
sleep 7;	
player enableSimulation true;
cutText ["","BLACK IN",5,True];
sleep 9;
savegame;
};

startArty =
{
cutText ["","BLACK FADED",0,True];
player enableSimulation false;
"mrk_startArty" setMarkerSize [1,1];
player setpos getmarkerpos "mrk_startArty";
{_x setpos getmarkerpos "mrk_startArty";_x enableAI "ANIM";_x switchMove ""} forEach [a2,a3,a4,a5];
a2 joinAsSilent [group player, 2];
a3 joinAsSilent [group player, 3];
a4 joinAsSilent [group player, 4];
a5 joinAsSilent [group player, 5];
group player setBehaviour "STEALTH";
player setdir 124;
var_start = true;
var_startArty = true;
player say ["start_Arty",500];
sleep 7;	
player enableSimulation true;
cutText ["","BLACK IN",5,True];
sleep 13;
savegame;
};

startHelo =
{
cutText ["","BLACK FADED",0,True];
player enableSimulation false;
"mrk_startHelo" setMarkerSize [1,1];
player setpos getmarkerpos "mrk_startHelo";
{_x setpos getmarkerpos "mrk_startHelo";_x enableAI "ANIM";_x switchMove ""} forEach [a2,a3,a4,a5];
a2 joinAsSilent [group player, 2];
a3 joinAsSilent [group player, 3];
a4 joinAsSilent [group player, 4];
a5 joinAsSilent [group player, 5];
group player setBehaviour "STEALTH";
player setdir 57;
var_start = true;
var_startHelo = true;
player say ["start_Helo",500];
sleep 5;	
player enableSimulation true;
cutText ["","BLACK IN",5,True];
sleep 8;
savegame;
};

//////////////////////////////////////////

_missionsData 	= [
	[getmarkerpos "mrk_AAA",startAAA,"AAA Position","Secondary Objective: This OPFOR AAA base must be eliminated before CAS can safely be tasked to the area.","","images\img_AAA.jpg",1,[]],
	[getmarkerpos "mrk_Arty",startArty,"Artillery Emplacement","The primary objective is the destruction of the Aktinarki artillery battery.","","images\img_Arty.jpg",1,[]],
	[getmarkerpos "mrk_Helo",startHelo,"Attack Helicopter","Secondary Objective: A CSAT attack helicopter operates out of this position and represents a threat to the mission.","","images\img_Helo.jpg",1,[]]
];

//////////////////////////////////////////

disableserialization;

_parentDisplay 	= [] call bis_fnc_displayMission;
_mapCenter 	= getmarkerpos "mrk_mapCentre";
_ORBAT 		= [];
_markers 	= [];
_images 	= [];
_overcast 	= overcast;
_isNight 	= !((dayTime > 6) && (dayTime < 20));
_scale		= 0.3;
_simul		= true;


[
findDisplay 46,
_mapCenter,
_missionsData,
_ORBAT,
_markers,
_images,
_overcast,
_isNight,
_scale,
_simul
] call Bis_fnc_strategicMapOpen;

  • Thanks 1

Share this post


Link to post
Share on other sites

How do you continue the flow of a mission once you have selected and been transported to the mission start... ?

Can the player be attached to already existing waypoints and tasks added via the editor, or does this need to be done via scripting ?

Thanks ..

Smky

Share this post


Link to post
Share on other sites

Hi Guys.

Do you have a mission example to share? It will be great if you can...

Are the modules already working in multiplayer?

I mean on dedicated servers. Does anyone tested it out?

Thanks

Edited by legio4777

Share this post


Link to post
Share on other sites

Error which keeps telling me "unable to create "RSCDisplayStrategicMap"; do i have to define the display first in the description? i used the example above.

Solved by adding a sleep command at the beginning of the init;

Edited by KingoftheSandbox

Share this post


Link to post
Share on other sites

Hi there!

Thanks UbiquitousUK for a good example!

I want to add a marker to show a player's position.

_mkpl = createMarker ["MkP", position player];

_mkpl setMarkerColor "ColorCivilian";

_mkpl setMarkerType "hd_start";

"MkP" setMarkerText "You are here";

and _markers= [_mkpl] in vars.

the marker appears but without text. At the same time the text is present on the ordinary map (with writing this into init.sqf).

How to add the text corresponding to marker at the strategic map?

Share this post


Link to post
Share on other sites
_mkr= createMarkerLocal ["mkp", position player];
   _mkr setMarkerColorLocal "ColorCivilian";
   _mkr setMarkerShapeLocal "ICON";
   _mkr setMarkerTypeLocal "hd_start";
   _mkr setMarkerTextLocal "message here ";

Share this post


Link to post
Share on other sites

Anyone know how to disable the close button so the player is forced to choose a mission?

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  

×