Jump to content

MrSydney

Member
  • Content Count

    31
  • Joined

  • Last visited

  • Medals

Everything posted by MrSydney

  1. Hello, I am not too sure about the vanilla system regarding first aid kits, but as I understand it, if a player that is not a medic and does not have a medkit tries to heal himself or someone else with a first aid kit, then he should only be able to restore his health to about 75%. If you want to return a player's health to 100%, you should be healed by a medic with a medkit. I noticed on my missions that all players were able to heal themselves to 100% using first aid kits. I checked that this was indeed the case by using a little mod to show the health status, which can be found here: https://steamcommunity.com/sharedfiles/filedetails/?id=1250429186. I am running a few scripts, but there is nothing that I implemented that should affect this. Is there a setting somewhere where I can change it back to the the vanilla system or a script that I can implement to force the system that I described above? Thank you
  2. Hello, I am trying to get a simple hostage script to work on a dedicated multiplayer server, but it does not seem to work properly. I can see the "Free Hostage" option on the "hostage" AI, but the AI does not do anything after I select the option. While testing in the editor, the hostage is able to go to his next waypoint, but on the dedicated server, he is still stuck in place as if the script did not execute. The code I have to setup the hostage in "hostageSetup.sqf": hostage disableAI "move"; hostage setcaptive true; removeallweapons hostage; removebackpack hostage; removeGoggles hostage; removeHeadgear hostage; hostage unassignitem "nvgoggles"; hostage removeitem "nvgoggles"; removeVest hostage; hostage setunitpos "middle"; The code in "hostageAction.sqf": hostage setcaptive false; hostage setunitpos "auto"; hostage enableAI "Move"; And then finally the code in "init.sqf": execVM "hostageSetup.sqf"; hostage addaction ["Free Hostage",{ execVM "hostageAction.sqf" },nil,6,true,true,"","true",2,false,"",""]; Is there something I should add?
  3. Good day, I am having trouble with getUnitLoadout and setUnitLoadout functions. I want to make it so that when players respawn, they have the same loadout like they did before they died/respawned. But in some cases it removes the primary and secondary weapons. I am using the code below: //In onPlayerKilled.sqf I have: player setVariable ["Saved_Loadout",getUnitLoadout player]; //In onPlayerRespawn.sqf I have: player setUnitLoadout (player getVariable ["Saved_Loadout",[]]); It works when players respawn through the menu. But the problem is when they are shot and go into the incapacitated animation (I have revive enabled). I assume that when you go into the incapacitated state you lose your weapons, and then it saves your loadout when you "Hold space" to respawn. So technically you did not have a weapon when the script saved your loadout. I was thinking that the "getUnitLoadout" function should be triggered just before you go into the incapacitated state, but I am not sure how to do that. Maybe check if the player's health is below 10%? Any help would be appreciated. -MrSydney
  4. Ok I understand. I thought they fired at two different times for some reason. Thank you very much for the help.
  5. Thank you, The first one did the same. Does "_oldPlyr" refer to the unit while it was still alive or while it was incapacitated and waiting to be revived? Second one with event handlers solved the issue. But now I am confused when the eventHandler is triggered. "Killed" in this context looks like it applies to when the player/unit has been put into the incapacitated state. The wiki just "when the unit is killed". But "onPlayerKilled" says the same, but seems to happen after the incapacitated state, when the unit becomes an object/corpse (bleeds out/dies/respawns). Can you help me understand maybe?
  6. MrSydney

    First aid kits use

    Just tested it and everything is working great. Thank you for the help.
  7. Hello. I am not sure if this has been asked before so apologies if it has. I am trying to make it so that combat life savers always use up a single first aid kit when healing themselves or other players. When they have none, then a hint should show up saying that "You do not have a first aid kit" or something. Medics will then have to carry both medikits to revive incapacitated players, but also first aid kits to heal injured players that are not incapacitated. In the base game, medics that have the big medikits can heal players without their First aid kits ever depleting. Any ideas on how I could do this with a script? I was thinking that I have to first do a check if the player is a medic, then if the medic has first aid kits, and if he does it should remove a single first aid kit from his inventory whenever he heals someone. But I am not sure how to stop the medic from using the medikit. I wrote a little script, but it does not seem to do anything. Any help would be appreciated, thanks. _playerType = typeOf player; if ((_playerType == "B_medic_F") or (_playerType == "B_recon_medic_F") or (_playerType == "B_G_medic_F") or (_playerType == "B_T_Medic_F")) then { player addEventHandler ["HandleHeal", { _this spawn { params ["_injured", "_healer"]; _items = items _healer; if ("Item_FirstAidKit" in _items) then { _healer removeItem Item_FirstAidKit; } else { private _damage = damage _injured; if (_injured == _healer) then { waitUntil {damage _injured != _damage}; if (damage _injured < _damage) then { uiSleep 0.3; _injured setDamage _damage; hint "You do not have a first aid kit."; }; }; }; }; }]; } else {};
  8. MrSydney

    First aid kits use

    Ok, thanks so much. I will try it out in the morning.
  9. MrSydney

    First aid kits use

    Thank you very much for this. That works almost perfectly. I noticed that if you are a normal player (not a combat life saver with a medikit), and you try to heal someone else with the last FAK in your inventory, they don't regain any health and the healing does not work. Any ideas what might be causing this to happen? Sorry, I am still a noob at scripting.
  10. Hello, I am trying to host from a dedicated server, and everything works up until the point where I try to respawn. I get the error "publicvariable restricted #0" and then get kicked from the server. I read somewhere that I should maybe remove publicvariable.txt. what effect would that have on the server? Thank you
  11. Yes it is my server. Thank you I will have a look.
  12. Thank you, that seems to have worked. Hostages now move to their first waypoint after they are freed.
  13. Thank you, I changed the "hostageAction.sqf" to: [hostage, clientOwner] remoteExec ["setOwner", 2]; sleep 2; hostage setcaptive false; hostage setunitpos "auto"; hostage enableAI "Move"; but in the editor I got an error message saying "Script command setOwner cannot be used for object 'C_man_polo_1_F'. Use setGroupOwner instead. And when tested on the dedicated server, I have the same result as before, where the AI does not move. However, I do not get the error message on the server. So I also tried to change it to "setGroupOwner" instead of "setOwner", which gave me the error in the editor: " '(_this select 0) |#|setGroupOnwer (_this select 1)' Error setGroupOwner: Type Object, expected Group". And on the dedicated server I had the same result as before. Is there a different way that this can be done maybe?
  14. Hello, I noticed something strange when I load up my mission on a multiplayer server. I have changed the "skillAI" and "precisionAI" values in the .Arma3Profile file on the server that I am using, but when I double click on a soldier in the Zeus view, I still see that the soldier's skill level is at the default 50%. Are the custom values being applied and just not showing or is there an error somewhere? See the full .Arma3Profile script for my server below. version=1; blood=1; singleVoice=0; gamma=1; brightness=1; maxSamplesPlayed=128; difficulty="Custom"; class DifficultyPresets { class CustomDifficulty { class Options { groupIndicators=2; friendlyTags=2; enemyTags=0; detectedMines=2; commands=2; waypoints=2; weaponInfo=2; stanceIndicator=2; reducedDamage=0; staminaBar=2; weaponCrosshair=1; visionAid=0; thirdPersonView=1; cameraShake=1; scoreTable=0; deathMessages=1; vonID=1; mapContent=0; mapContentFriendly=0; mapContentEnemy=0; mapContentMines=0; autoReport=0; multipleSaves=0; }; aiLevelPreset=3; }; class CustomAILevel { skillAI=0.80000001; precisionAI=0.40000001; }; }; sceneComplexity=1000000; shadowZDistance=100; viewDistance=3000; preferredObjectViewDistance=3000; terrainGrid=3.125; volumeCD=10; volumeFX=10; volumeSpeech=10; volumeVoN=10; vonRecThreshold=0.029999999;
  15. Yes. I am renting a server that had this already set up, so I apologize if I sound a little confused. It is probably just overwritten to rather use the default.cfg since I am able to play the mission and change the server details too and see the effects. But getting back to my question about the AI skill level, is this an effective way of changing the skill variables of the AI or is it better to use a script with the "setSkill" command? It does look like the enemy AI are influenced like they should be with those commands that I described, but it is just the fact that it is not showing in the zeus view that has me doubting the whole thing.
  16. Yes I think I did. See the following lines below which is in "default.cfg". Should this be in "server.cfg"? // MISSION MNAGAEMENT // missionWhitelist[] = {}; // MISSIONS CYCLE // class Missions { class Mission1 { template = "Mission.Tanoa"; difficulty="Custom"; }; };
  17. No issues with those options. When Revive is enabled for all players (image 1), then players are incapacitated when shot and can be revived by a combat life saver with a Medkit. The player can self-heal with a FAK to 100% and the handleHeal script does not work then. When disabled (image 2), then players die instantly and have to respawn, but then self-healing with a FAK heals to 75% and the script you gave works. I want players to be incapacitated so that they can be revived by a combat life saver, but also not be able to self-heal with a FAK to 100% so that medics play a more important role. I am still not sure why it works this way. I did find an easy solution however. If you just add 'uiSleep 0.3;' to the handleHeal script (before the damage is adjusted), then players do in fact still heal themselves to 100%, but then that gets reduced back to 75% after the script is completed. So problem solved for now. Thank you pierremgi and sarogahtyp for the help. Image 1: https://ibb.co/VHks3LN Image 2: https://ibb.co/ZWd3CmB
  18. I first tried to implement the code as is, but that also does not seem to work like it should. When revive is disabled, it does the job and changing the value of setDamage, changes the player health after being treated by a first aid kit. However, when Revive is enabled, then it seems like the script is being overwritten. You can see that the player health goes to the expected value (75%), but then quickly jumps to 100% thereafter.
  19. Thank you, I will have a look and see if I can do something. It seems the issue is present only when Revive is enabled in the Multiplayer attributes of the mission. When I disable it, it works as expected where normal infantry can only heal to 75%, and medics can heal to 100% and revive others. It is really strange to me why it does this.
  20. The mod that I linked only shows the percentage of the players health, but does not alter it. I only used it to check, since I noticed players being fully healed without it. I also have CBA running together with Zeus Enhanced, but I don't think that they can be causing this.
  21. I was thinking of using getUnitLoadout to get the player's loadout, and then using BIS_fnc_inString to look for each of the restricted weapons, one by one. If it returns true, I can remove the weapon. But that idea is going to take a really long time to code, is there a faster way that I can compare player's invenotries to the restricted weapons list?
  22. Hello, I would like to add weapon restrictions to specific classes. For example only AT's can carry launchers, only engineers can carry explosive charges and only medics can carry medkits. In my mission, players will be given a virtual arsenal at the start, but I don't want them to pick up anything they are not supposed to later on. So the restrictions should always apply. I have seen a few topics on how to restrict the arsenal but that is not going to work. Does anybody know how I can do that? Thank you
  23. Thank you. A loop does sound like a pretty good solution. Should I run the loop in initPlayer? Also, is there a way I can display a little message to the players if some of their items/weapons have been removed because they are not suited for their role? For example "Weapon or item in your inventory does not fit your role and has been removed."
  24. Hi, I was busy making a mission the past few days and I used the Ares zeus tools mod, but this morning I did not see it on the launcher or the steam webpage. Is it possible that this mod was removed from steam and if so, is there a way I can recover my mission? Thank you
×