Notification - jak tego uzyc

Edytor Arma3 - dyskusje i zapytania o tworzeniu misji, skryptów oraz programowaniu.

Moderator: Inkwizytor

ODPOWIEDZ
-xSw-
Posty: 21
Rejestracja: 14 marca 2013, 03:17
ID Steam:
ID gracza: 0
Lokalizacja: Manchester

Notification - jak tego uzyc

Post autor: -xSw- »

Witam, Juz ogarnelem odprawe i zadania. Lecz dalej mi to nie wystarcza. W jaki sposob osiagnac wyskakujace okienko po wykonaniu zadania tak jak przedstawia to link ponizej oraz jak to zastosowac. Wole pisac recznie jak uzywac generatorow.

http://community.bistudio.com/wiki/Notification
  • Case: Fractal Design Define XL Black Pearl V2
  • Mobo: Asus Rampage IV Extreme
  • CPU: Intel Core i7-3930K
  • RAM: Corsair Dominator Platinium
  • GPU: EVGA GTX 680 Classfied
  • PSU: Corsair AX1200i Digital ATX
[/b]
Awatar użytkownika
kondor
Posty: 1522
Rejestracja: 13 marca 2007, 11:50
ID Steam: Przemek_kondor
Kontakt:

Re: Notification - jak tego uzyc

Post autor: kondor »

Nie robiłem tego, ale wygląda chyba kroki są następujące:
1. w description.ext (jeśli nie masz takiego pliku w katalogu misji, to go stwórz) umieść "class CfgNotifications" jak napisano na stronie, którą podałeś
2. dodaj / zmień własne klasy wewnątrz CfgNotifications, np.:

Kod: Zaznacz cały

class CfgNotifications
{
	class Default
	{
		title = ""; // Tile displayed as text on black background. Filled by arguments.
		iconPicture = ""; // Small icon displayed in left part. Colored by "color", filled by arguments.
		iconText = ""; // Short text displayed over the icon. Colored by "color", filled by arguments.
		description = ""; // Brief description displayed as structured text. Colored by "color", filled by arguments.
		color[] = {1,1,1,1}; // Icon and text color
		duration = 5; // How many seconds will the notification be displayed
		priority = 0; // Priority; higher number = more important; tasks in queue are selected by priority
		difficulty[] = {}; // Required difficulty settings. All listed difficulties has to be enabled
	};
 
	// Twoje klasy
	class ZadanieWykonane
	{
		title = "Zadanie wykonane!";
		iconPicture = "\A3\ui_f\data\map\mapcontrol\taskIcon_ca.paa";
		description = "%1";
		color[] = {0.5,1,1,1};
		priority = 7;
	};

	class ZadanieNiewykonane
	{
		...
	};
};
3. Żeby wywołać tę notyfikację, wołasz

Kod: Zaznacz cały

["ZadanieWykonane", ["Wzgórze zostało zdobyte"]] call bis_fnc_showNotification;
-xSw-
Posty: 21
Rejestracja: 14 marca 2013, 03:17
ID Steam:
ID gracza: 0
Lokalizacja: Manchester

Re: Notification - jak tego uzyc

Post autor: -xSw- »

["TaskSucceeded",["Disable the nuke"]] call bis_fnc_showNotification;
["ScoreAdded",["Disabled the nuke without triggering an alarm.",5]] call bis_fnc_showNotification;

te komendy wbija sie w briefing czy w wyzwalacze, description, init czy config.cpp?

Misja pod mp

Przykladowe:

Descrition:
author = "2can"; // Autor
onLoadName = "xxx"; // Nazwa Misji
onLoadMission = "Przejmij kontrole nad wyspa. Przygotuj sie na duza sile ognia i liczebnosc wojsk. Powodzenia zolnierzu."; // Opis pod obrazkiem podczas ladowania
loadScreen = "2cangraph.paa"; // obrazek podczas ladowania
class Header
{
gameType = Coop; // Rodzaj gry
minPlayers = 1; // min. Graczy
maxPlayers = 16; // max. Graczy
};



//respawn = "base"; //
//respawndelay = "60"; //czas mierzony w sekundach

class CfgNotifications
{
class Default
{
title = ""; // Tile displayed as text on black background. Filled by arguments.
iconPicture = ""; // Small icon displayed in left part. Colored by "color", filled by arguments.
iconText = ""; // Short text displayed over the icon. Colored by "color", filled by arguments.
description = ""; // Brief description displayed as structured text. Colored by "color", filled by arguments.
color[] = {1,1,1,1}; // Icon and text color
duration = 5; // How many seconds will the notification be displayed
priority = 0; // Priority; higher number = more important; tasks in queue are selected by priority
difficulty[] = {}; // Required difficulty settings. All listed difficulties has to be enabled
};
class TaskSucceeded
{
title = "Zadanie Wykonane";
iconPicture = "\A3\ui_f\data\map\MapControl\taskicondone_ca.paa";
description = "%2";
priority = 7;
};
class TaskFailed
{
title = "%1";
iconPicture = "\A3\ui_f\data\map\MapControl\taskiconfailed_ca.paa";
description = "%2";
priority = 6;
};
class TaskCanceled
{
title = "%1";
iconPicture = "\A3\ui_f\data\map\MapControl\taskiconcanceled_ca.paa";
description = "%2";
priority = 5;
};
class TaskAssigned
{
title = "%1";
iconPicture = "\A3\ui_f\data\map\MapControl\taskiconcreated_ca.paa";
description = "%2";
duration = 7;
priority = 4;
};
};
Briefing:
waitUntil { !isNil {player} };
waitUntil { player == player };

