Jump to content

ThomasRW

Member
  • Content Count

    6
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About ThomasRW

  • Rank
    Rookie
  1. Thanks to all of you for the help. I guess, what I tried is working know. It doesn't have full functionallity yet but should be pretty easy to expand. If you find something, I should do different, feel free to comment. (And no.. This script does not make any sense for now. It was testing only) //initPlayerLocal.sqf params ["_player", "_didJIP"]; _player addEventHandler ["TaskSetAsCurrent", { params ["_unit", "_task"]; private _taskName = taskName _task; private _taskState = taskState _task; //Set Task State global, so every Client has the same Task assigned //task 1000 is a dummy task, because I couldn't assign the TaskNull and the EventHandler did'nt triggered everytinme the task was assigned/unassigned if (_taskName != "1000" && _taskName != "DummyTask") then{ switch (_taskState) do{ case "Created": {[_taskName, "CREATED", true] call BIS_fnc_taskSetState;}; case "Assigned": {[_taskName, "CREATED", true] call BIS_fnc_taskSetState; hint format ["Task %1 is %2", _taskName, _taskName call BIS_fnc_taskState]; "1000" call BIS_fnc_taskSetCurrent;}; }; }; }];
  2. I've tried it via the 3d editor. Here is what I did: Placed a "Create Task" module and changed the following attributes Variable Name: sometask01 (never used) Owner: All playable units Task ID: 0001 State: Created Placed a "Set Task State" module State: succeeded Placed a trigger Type: None Activation: Any Player Activation Type: Present Linked "Set Task State" module to the trigger Placed new trigger (to monitor task state "created") Type: None Activation: None Condition: "0001" call BIS_fnc_taskState == "CREATED" On Activation: hint format["Task is been %1", "0001" call BIS_fnc_taskState]; On Deactivation: hint "Task is no longer CRTEATED"; Place third trigger (to monitor task state "assigned") all same but condition changed to: "0001" call BIS_fnc_taskState == "ASSIGNED" Placed the fourth trigger (to monitor task state "succeeded") again everything is the same but condition changed to: "0001" call BIS_fnc_taskState == "SUCCEEDED" The Result: Task Created: Hint with "Task is been CREATED" Task Assigned: Hint with "Task is been CREATED" (So it does not change) Task Succeeded: Hint with "Task is been SUCCEEDED" I hope, that is everaything, you need.
  3. If you use the 3d editor, you can right click the object and click on attributes (double left click on the object does the same) There should be some menu sections and somewhere should be "variable name". There you can enter the variable, you like to give the drone. This variable can be accessed basically from everywhere.
  4. Hey, never used this, but I guess, you need to place a drone with a variable name. (In the 3D editor, you can change the variable name of any object via their attributes) Then, you can execute the function. drone name: might be the variable name number of grenades: what it says For executing the function, there are many options... you can use triggers, event scripts, and endless more. (one helpful could be the window, where you can enter code, when testing a mission*) Edit: you should be able to write the code into the init of the drone too (In 3d editor, attributes of the drone). * go into the 3d editor, place your drone, set the variable name, your playable unit and click on test mission in the bottom right corner (could be named differently). When you spawned, you can press escape and type in the code.
  5. For me the script works fine. I don't really think this is what causes your problem, but magazines <unit> does not return the current loaded mag of a AI unit. So, if the AI just have the loaded mag and nothing else, you get "U2 || ", "U3 || ", ...
  6. Hey, I have one little problem with the function "BIS_fnc_taskState". My plan is, to do something, when the task a assigned. (for example activating a trigger) To do this, I created a task in 3D-Editor (state: created). According to the return value of the function above, the task is on state "CREATED" at mission start. The problem is now, when I assign the task via the tasks menue while beeing on the map, the state does not change to "ASSIGNED". Shouldn't it change to that state? When the task is completed successful, the state changes to "SUCCEEDED". Is there anything I've overlooked? thanks in advance Thomas
×