Arma 3
event handlers are not working
please read if you can help, it looks like alot but is not that much for you to read through, its laid out well. anyways, when i just ran whats in the eventhandlers.sqf in my init.sqf it worked fine, however with how i have my stuff setup its best to be run in a seperate file later on when i choose(as shown below) but its not working and i cant figure out why, i have this as my scripts.

init.sqf execVM "startgameoptions.sqf"; startgameoptions.sqf night = { removeAllActions gameoptions; dayornight = "Night"; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS SET -------------------------- %1 Points to win -------------------------- Custom weapons %2 -------------------------- %3 time selected</t>", game_end, customweapons, dayornight]; ["TaskAssigned",["gamesettingsset"]] call bis_fnc_showNotification; sleep 2; {_x setDamage 1}forEach allUnits; setDate [2016, 5, 6, 24, 0]; execVM "eventhandlers.sqf"; }; day = { removeAllActions gameoptions; dayornight = "day"; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS SET -------------------------- %1 Points to win -------------------------- Custom weapons %2 -------------------------- %3 time selected</t>", game_end, customweapons, dayornight]; ["TaskAssigned",["gamesettingsset"]] call bis_fnc_showNotification; sleep 2; {_x setDamage 1}forEach allUnits; setDate [2016, 5, 6, 12, 0]; execVM "eventhandlers.sqf"; }; eventhandlers.sqf if (isServer || isDedicated) then { { if (side _x == EAST) then { _x addMpEventHandler ["MpKilled",{usmc_kills = usmc_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; _x addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Marines", (_this select 0 select 1), (_this select 0 select 0)]; usmc_kills = usmc_kills + 1}}]; hint "event handlers east loaded"; } else { _x addMpEventHandler ["MpKilled",{tali_kills = tali_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; _x addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Taliban", (_this select 0 select 1), (_this select 0 select 0)]; tali_kills = tali_kills + 1}}]; hint "event handlers west loaded"; }; } forEach AllUnits; };

i found out whats causing the issue, however im not sure how to fix it.

if (isServer || isDedicated) then { { THIS OPENING BRACKET if (side _x == EAST) then { _x addMpEventHandler ["MpKilled",{usmc_kills = usmc_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; _x addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Marines", (_this select 0 select 1), (_this select 0 select 0)]; usmc_kills = usmc_kills + 1}}]; hint "event handlers east loaded"; } else { _x addMpEventHandler ["MpKilled",{tali_kills = tali_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; _x addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Taliban", (_this select 0 select 1), (_this select 0 select 0)]; tali_kills = tali_kills + 1}}]; hint "event handlers west loaded"; }; } THIS CLOSING BRACKET forEach AllUnits; };

i managed to fix it one way by doing this instead but im not sure if it will work in multiplayer with friends. the script is getting exicuted on every pc so i think it will be fine? this keeps the hints for the scoring up as well as adds +1 to each side whenever a side gets a kill
if (isServer || isDedicated) then { if (side player == EAST) then { player addMpEventHandler ["MpKilled",{usmc_kills = usmc_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; player addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Marines", (_this select 0 select 1), (_this select 0 select 0)]; usmc_kills = usmc_kills + 1}}]; hint "event handlers east loaded"; } else { player addMpEventHandler ["MpKilled",{tali_kills = tali_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; player addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Taliban", (_this select 0 select 1), (_this select 0 select 0)]; tali_kills = tali_kills + 1}}]; hint "event handlers west loaded"; } forEach AllUnits; };
Last edited by IM SORRY BUFFALO; May 11, 2016 @ 11:20pm
< >
Showing 1-15 of 20 comments
Muzzleflash May 12, 2016 @ 8:48am 
Are you playing with ACE? Many event handlers are unusable if you play with ACE.
IM SORRY BUFFALO May 12, 2016 @ 11:16am 
Originally posted by Muzzleflash:
Are you playing with ACE? Many event handlers are unusable if you play with ACE.
nope, just nato russian weapons, cba_a3, middle eastern warfare, USMC_MAS and Em_buildings. none of which should cause any issues. i just dont understand how that is causing a problem
MrMessy187 May 12, 2016 @ 3:59pm 
Hey,

