Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

AndyKrause

Member
  • Content Count

    1
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About AndyKrause

  • Rank
    Newbie
  1. Hello everyone! :D I am trying to create a multiplayer-mission that is dynamically and randomly selecting tasks from a list/array and spawning enemies there. I am using CBA Eventhandlers for creating the tasks (on the mapscreen) for every client. My problem is, if I "hardcode" the title and description for the task (test-wise) it is all working perfectly fine (so the script itself is working). My idea was to save all the Task-title, task-description etc in a global variable inside the task_test.sqf, since every client will have these missions-files and it won't be neccessary to broadcast them as a publicVariable. I save the randomly [from an array] selected task-information (location and type of task, e.g.: Search and Destroy) into the Satellite-Phone prop on the map, so that all other clients (and JIPs) can simply getVariable all the neccessary information out of the "camp_satphone_1", while plain texts and descriptions for the different task-types are already saved in their respective files, just needing to fill out placeholders for "locations" etc. Sadly, it does not seem to work with global Variables, and after trying it for days and nights I am at a point where I simply don't know what to do anymore, so I am asking you guys for help! Btw I just started scripting in ArmA a few weeks ago, the code is written 100% by myself, I understand it and it is not just copy-pasted from somewhere else. Test Task task_test.sqf /*Task Test*/ //RANDOMLY GENERATING LOCATIONS ETC UP HERE /*Creating global Variables which contain the plain text for the task-informations*/ task_test_simpleDescription = [format["Test Task briefing text, test task is at %1 (Grid %2)", _text_random_location, _grid_random_location], format["Test Task %1", _text_random_location], format["%1", _text_random_location]]; task_test_title = format["Task Test %1", _text_random_location]; /*Saving Taskinformation into Satphone*/ _task_state = "Assigned"; _task_array = [_random_location, _task_state, "task_test"]; camp_satphone_1 setVariable ["currentTask", _task_array, true]; /*Creating Task*/ ["task_create_all", [ //empty ] ] call CBA_fnc_globalEvent; Task Manager task_manager.sqf /*Task manager*/ ["task_create_all", { _task_array = camp_satphone_1 getVariable "currentTask"; _task_location = _task_array select 0; _task_pos = getPos _task_location; _task_grid = mapGridPosition _task_pos; _task_name = text _task_location; _task_state = _task_array select 1; _task_description = _task_array select 2; task_id = format["%1%2%3", _task_name, _task_grid, (round random 1000)]; _task_test_simpleDescription = str (task_test_simpleDescription); //Task task_id = player createSimpleTask [format["%1", task_id]]; task_id setSimpleTaskDescription _task_test_simpleDescription; task_id setTaskState _task_state; player setCurrentTask task_id; }] call CBA_fnc_addEventHandler; Thank you for your help already, Greetings from Germany Andy :)
×