switch (side player) do
{

case WEST: // BLUFOR briefing goes here
{
player createDiaryRecord["Diary", ["Sytuacja", "Brak danych<br/>Brak Danych<br/>Brak Danych<br/>Yes it totally is!"]];
player createDiaryRecord["Diary", ["Wsparcie", "brak danych"]];
player createDiaryRecord["Diary", ["FragMatch", "brak danych"]];
player createDiaryRecord["Diary", ["Wersja", "v.0.1"]];

//Task1
task_1 = player createSimpleTask ["Przejmij Camp Rogian"];
task_1 setSimpleTaskDescription ["Przejmij kontrole nad <marker name='camp_rogain'>Camp Rogain</marker>","Przejmij Camp Rogain","Przejmij Camp Rogain"];
task_1 setTaskState "Assigned";
player setCurrentTask task_1;





};


case EAST: // OPFOR briefing goes here
{
};


case RESISTANCE: // RESISTANCE/INDEPENDENT briefing goes here
{
};


case CIVILIAN: // CIVILIAN briefing goes here
{
};
};
  • Case: Fractal Design Define XL Black Pearl V2
  • Mobo: Asus Rampage IV Extreme
  • CPU: Intel Core i7-3930K
  • RAM: Corsair Dominator Platinium
  • GPU: EVGA GTX 680 Classfied
  • PSU: Corsair AX1200i Digital ATX
[/b]
Awatar użytkownika
kondor
Posty: 1522
Rejestracja: 13 marca 2007, 11:50
ID Steam: Przemek_kondor
Kontakt:

Re: Notification - jak tego uzyc

Post autor: kondor »

W wyzwalaczu
-xSw-
Posty: 21
Rejestracja: 14 marca 2013, 03:17
ID Steam:
ID gracza: 0
Lokalizacja: Manchester

Re: Notification - jak tego uzyc

Post autor: -xSw- »

Dziala. Dzieki. Podrasuje to i wrzuca na serwa. Zobacze czy po respawnie nie znikaja jak poprzednio robione w edytorze przez moduly.
  • Case: Fractal Design Define XL Black Pearl V2
  • Mobo: Asus Rampage IV Extreme
  • CPU: Intel Core i7-3930K
  • RAM: Corsair Dominator Platinium
  • GPU: EVGA GTX 680 Classfied
  • PSU: Corsair AX1200i Digital ATX
[/b]
-xSw-
Posty: 21
Rejestracja: 14 marca 2013, 03:17
ID Steam:
ID gracza: 0
Lokalizacja: Manchester

Re: Notification - jak tego uzyc

Post autor: -xSw- »

Ale brakuje tego zielonego tekstu; "Zadanie Wykonane"
};
class TaskSucceeded
{
title = "Zadanie Wykonane";
iconPicture = "\A3\ui_f\data\map\MapControl\taskicondone_ca.paa";
description = "Zadanie wykonane";
priority = 7;
Obrazek
Obrazek
  • Case: Fractal Design Define XL Black Pearl V2
  • Mobo: Asus Rampage IV Extreme
  • CPU: Intel Core i7-3930K
  • RAM: Corsair Dominator Platinium
  • GPU: EVGA GTX 680 Classfied
  • PSU: Corsair AX1200i Digital ATX
[/b]
Awatar użytkownika
kondor
Posty: 1522
Rejestracja: 13 marca 2007, 11:50
ID Steam: Przemek_kondor
Kontakt:

Re: Notification - jak tego uzyc

Post autor: kondor »

Żeby misja odświeżyła sobie zawartość description.ext trzeba załadować misję jeszcze raz (ten problem nie występuje z plikami .sqf/.sqs)
-xSw-
Posty: 21
Rejestracja: 14 marca 2013, 03:17
ID Steam:
ID gracza: 0
Lokalizacja: Manchester

Re: Notification - jak tego uzyc

Post autor: -xSw- »

Kolejny raz masz racje :)
  • Case: Fractal Design Define XL Black Pearl V2
  • Mobo: Asus Rampage IV Extreme
  • CPU: Intel Core i7-3930K
  • RAM: Corsair Dominator Platinium
  • GPU: EVGA GTX 680 Classfied
  • PSU: Corsair AX1200i Digital ATX
[/b]
ODPOWIEDZ

Wróć do „Edycja - tworzenie misji, skrypty oraz programowanie”