Well, i'm not expert (only scripting arma 6 weeks) BUT i see many problems with each of your code segments.. looks to me like you have taken some code and tried to alter it without understanding syntax or what each line of code actually does.. that said i could be wrong lol..

anyhow.. heres what i see..

init.sqf is calling "startgameoptions.sqf";

"startgameoptions.sqf"; does some stuff but what stands out to me is that the script sets damage 1 to all units (kills them) everytime a player connects and init.sqf runs..

at the bottom of this script it calls "eventhandlers.sqf"
each client calls this script BUT the script is only actually executed on the server..

once the server runs it, it doesnt do anything or shouldnt as TO ME the syntax of the code inside "eventhandlers.sqf" is wrong.. the event handler code maybe correct who knows..
but because its only running on the server.. the var player doesnt exist, your looping allunits
but adding the eventhandler to player which doesnt exist on the server..

i have rewrote the "eventhandlers.sqf" code BUT barring the above problems as to the way the scripts are called.. i cant see why you want to add the eventhandler to dead units anyway.. (they are added after they died so no score is added)

it needs rewriting from scratch really calling the scripts from the server for none human players and local on each clients machine to add the eventhandlers.. more thought needed about implimentation.. :)

here is how i think the "eventhandlers.sqf" should be.. (although it will never work as said above)

