Home   Help Search Login Register  

Author Topic: MP Scripting Locality  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

Offline SafetyCatch

  • Members
  • *
  • War...it's fantastic!
MP Scripting Locality
« on: 29 Jul 2009, 00:26:31 »
Hi guys,

I've made a mission where you have to take out a Russian officer on Utes. I decided to put in a script where you can pick up intel (via addaction on object) that marks his location on the map. However, the script appears to run locally so only the person who uses the addaction can see the information given.

Here's the script:

Code: [Select]
sleep 0.5;
deletevehicle intel1;
deletevehicle intel2;
deletevehicle intel3;

sleep 2.5;

Hint "Documents found confirm meeting point. \n \nCheck map.";

_marker = createMarker ["targetmarker", position target];
_marker setMarkerShape "ICON";
"targetmarker" setMarkerType "hd_objective";
"targetmarker" setMarkerColor "ColorBlack";
"targetmarker" setMarkerText "Nikolaevich meeting point";

sleep 2.5;

targetfound = true;
tsklocatetarget setTaskState "SUCCEEDED";
[objNull, ObjNull, tsklocatetarget, "SUCCEEDED"] exec "CA\Modules\MP\data\scriptCommands\taskHint.sqf";

Both the task completion and the hint are local to the person who used the addaction, however the map marker appears for everyone.

I'm wondering if in this case I need to use the ? not isServer : exit or the ? !(local server):exit condition at the start of the script or maybe something to make the script global? As I'm not 100% sure on MP scripting any help would be great!

Thanks! :)

Safety
« Last Edit: 29 Jul 2009, 01:07:30 by SafetyCatch »

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: MP Scripting Locality
« Reply #1 on: 29 Jul 2009, 02:28:05 »
Use "CreateMarkerLocal" if you only want the marker to be seen by the player performing the action.

If you want everyone to get the effects I would just put a simple variable (which is made global by "publicVariable") in the action script that then fires a trigger that runs your script globally.

action.sqf
Code: [Select]
myVariable = true;
publicVariable "myVariable";

This action script will be recognized by all players.
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.