Jump to content

Blitzen88

Member
  • Content Count

    242
  • Joined

  • Last visited

  • Medals

Everything posted by Blitzen88

  1. Greetings, I use Zenophon's Garrison Script to garrison buildings with AI. Its my favorite garrison script for a number of reasons. However, the script runs some sort of check to place an AI solider directly in front of a window - this way the AI unit can have a full field of view. Although this is ideal for most scenarios, sometimes I like to "fortify" a house by blocking all of the windows. This way, a player has to clear the house of AI as opposed to shooting them through the window. However, when I do this, Zenophon's script ignores/fails to place units in the building because their view is blocked. I'm trying to add a parameter to turn the view checking on/off but I cant figure it out. Here is a version of the script: Many years ago I reached out to Zenophon regarding this issue and he tried to help me fix this issue. Here is what he said: However, I cant figure out how to implement his suggestions - when I add a true/false check with the original conditions the script doesnt seem to work. I would reach out to him again but he seems inactive now. Any help would be appreciated
  2. Think I figured it out - nevermind
  3. Got an AI hunt (ie stalk) script that I made and Im having some trouble re-execing it after a While loop has completed. Can anyone tell/show me how to make it loop without re-execing it? I feel like re-execing it is bad practice. Here it is (look at the very bottom):
  4. Isnt that the same as re-execing it if you just re-call it?
  5. Greetings, The command addGroupIcon adds an icon to a group’s leader. The type of icon that is used is based off of the input. Is there anyway to automatically select/use the correct icon based off of the type of group? For instance, infantry groups get infantry icons, armored groups get armored icons, etc?
  6. Probably going to take this route. I found this post which describes how MARTA classifies groups….probably gonna take the same approach.
  7. I play missions using the Military Symbols module (aka Marta). For those who are unaware, the module creates/places symbols over identified enemy groups. However, the module has a problem : once an enemy group has been identified, its marker will not be removed until that group has been destroyed. Although the module has commands to tweak its settings (ie “duration”), they dont work. However, would it be possibe to add a “Map” mission eventhandler which hides “unknown” groups when the map is opened? For example: However I cant get it to work.
  8. Blitzen88

    Fixing Marta with Knowsabout

    Can anyone tell me why this doesnt work: But yet this works: Im confused.
  9. Blitzen88

    Fixing Marta with Knowsabout

    That has some interesting info but that user wanted to hide all enemy groups. I dont want to hide ALL enemy groups - I want to hide groups which have been previously identified and the player’s side should no longer know about (ie no longer in sight, far away).
  10. Greetings, Im trying to figure out how to create an AI unit via an addaction (which I've figured out) BUT to also have an addaction where a created unit will join the player. This is what I have: /*========================================================================================== Arma III - AI Unit "Purchase" Created by Blitzen =========================================================================================== * Spawn AI units to refill/replace dead units * This script will change the type of unit based upon the player's side * Requires named Flags: FlagWest, FlagEast, FlagAAF * Call with: [this] execVM "Scripts\UnitRecruitment\Recruitment_Unit.sqf" ===========================================================================================*/ _Flag = _this select 0; _Flag allowDamage false; //West //--------------------------------------- if (side Player isEqualTo West) then { _FlagWest = _this select 0; _FlagWest setObjectTexture [ 1, "a3\data_f\flags\flag_nato_co.paa"]; _FlagWest addAction ["Spawn Squad Leader", {"B_Soldier_SL_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Squad Leader _FlagWest addAction ["Spawn Team Leader", {"B_Soldier_TL_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Team Leader _FlagWest addAction ["Spawn Rifleman", {"B_Soldier_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Rifleman _FlagWest addAction ["Spawn Rifleman AT", {"B_Soldier_LAT_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Rifleman AT _FlagWest addAction ["Spawn Grenadier", {"B_Soldier_GL_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Grenadier _FlagWest addAction ["Spawn AutoRifleman", {"B_Soldier_AR_F" createUnit [getpos FlagWest, CreateGroup West];}]; // AutoRifleman _FlagWest addAction ["Spawn Asst. AutoRifleman", {"B_Soldier_AAR_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Asst. AutoRifleman _FlagWest addAction ["Spawn Heavy Gunner", {"B_HeavyGunner_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Heavy Gunner _FlagWest addAction ["Spawn Marksman", {"B_soldier_M_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Marksman _FlagWest addAction ["Spawn Sharpshooter", {"B_Sharpshooter_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Sharpshooter _FlagWest addAction ["Spawn Ammobearer", {"B_Soldier_A_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Ammobearer _FlagWest addAction ["Spawn Medic", {"B_medic_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Medic _FlagWest addAction ["Spawn Missle Specialist", {"B_Soldier_AT_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Missle Specialist _FlagWest addAction ["Spawn Asst. Missle Specialist", {"B_Soldier_AAT_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Asst. Missle Specialist _FlagWest addAction ["Spawn Asst. Gunner", {"B_support_AMG_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Asst. Gunner _FlagWest addAction ["Spawn Gunner (HMG)", {"B_support_MG_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Gunner (HMG) _FlagWest addAction ["Spawn Gunner (GMG)", {"B_support_GMG_F" createUnit [getpos FlagWest, CreateGroup West];}]; // Gunner (GMG) }; How could I create basically the same thing but have the unit join the player? Would the same syntax work with groups and vehicles? Thank you
  11. Having some issues with an AI Hunt/Stalk script that I created. The script uses the BIS_fnc_groupvehicles function to determine if the stalking group has a vehicle. However, I’m getting an error related to this function but I don’t know what I am doing wrong. The error I’m getting is: Steam Screenshot of Error (Bottom of Screen) Script:
  12. Having some issues with a loadout script I use in combination with the Vanilla Spawn AI Module. The script redresses and re-equips units with RHS equipment (in this case M16s) once they spawn. However, the script seems to create duplicate/multiple backpacks for units - the unused backpack is left to sit on the ground. The script is run in singleplayer. How can I fix this? Loadout Script: Edit: Changed how the script was called and that fixed the issue.
  13. I wanted the script to work with being called via a SpawnAI module or a unit’s init line; thats the overall goal. The script is being called via a SpawnAI module’s expression line - calling it a sector module is poor and incorrect wording by me. I can’t remember if the issue exists with units spawned via a SpawnAI module but I do know that duplicate backpacks occur when the script is called via a unit’s init. Based off of what you wrote, I am assuming I am calling/execing it wrong..? Whats the correct way to exec it? Edit: After looking it over again, and looking at the params wiki entry, I think I know what the problem is. Edit #2: Changed how the script was called and that fixed the issue
  14. Had some time this weekend to fool around with this. Added a snippet which removed backpacks before the loadout changes but it still resulted in duplicate backpacks. I could almost swear the script is running multiple times per unit instead of one time per unit but I cant figure it out.
  15. Believe it happens for all units (any unit with a backpack). Script is being run on vanilla units. Im not sure whats causing it - sometimes the script runs and does not create duplicate backpacks (that fall to the ground) but most of the times it does. I think I tried removing backpacks before exec’ing the loadout changes but it didnt change anything.
  16. I think I tried that before and it didnt work. I will try it again
  17. Ladies, Gents, and AC130 Gunships I’m trying to create a script which will spawn an infantry group, which will then exec a building garrison script, when certain conditions are met: 1) Sector A is NOT controlled by the player’s side 2) The player is within X distance from the sector’s trigger By itself, this is not very difficult: Sector_A getVariable "owner" != Playerside && (Sector_A_Trigger distance player) <= 500 However, I also want to delete the squad, and that squad only, if the player’s distance is greater than X. I also want the script to exec again if the player gets close to the sector’s trigger. For example: 1) Player gets close to the Sector and the Player’s side does NOT own the Sector A —> Group Spawns it 2) Player travels away from the Sector à The Group, and only that group, is deleted 3) Player again gets close to the Sector and the Player’s side does NOT own the Sector A —> Group Spawns in 4) Etc. Can anyone point me in the direction of a framework that would accomplish this?
  18. I’ve been looking at some script optimization and I’m a little confused about IF/Select statements and “lazy evaluation.” From my understanding, if the condition is written correctly, an If statement is more efficient if it is properly written with the correct syntax: If ( {Condition1} && {Condition2} && {Condition3} ) then { nothing }; My understanding is, if Condition1 is false, then the statement will NOT check Condition2 and Condition3 – the check essentially ends when Condition1 returns false. However, how does that work with a Select command and OR? For instance: _AllVehicles = _AllVehicles select { (!canMove _x) || (!alive driver _x) || ( (count crew _x) == 0) || ( (!isNull gunner _x) && (!alive gunner _x) ) || ( (!isNull gunner _x) && (!canFire _x) ) }; Will the script continue to evaluate the other conditions even if the vehicle cannot move? Do I need to change my brackets to accomplish that? Just wanted to check.
  19. Is the 10,000 iterations built into the tool? How can I get an evaluation for a single run? I couldnt find any info about it on the wiki
  20. I started playing around with the performance tool yesterday but I noticed it didnt take input variables and didnt account for sleeps..?
  21. I was able to take this and figure it out from there. Thank you for helping me out!
  22. This is what I’m trying to figure out. I have certain conditions that need to be evaluated at the start of the IF/Select command but I need to make sure I have the syntax right.
  23. Thanks for pointing these out - I fixed all of these after some initial testing. All of my scripts are for single player. Do you think there is any sort of performance difference between using a loop script vs. creating triggers? Im really more concerned about the possible performance impact
×