if (isServer) then { { if (!isNil "_x" && (alive _x)) then { if (side _x == east) then { _x addMpEventHandler ["MpKilled",{usmc_kills = usmc_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; _x addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Marines", (_this select 0 select 1), (_this select 0 select 0)]; usmc_kills = usmc_kills + 1}}]; //hint "event handlers east loaded"; // will not work as server is running this code you will never see the hint. } else { _x addMpEventHandler ["MpKilled",{tali_kills = tali_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; _x addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Taliban", (_this select 0 select 1), (_this select 0 select 0)]; tali_kills = tali_kills + 1}}]; //hint "event handlers west loaded"; // will not work as server is running this code you will never see the hint. }; }; } forEach AllUnits; };

proper ghetto, it all needs rethinking pal.. i pasted the above just to show syntax of a foreach loop.

i do not mean to offend, just saying what i see, like i say im no expert and if im wrong
i will also learn something here today :)

Domino.

Last edited by MrMessy187; May 12, 2016 @ 4:06pm
IM SORRY BUFFALO May 12, 2016 @ 4:19pm 
Originally posted by Domino:
i cant see why you want to add the eventhandler to dead units anyway.. (they are added after they died so no score is added)

thank you. while im looking over everything youve written ill explain why a few things are like they are. first thing answering what ive quoted.

its set to run after it kills all the players because thats what starts the game, in the begining before that right as the mission is loaded and players are ingame they spawn in a small building where they cant move, only the group leaders of opfor/blufor are outside and are able to walk upto the Ai player that i have added a bunch of addActions to. what that does is i use him to set the game settings, such as score to win, weapon choosing allowed or not allowed, and to play at day or night time. each setting gets displayed in a hint everytime a option is selected(ill display screenshots at the bottem) and then once all the options are selected it kills all the players and they respawn to their base/spawn points and the game starts. ill show all the code that i have(its ugly)

init.sqf
player enableFatigue false; player allowDamage false; enableradio false; enablesentences false; game_end = 0; usmc_kills = 0; tali_kills = 0; dayornight = ""; customweapons = ""; execVM "startgameoptions.sqf"; sleep 0.7; "Setting Game Options" hintC ["Let the leaders of the USMC and Taliban set the options for the game", "Walk up to the dude at the stand thingy to set the game options", "Score limit", "Day/Night time"];

startgameoptions.sqf (this only displays the hints to the player who chooses each option and runs the event handlers, pretty much it only works for whoever selects any options)
setscore = { hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS ---------------------------- </t>"" NEXT: Select points needed to win:10 25 40 65"]; gameoptions addAction ["10 Points", ten]; gameoptions addAction ["25 Points", twofive]; gameoptions addAction ["40 Points", forty]; gameoptions addAction ["65 Points", sixfive]; }; daynight = { gameoptions addAction ["Day", day]; gameoptions addAction ["Night", night]; }; chooseweps = { gameoptions addAction ["Allowed", cwyes]; gameoptions addAction ["Not allowed", cwno]; }; cwyes = { removeAllActions gameoptions; customweapons = "allowed"; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS -------------------------- %1 Points to win -------------------------- Custom weapons %2 --------------------------</t>"" NEXT: Select to play during the day or night", game_end, customweapons]; call daynight; }; cwno = { removeAllActions gameoptions; customweapons = "not allowed"; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS -------------------------- %1 Points to win -------------------------- Custom weapons %2 --------------------------</t>"" NEXT: Select to play during the day or night", game_end, customweapons]; call daynight; }; night = { removeAllActions gameoptions; dayornight = "Night"; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS SET -------------------------- %1 Points to win -------------------------- Custom weapons %2 -------------------------- %3 time selected</t>", game_end, customweapons, dayornight]; ["TaskAssigned",["gamesettingsset"]] call bis_fnc_showNotification; sleep 10; {_x setDamage 1}forEach allUnits; setDate [2016, 5, 6, 24, 0]; execVM "eventhandlers.sqf"; sleep 5; if (customweapons == "allowed") then { hintSilent parseText format ["<t size='1.5' color='#CDFF00'> Custom weapons allowed you can choose your weapons once every spawn by using your scroll wheel</t>"]; sleep 10; execVM "score.sqf"; }; }; day = { removeAllActions gameoptions; dayornight = "day"; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS SET -------------------------- %1 Points to win -------------------------- Custom weapons %2 -------------------------- %3 time selected</t>", game_end, customweapons, dayornight]; ["TaskAssigned",["gamesettingsset"]] call bis_fnc_showNotification; sleep 10; {_x setDamage 1}forEach allUnits; setDate [2016, 5, 6, 12, 0]; execVM "eventhandlers.sqf"; sleep 5; if (customweapons == "allowed") then { hintSilent parseText format ["<t size='1.5' color='#CDFF00'> Custom weapons allowed you can choose your weapons once every spawn by using your scroll wheel</t>"]; sleep 10; execVM "score.sqf"; }; }; ten = { removeAllActions gameoptions; game_end = 1; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS -------------------------- %1 Points to win --------------------------</t>"" NEXT: Select custom weapons allowed/not allowed", game_end]; call chooseweps; }; twofive = { removeAllActions gameoptions; game_end = 2; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS -------------------------- %1 Points to win --------------------------</t>"" NEXT: Select custom weapons allowed/not allowed", game_end]; call chooseweps; }; forty = { removeAllActions gameoptions; game_end = 3; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS -------------------------- %1 Points to win --------------------------</t>"" NEXT: Select custom weapons allowed/not allowed", game_end]; call chooseweps; }; sixfive = { removeAllActions gameoptions; game_end = 65; hintSilent parseText format["<t size='2.0' color='#009419'> GAME SETTINGS -------------------------- %1 Points to win --------------------------</t>"" NEXT: Select custom weapons allowed/not allowed", game_end]; call chooseweps; }; call setscore;
eventhandlers.sqf
if (isServer || isDedicated) then { if (side player == EAST) then { player addMpEventHandler ["MpKilled",{usmc_kills = usmc_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; player addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Marines", (_this select 0 select 1), (_this select 0 select 0)]; usmc_kills = usmc_kills + 1}}]; hint "event handlers east loaded"; } else { player addMpEventHandler ["MpKilled",{tali_kills = tali_kills + 1; execVM "score.sqf"; execVM "gameend.sqf"}]; player addEventHandler ["hitpart", {if ("head" in (_this select 0 select 5)) then {systemChat format["%1 HIT %2 IN THE HEAD, +1 POINT Taliban", (_this select 0 select 1), (_this select 0 select 0)]; tali_kills = tali_kills + 1}}]; hint "event handlers west loaded"; } forEach AllUnits; };

gameend.sqf
if (usmc_kills >= game_end) then { { if (side _x == EAST) then { _x removeAllMpEventHandlers "MpKilled"; _x removeAllEventHandlers "hitpart"; } else { _x removeAllMpEventHandlers "MpKilled"; _x removeAllEventHandlers "hitpart"; }; } forEach AllUnits; hintSilent parseText format["<t size='2.0' color='#002BFF'>Marines win with a score of %1. Taliban loses with a score of %2</t>", usmc_kills, tali_kills]; sleep 3; player allowDamage false; splodee = "M_Mo_82mm_AT_LG" createVehicle (getPos b1); }; if (tali_kills >= game_end) then { { if (side _x == EAST) then { _x removeAllEventHandlers "MpKilled"; _x removeAllEventHandlers "hitpart"; } else { _x removeAllEventHandlers "MpKilled"; _x removeAllEventHandlers "hitpart"; }; } forEach AllUnits; hintSilent parseText format["<t size='2.0' color='#002BFF'>Taliban wins with a score of %1. Marines lose with a score of %2</t>", tali_kills, usmc_kills]; sleep 3; player allowDamage false; splodee = "M_Mo_82mm_AT_LG" createVehicle (getPos b1); };
MrMessy187 May 12, 2016 @ 5:50pm 
hey,

i can see you have put some work into this.. however i think you need to learn some fundermentals about how the server/client information is sent and received by both
to keep server + clients in sync with each other.

hmmm, i cant see any interaction with the server from the client, so as far as i understand it, every option a player chooses is actually local to there client, it doesnt get updated to the server.. if it isnt updated to the server it also isnt updated on each players client (game) as its local to that client changing the option via the action menu value..

what will happen (if it works) is this..

player 1 will kill 3 so you would think global kills is 3 for everyone on the server.. but its not..
its actually only 3 for player 1, everyone else is still on zero.. (or the amount that each player has killed, they will all have different scores i think)

when a player kills an enemy you need to send that information to the server and THEN server updates the kills var globally for each player.. using publicvariable, you send the kill information from the client (player) using publicvariableserver to send it to the server from the client. There is actually a little bit more to it, that is just those two tit bits of info.. regarding info to server and vise versa.

you just have to think of each player as a seperate entity to the server, the server sends some info to the client, like waypoints, triggers, markers, server spawned units etc, if there is any info you need to send to each client, you have to manually send it to the server and then the server sends it to everyone else..you also have to tell the server to send it to everyone aswell, its not that difficult once you understand the server/client relationship pal..

regards your lil game mode, i would break it down from the top, prolly cough "most" of your code is re-usable when put into correct syntax and called at the correct place when placed in readable functions..

so you say squad leaders have free roam to set options for the game and everyone else spawns in a building not able to move until the game is started..

i would first get this working correctly.. break it down, have an sqf file that is only run on the server only server code in this file, this is run first, then have another sqf that only runs on the client.

learn this.. its the server setting a global var on all clients.

on the server set these vars vUpdateMission_Score = 0; publicVariable "vUpdateMission_Score"; just execute this on the client machines "vUpdateMission_Score" addPublicVariableEventHandler { systemChat str vUpdateMission_Score; };

each time vUpdateMission_Score is changed if you use publicVariable "vUpdateMission_Score"; it will update all clients with the new value.

you can use publicVariableServer "vUpdateMission_Score"; to send the value from the client
to the server..

once you start learning and looking at how ti works, no doubt you will know what you have to do.. :)

from

"vUpdateMission_Score" addPublicVariableEventHandler {
systemChat str vUpdateMission_Score;
};

i call a function and use isserver do this else client do this.. :)

hope i helped pal..

Domino

IM SORRY BUFFALO May 12, 2016 @ 5:59pm 
Originally posted by Domino:
hey,

i can see you have put some work into this.. however i think you need to learn some fundermentals about how the server/client information is sent and received by both
to keep server + clients in sync with each other.
thank you very much for your post, i have a hard time figuring out how to send/recieve stuff from clients to the server but ive also never really done it before or thought much about it. your post has helped(quite alot actually) me get into the thinking of how it should work but now i just need to figure out how i would write it. all these missions im doing is just for learning to get into the logic of how to do everything properly. thank you sir, i will be looking up some tutorials and examples of this. quick question, this would be the same concept since im running my missions off of my pc so it should be the same right? also any tutorials you recommend? im bookmarking a few to start learning tomorow
Last edited by IM SORRY BUFFALO; May 12, 2016 @ 6:17pm
MrMessy187 May 13, 2016 @ 5:27am 
hey,

well what i do is run a dedicated server as well as my client on the same machine.. to test multiplayer stuff, i find that running the game from the editor in mp gives me unpredictable results to what i was expecting. only sure way to test multiplayer scripts is to export the mission and start it on the dedicated server.. then connect and test..

i havent really read or seen many tutorials, google is my friend :)
what i did in the first month is extract missions that i liked playing
to see the code, id see something i liked and follow the functions through the code to see how it works etc, this way i start to reconise and remember function names and how they are used.
most importantly it taught me structure and how the server/client stuff works.. i still do not fully understand it but i now know enough to get myself by. :)

