Jump to content

ZaellixA

Member
  • Content Count

    207
  • Joined

  • Last visited

  • Medals

Community Reputation

209 Excellent

4 Followers

About ZaellixA

  • Rank
    Staff Sergeant

Contact Methods

  • Skype
    zaellixa
  • Biography
    Born in Ioannina, Greece. Grew up all around Greece and now still trying to settle somewhere. Sound engineering pays for most of my expenses.
  • Steam url id
    zaellixa
  • Linkedin
    achilleskappis
  • Reddit
    ZaellixA

Profile Information

  • Gender
    Male
  • Location
    Greece
  • Interests
    Acoustics, Digital Signal Processing, ArmA 3, Programming, Research, Computational Acoustics, Wave-Fields, 3D Audio, Electroacoustics

Recent Profile Visitors

707 profile views
  1. In general, in programming a string is a sequence of characters enclosed in double quotes like "this is a string" What pierremgi means is that instead of writing the class name of the object you want to spawn, you have to make it a string. This, effectively means that you should encolse it into double quotes. So, the "solution" would be something like (duplicating pierremgi's text) // Your script class Unit0 {side = 1; vehicle = sab_UN_Truck_O; rank = "SERGEANT";}; // What pierremgi suggests class Unit0 {side = 1; vehicle = "sab_UN_Truck_O"; rank = "SERGEANT";}; If you notice, the only difference is in the name of the class of the vehicle, which in the second case is enclosed in double quotes (i.e. it is a string). It is pretty much the same as the "SERGEANT" rank you provide for the vehicles. If you were to omit the double quotes in the rank you would encounter the same issues. Hope this clarifies a bit the situation with strings and is somehow helpful. Please don't hesitate to ask again if you need anything else.
  2. Glad you found a solution. I just have one thing to suggest here that is not critical and won't change the behaviour of your script, but I think it will somehow make the script a wee bit "better-looking" ;). In your init, you could avoid using a switch statement and try something like // Get manpowers private _westManPower = paramsarray select 0; // West manpower private _eastManPower = paramsarray select 1; // East manpower // Set the variables _spawnAI_module_West setVariable["manpowerCap", _westManPower]; // Set west manpower variable _spawnAI_module_East setVariable["manpowerCap", _easManPower]; // Set east manpower variable Or, even shorter could be // Set the variables _spawnAI_module_West setVariable["manpowerCap", paramsarray select 0]; // Set west manpower variable _spawnAI_module_East setVariable["manpowerCap", paramsarray select 1]; // Set east manpower variable Happy ArmA 🙂.
  3. Schatten is quite right in their answer, but if you don't provide more information, mainly on where the "licence" is stored (inventory, as a variable, etc.) you won't be able to get a "spot-on" answer easily.
  4. ZaellixA

    HoldAction in MP

    Yeah, hideObjectGlobal should have a global effect. BUT, according to the docs, it should be executed on the server only. So, maybe you should call something like [boat, true] remoteExec["hideObjectGlobal", 2, true]; boatplace say3D "splash"; at the code to be executed on completion. Regarding "missing" sounds... I am not sure how to tackle that because I haven't used the command before. Maybe you could try to remoteExec it too since it seems to be working properly when executed on the host. You could try something like [boat, true] remoteExec["hideObjectGlobal", 2, true]; [boatplace, "splash"] remoteExec["say3D", 2, false]; Unfortunately, I am not sure about any of those two 😞 and I am just speculating here. I believe it's not too much of a burden to try them so it may be worth it. Wish you luck with it and hopefully, someone more knowledgeable than me will be able to provide a solution based on solid foundations instead of mere speculations. Please spend some time to provide a solution if you find it to help people in the future.
  5. ZaellixA

    HoldAction in MP

    Are you sure that boat and boatstuck are valid objects at the machine the code is being executed? Maybe if you could provide some more information it could be helpful to us. Additionally, I have to assume that the sound "push" is defined in the CfgSounds part of your description.ext.
  6. ZaellixA

    More players, More enemies

    @Casio91Fin and @fin_soldier would you mind using English on public posts as per the guidelines? You could PM other users and use whatever language you wish.
  7. Most probably you could use an event handler to call when you switch the seat. From there you could possibly call a script that handles the deceleration of the vehicle. The event handler would look something like // Place this inside the init of the vehicle for example // Add the event handler to the vehicle this addEventHandler["SeatSwitched", { // Get the parameters params["_veh", "_unit1", "_unit2"]; // Find out which unit is the player // (this may be redundant if you know that you are the // only unit in the vehicle, or the first unit is // always the one that initiates the move. This has // to be tested though). private plr = 0; // Initialise the variable // Do the test if(_unit1 isEqualTo player) then { plr = _unit1; } else { plr = _unit2; }; // Make sure you moved out of the driver seat if((driver _veh) isEqualTo _plr) then { // Call the script to handle the vehicle's movement private _nil = [_veh, _plr, 0.99] execVM "You_handleVehMove.sqf"; }; }]; Please keep in mind that if you intend to use the script only in the case where you are the only person in the vehicle and you are driving, you could simplify it into something like // Place this inside the init of the vehicle for example // Add the event handler to the vehicle this addEventHandler["SeatSwitched", { // Get the parameters params["_veh"]; // Call the script to handle the vehicle's movement private _nil = [_veh, _plr, 0.99] execVM "You_handleVehMove.sqf"; }]; And the script that handles the movement could be something like /* * You_handleVehMove.sqf */ // Get the parameter params["_veh", // The vehicle "_plr", // The player "_dec"]; // The deceleration factor // Get the speed of the vehicle private _speed = speed _veh; // Decelerate until the veh has reached a small speed value (in this example 1 km/h) while{_speed >= 1 || {(driver _veh) isEqualTo _plr} do { // Get some values private _vel = velocity _veh; // Velocity of vehicle (vector quantity) private _dir = direction _veh; // Direction of the vehicle (vector quantity) // Change speed according to deceleration factor _speed = _speed * _dec; // Set the new velocity of the vehicle _veh setVelocity [ (_vel select 0) + (sin _dir * _speed), // Set speed on X-axis (_vel select 1) + (cos _dir * _speed), // Set speed on Y-axis (_vel select 2)]; // Set speed on Z-axis }; Please note that the deceleration factor is an arbitrary factor and if you want to calculate it in km/(h^2) you would have to use some time of timer for the game. Additionally, keep in mind that the whole script is quite CPU intensive because it will run (or at least try to) every frame. If you intend to use it on specifically limited occurencies it could be quite OK, but it should be avoided as an often-called script. The script doesn't seem to cope well with multiplayer or in situations where many players are inside the vehicle of interest. A more "sophisticated" solution should be implemented for such cases. Nevertheless, this solution may (or may not) provide a starting point for a possible (and hopefully) better solution. Finally, please keep in mind that these scripts are NOT tested and should be treated with caution. I hope this helped somehow. If not, or if you have more questions please don't hesitate to ask.
  8. ZaellixA

    More players, More enemies

    First of all, if you intend to use a waitUntil loop, I strongly suggest adding a sleep command in it to save some CPU usage. This would look like waitUntil { sleep 2; // Wait 2 seconds before checking again !(isNull player); // Check if player exists };
  9. Let me add some more info on the above examples. I spent some more time on it and realised that allPlayers returns all the units controlled by players (connected clients) plus the headless clients. In addition to that, if you happen to start the game without all the players being connected, the above scripts won't get the new players. If there's at least one player in each team this is not an issue, but if there's a team without a player then you won't be able to get that group. A workaround on that is to use playableUnits, BUT this command in single-player returns an empty array. Thus, you would have to use switchableUnits if you intend to use the mission on single-player too. A more complete example would be // Get groups with players private _grps = []; // Initialise groups variable // Check whether we play MP or SP if(isMultiplayer) then { // If in MP, use playableUnits { // Add the group if not already in the array _grps pushBackUnique (group _x); } forEach playableUnits; } else { // If in SP, use switchableUnits { // Add the group if not already in the array _grps pushBackUnique (group _x); } forEach switchableUnits; }; // Wait until one of the two groups is full of dead people waitUntil { // Sleep a bit to save some CPU usage sleep 3; // Sleep for 3 seconds // Find out if there's any group with all the players dead private _stop = (_grps findIf{((units _x) findIf{alive _x}) == -1;}) != -1; // Return if stop criterion is met _stop }; // Do some ending cinematics or whatever here If you can be sure that all players will be online before the mission start you can use the last script provided in the previous answer with the difference that you should make sure you won't get headless clients. Copying from allPlayers example 1 you can do // Get only players and exclude headless clients private _plrs = allPlayers - (entities "HeadlessClient_F); So, once more, copying the last script from the previous answer with this new "addition/correction" you have // Get all players without headless clients private _plrs = allPlayers - (entities "HeadlessClient_F"); // Get groups with players private _grps = []; // Initialise groups variable { // Add the group if not already in the array _grps pushBackUnique (group _x); } forEach plrs; // <- CHANGED THE ARRAY TO ITERATE THROUGH // Wait until one of the two groups is full of dead people waitUntil { // Sleep a bit to save some CPU usage sleep 3; // Sleep for 3 seconds // Find out if there's any group with all the players dead private _stop = (_grps findIf{((units _x) findIf{alive _x}) == -1;}) != -1; // Return if stop criterion is met _stop }; // Do some ending cinematics or whatever here Hope one of these examples will be sufficient for your case. If not, don't hesitate to communicate your needs to find a better solution together.
  10. One simple way to do so is to create two different groups in the editor and name their leader something like leader_1 and leader_2. Then in a script you could do something like // This could go into init.sqf or initServer.sqf in case of MP // Get the groups of the two leaders private _grp1 = (units leader_1); // First group private _grp2 = (units leader_2); // Second group // Wait until one of the two groups is full of dead people waitUntil { // Sleep a bit to save some CPU usage sleep 3; // Sleep for 3 seconds // Get alive units of both groups private _grp1_alive = _grp1 findIf{alive _x}; private _grp2_alive = _grp2 findIf{alive _x}; // Leave the waitUntil loop if any of the groups doesn't // have any units alive _grp1_alive == -1 || {_grp2_alive == -1}; }; // Do some ending cinematics or whatever here Of course this assumes that the leader positions will be occupied or they will be playable AIs (they will be present when the mission starts). Alternatively, you could hardcode the names of the players variables in each group to make the groups yourself. This would look like // First team private _grp1 = [plr1, plr2, plr3, plr4]; // Consists of player 1 (plr1), up to player 4 (plr4) // Second team private _grp2 = [plr5, plr6, plr7, plr8]; // Consists of player 5 (plr5), up to player 8 (plr8) // Wait until one of the two groups is full of dead people waitUntil { // Sleep a bit to save some CPU usage sleep 3; // Sleep for 3 seconds // Get alive units of both groups private _grp1_alive = _grp1 findIf{alive _x}; private _grp2_alive = _grp2 findIf{alive _x}; // Leave the waitUntil loop if any of the groups doesn't // have any units alive _grp1_alive == -1 || {_grp2_alive == -1}; }; // Do some ending cinematics or whatever here Finally, the "most correct" way of doing it (in my opinion at least) would be to get all the groups (hopefully you will have only two of them, one for each team) that contains players. This could be done like (copying from allGroups example 2) // Get groups with players private _grps = []; // Initialise groups variable { // Add the group if not already in the array _grps pushBackUnique (group _x); } forEach allPlayers; // Wait until one of the two groups is full of dead people waitUntil { // Sleep a bit to save some CPU usage sleep 3; // Sleep for 3 seconds // Find out if there's any group with all the players dead private _stop = (_grps findIf{((units _x) findIf{alive _x}) == -1;}) != -1; // Return if stop criterion is met _stop }; // Do some ending cinematics or whatever here Please keep in mind that these scripts are NOT tested and treat them with caution. Hope this helps somehow. If not, or if you have any more questions, please don't hestitate to ask.
  11. Another scripting solution (haven't looked at pierremgi's modules, and I am sure they will perform way better than the solution I present below) would be to use an event handler. Something in the lines of // Add an event handler to the player to handle the rating player addEventHandler["HandleRating", { // Get the passed parameters params["_unit", "_rating"]; // Check if rating to be added is negative (killed some friend) if(_rating <= 0) exitWith { // Return the number to be added as rating to the user (effectively cancelling the default behaviour) 0; }; }]; The above code could be placed in the init.sqf of your mission. Additionally, if you want multiplayer compatibility you could place it in the initPlayerLocal.sqf. I am not sure whether the event handler is persistent after respawn so what I would do would be something like /* * Place in initPlayerLocal.sqf */ // Get the unit (inside initPlayerLocal.sqf) params["_unit"]; // Create a function to call to add the event handler to handle rating YOU_fnc_handleRate = { params["_unit"]; // Get the unit inside the function // Add an event handler to the player to handle the rating _unit addEventHandler["HandleRating", { // Get the passed parameters to the event handler params["_unit", "_rating"]; // Unit (inside the event handler) and rating // Check if rating to be added is negative (killed some friend) if(_rating <= 0) exitWith { // Return the number to be added as rating to the user (effectively cancelling the default behaviour) 0; }; // End of if }]; // End of event handler }; // End of function // Add the event handler for the rating to the unit [_unit] call YOU_fnc_handleRate; // Add event handler to add the rating event handler when unit respawns _unit addEventHandler["Respawn", { // Get the unit inside this event handler params["_unit"]; // Add the event handler for rating [_unit] call YOU_fnc_handleRate; ]}; I know this may be a bit ugly, but it's a "quick-and-dirty" solution in case you would like to refrain from using addons.
  12. Another "stupid" and not-based-on-concrete-foundations (I usually don't mind about "stupid" solutions but this not-based-on-concrete-foundations thing is something that I definitely do not like, just trying to help here). You could try to call your script as the problem may be that the scheduler serves other scripts in between and the delay between runs of your script is longer than required. Keep in mind that this is UNTESTED, so treat with caution! Please let us know if this worked or not and good luck with it.
  13. Well, most probably you could get away with just replacing the statement variable with some empty string "". If I am not mistaken, this statement is what is called when one tries to execute the action. So, if you set it to an empty string nothing will happen. Alternatively, you could try to delete the whole action (I believe this should be inside some scope - { ... }) which hopefully will just make it unavailable to the user(s) (plus the AI). I haven't tested any of the two propositions, so please treat them with caution. Additionally, if you delete the action (or replace the statement variable) the action will be unavailable for all objects of the same type (those hangar doors of yours). If this is an issue then another solution is needed. Please let us know if this helped or not, or if you have further questions.
  14. ZaellixA

    Dynamic Simulation

    Well, if you place the script in your init.sqf you will most probably be fine because this will be run only once at the mission start, so when your "activation" and/or "deactivation" trigger run the behaviour will be as intended (the activation trigger will enable the dynamic simulation). Nevertheless, you are most welcome and I hope this command or the script will come in handy sometime in the future. Happy ArmA 🙂.
  15. ZaellixA

    Dynamic Simulation

    Well, according to the docs, you can use the triggerDynamicSimulation command to achieve the same thing from a script. You will have to make sure you won't apply the effect to playable units, so a script like the following should to do the trick // Declare parameter to make it visible to the whole script private _AI = []; // Empty array // Check if we are playing in multiplayer if(isMultiplayer) then { _AI = allUnits - playableUnits; // Get all non-playable units } else { _AI = allUnits - player; // Get all AI (NOT SURE THIS IS NECESSARY IN SINGLE PLAYER) }; // Go through the units _AI apply { _x triggerDynamicSimulation false; // Apply the command to all of them }; You could put that in your init.sqf. It should work fine but please note that this is NOT tested, so please treat it with caution. Additionally, this script will apply the command to friendly units too, so if this is not intended behaviour let us know to help you refine. Please don't hesitate to ask again if anything is not clear or you have further questions.
×