i am also really doing the same as you, writing bits and peices here and there to learn it better. :)

Domino
MrMessy187 May 13, 2016 @ 4:38pm 
Hey,

seeing as you showed me your mission, i thought i would return the favour and show you what i am working on, i still have a hell of a long way to go yet its very much early WIP..

{LINK REMOVED}

what is it: its framework for modular random mission generation, basically it will create X amount of user defined missions at random towns/cities across the map. you will be able to add it to existing missions easy to run along side said mission.

it is made to be modular so any missions an admin adds are self contained to a specific folder, missions can be anything you want.. i dont know if i will release a version with my missions but i will put the framework up somewhere when its complete.

im trying to make it as simple as possible to create a mission, so i have been adding lots of functions to make it easy to do things like.. spawn enemy infantry in a mission area and give them patrols, add simple secondry missions to the main mission, helo evacs, basically create what ever is needed for the mission..

ive added simple options so you can blacklist towns or use favourite towns or just use towns you specify, admins will also have the option to create a specifc mission in a specific town OR just quit/remove a mission.

99% of the code is on the server with very little being client side.. i think i send a little to much info to clients which i am going to slim down a little but its nothing really.. i say that because its mostly for JIP players. (join in progress).

the server starts the missions and it will auto clean up all markers, triggers, units everything when the misison ends or is removed.

IF YOU GOT THIS FAR DOWN IM KINDA IMPRESSED :)

i guess you want to know how it all works..

well first take a look in the folder

\random_missions\mission_defines\core_mission_types.sqf

this is where mission makers define there missions, the server will randomly pick one of these vUserMissionTypes and create the mission in a random town. town markers are auto generated when the server starts, you do not have to define them, you can however add your own markers to the map and add the marker names to an array and those positions will also be used to generate a random mission also..

so once you define what missions can be used you set up another simple array in

\random_missions\mission_defines\core_missions.sqf

in there you just have to add some simple information about the mission (1 IF statement and a simple array for each mission type specified above, this array also contains the sqf path that starts the mission but also the sqf file path that ends the mission when its complete or is cancelled/removed.

thats it, (nearly) :D

all you have to do then is create the mission in code in the specified file above that starts the mission. the server monitors the task state of each mission and acts accordling like if the mission task state is set to cancelled it will inform all players it was cancelled and clean up the mission (remove all markers, triggers, units anything that is related to that mission, same for completed etc. the server maintains the mission count so say you set the option to have 5 missions, the server will start 5 different random missions in 5 different towns, once a mission is completed/removed the server will start a new random mission in a new random town.
a mission town will NOT be used twice (unless specified in favourite towns) so each town is used in a random sequence.

like i say its very early wip ( 5 weeks into coding from start) BUT the fundermentals are there its all working in mp/dedicated and single player, i keep changing what im working on daily (which is a bad thing to do) like this morning i was hammering out the assets but then earlier this evening i was told how i could get arrays of compositions from the eden editor, so i played with that in debug_functions.sqf, those 2 composition functions are VERY MUCH needed for this type of addon/mod means i can create templates of enemy bases and spawn them in on the fly or remove them.. very excited about that.. :)

anyway.. i posted this WIP so you can see my coding and "maybe" learn something from it
to help with your mission :)

there is tons of other usefull stuff in it, but im going from memory and not looking at my doc's hehe.. suffice to say when its complete myself and the players on my dedi think it will be something specail.. just hope i can pull it off and its everything i expect it to be.

:)

Give it a try and look at the coding, its not perfect but it will bet better over the coming weeks/months :)

apologies for wall of text.

Domino..
Last edited by MrMessy187; May 13, 2016 @ 5:09pm
IM SORRY BUFFALO May 13, 2016 @ 5:06pm 
Originally posted by Domino:
Hey,

seeing as you showed me your mission, i thought i would return the favour and show you what i am working on, i still have a hell of a long way to go yet its very much early WIP..

download link [http//%3D+http]

what is it: its framework for modular random mission generation, basically it will create X amount of user defined missions at random towns/cities across the map. you will be able to add it to existing missions easy to run along side said mission.

it is made to be modular so any missions an admin adds are self contained to a specific folder, missions can be anything you want.. i dont know if i will release a version with my missions but i will put the framework up somewhere when its complete.

im trying to make it as simple as possible to create a mission, so i have been adding lots of functions to make it easy to do things like.. spawn enemy infantry in a mission area and give them patrols, add simple secondry missions to the main mission, helo evacs, basically create what ever is needed for the mission..

ive added simple options so you can blacklist towns or use favourite towns or just use towns
you specify, admins will also have the option to create a specifc mission in a specific town OR just quit/remove a mission.

99% of the code is on the server with very little being client side.. i think i send a little to much info to clients which i am going to slim down a little but its nothing really.. i say that because its mostly for JIP players. (join in progress).

the server starts the missions and it will auto clean up all markers, triggers, units everything when the misison ends or is removed.

IF YOU GOT THIS FAR DOWN IM KINDA IMPRESSED :)

i guess you want to know how it all works..

well first take a look in the folder

\random_missions\mission_defines\core_mission_types.sqf

this where mission makers define there missions, the server will randomly pick one of these
vUserMissionTypes and create the mission in a random town. town markers are auto generated when the server starts, you do not have to define them, you can however add your own markers to the map and add the marker names to an array and those positions will also be used to generate a random mission also..

so once you define what missions can be used you set up another simple array in

\random_missions\mission_defines\core_missions.sqf

in there you just have to add some simple information about the mission (1 IF statement and a simple array for each mission type specified above, this array also contains the sqf path that starts the mission but also the sqf file path that ends the mission when its complete or is cancelled/removed.

thats it,

all you have to do then is create the mission in code in the specified file above that starts the mission. the server monitors the task state of each mission and acts accordling like if the mission task state is set to cancelled it will inform all players it was cancelled and clean up the mission (remove all markers, triggers, units anything that is related to that mission, same for completed etc. the server maintains the mission count so say you set the option to have 5 missions, the server will start 5 different random missions in 5 different towns, once a mission is completed/removed the server will start a new random mission in a new random town.
a mission town will NOT be used twice (unless specified in favourite towns) so each town is used in a random sequence.

like i say its very early wip ( 5 weeks into coding from start) BUT the fundermentals are there
its all working in mp/dedicated and single player, i keep changing what im working on daily (which is a bad thing to do) like this morning i was hammering out the assets but then earlier this evening i was told how i could get arrays of compositions from the eden editor, so i played with that in debug_functions.sqf, those 2 composition functions are VERY MUCH needed for this type of addon/mod means i can create templates of enemy bases and spawn them in on the fly or remove them.. very excited about that.. :)

anyway.. i posted this WIP so you can see my coding and "maybe" learn something from it
to help with your mission :)

Give it a try and look at the coding, its not perfect but it will bet better over the coming weeks/months :)

Domino..
now that sounds very interesting, im gonna have to look through it here soon and look at your work. you seem to have a gift for learning, im impressed
MrMessy187 May 13, 2016 @ 5:12pm 
hehe, i do learn code fast, but i also come from coding a different game in lua.. in all games/coding there is always a constant meaning "If this DO THIS else DO THIS" that doesnt change.. main thing in arma is learning the weird syntax, its disturbing sometimes.. hehe..
IM SORRY BUFFALO May 13, 2016 @ 5:15pm 
Originally posted by Domino:
hehe, i do learn code fast, but i also come from coding a different game in lua.. in all games/coding there is always a constant meaning "If this DO THIS else DO THIS" that doesnt change.. main thing in arma is learning the weird syntax, its disturbing sometimes.. hehe..
do you know any other languages well? i have very little know how in c++ which i used just to mess around with rpm/wpm for trainers in games such as world at war, but sqf feels actually very similar, just a few things here and there that bug me lol.
MrMessy187 May 13, 2016 @ 5:21pm 
being honest, i know alot about nothing, i am fluent in modded lua, html, a little java, some python, some c++, i learn what i need to at the time depending on what im trying to do.
NONE of it can help me in real life :) although my friends think im some kind of computer genius, i tell them its nothing, they dont understand scripting/coding anything like that..

they could though if they give it a go.. its like cooking the more you do it, the better you get at it. :)

i can do my own scripting however actually suck at looking at others code and finding problems.. lol i can obviously see blatent mistakes etc.
Last edited by MrMessy187; May 13, 2016 @ 5:23pm
MrMessy187 May 13, 2016 @ 5:24pm 
your the first person i actually tried to help on here.. :)

im the one that needs help loool
Last edited by MrMessy187; May 13, 2016 @ 5:25pm
IM SORRY BUFFALO May 14, 2016 @ 12:00pm 
Originally posted by Domino:
being honest, i know alot about nothing, i am fluent in modded lua, html, a little java, some python, some c++, i learn what i need to at the time depending on what im trying to do.
NONE of it can help me in real life :) although my friends think im some kind of computer genius, i tell them its nothing, they dont understand scripting/coding anything like that..

they could though if they give it a go.. its like cooking the more you do it, the better you get at it. :)

i can do my own scripting however actually suck at looking at others code and finding problems.. lol i can obviously see blatent mistakes etc.
hahaha, dont you love it when you look like a genius infront of people who know nothing, when you know how little you actually know compared to most people XD.

hey i have a question cause im still having a hard time at this, would you mind writing something simple for me, such as have the client(for example bob/player 3) display a hint to the server saying *i have died* so that everybody in the server sees that hint when bob/player 3 dies?

or with an addAction, have it display a hint for everybody on the server when any player selects that addAction at any time?
hopefully that should get me on track, ive never struggled to wrap my head around something so much
MrMessy187 May 15, 2016 @ 5:36am 
yeah pal, ill post that up a little later.. np :)
< >
Showing 1-15 of 20 comments
Per page: 1530 50

Date Posted: May 11, 2016 @ 10:25pm
Posts: 20