Jump to content

FederalRazer89

Member
  • Content Count

    84
  • Joined

  • Last visited

  • Medals

Everything posted by FederalRazer89

  1. FederalRazer89

    Warlords

    Have been enjoying this gamemode in single player. But when i save in single player scenario or a lan hosted version, the warlords options to buy,vote and fast travel will disappear when reloading the save after reloading the game. Would be nice if this gets addressed.
  2. FederalRazer89

    [Script] Copy a units loadout

    Oh sorry More or less does the same thing as "setUnitLoadout", atleast acording to the commands wiki. Going to try use tomorrow and see what happens with "setUnitLoadout".
  3. FederalRazer89

    [Script] Copy a units loadout

    Well my script is mostly for use when you want to unstuck AI squad mates, especially when the AI refuses to move or react. But damn if google hade found command "setUnitLoadout" then i would have saved about 4 hours. But i guess i learnd something new.
  4. FederalRazer89

    [Script] Copy a units loadout

    I tried your script and i dont get any of the attachments for for the weapons, but just added the command "primaryWeaponItems" and some other stuff to complement the script. My script: (Unstuck AI) Because i am too lazy to try and integrate those commands in your script i am just adding them after you script is done.
  5. I am have been working on a script that can find a position in cities and villages as away to randomly generate positions in populated areas. Now that i found a way to make it a bit more effectiv, i get a problem with the rounding commans like "floor" and "round". When i use hint to check what the varible outputs it say "any". I need to be able to round the numbers to select which position to place markers. The rest of the script can randomly generate position, but is a bit limited and is somewhat susceptible to multiple markers on same position. Part of the script: I know a way that i could make this without the "floor" or "round" functions but it weird that it dosent work. Is this a bug or did i use the functions wrong? I am lost on this so any suggestions would be appreciated.
  6. FederalRazer89

    Rounding is replacing a number with any

    I am not sure if some people misunderstood my intentions then i am sorry. Dont mean to offend anybody, but either way i got some ideas from this disscutions and made a bit better version of my previous script. Will post it below for anyone intressted in this sort of script. Still a work in progress. The new script: A bit slow but it will only be used once so its not problem for my type of mission.
  7. FederalRazer89

    Rounding is replacing a number with any

    10. But if i can use the metod that i am trying to use then, i will be able to be more flexible for me in the future. I want some level of control but its not necessary to be weighted, just that it needs to be random. But i got some ideas i am going to try after work.
  8. FederalRazer89

    Rounding is replacing a number with any

    Sorry forgot about that. Trying to chose random elements from array FED_CampPos_Array which hold positions. Problem is that selectrandom some time causes multiple markers to chose the same position, even when i try to compare with the this: That way it will restart the selections process if any of them are too close to each other. So mabye if they have the same positions the distance command dont work that well, but i dont know. I am fairly new to scripting.
  9. FederalRazer89

    Rounding is replacing a number with any

    I have checked if the array is defiend counts about 30-40 elements, another script that need to generate the locations before this script is executed. And if you defiene the array with just some random numbers then you can test it yourself. Example: Copy if you want to see the results. It will output "any" and the 10 chosen values of the array. if you copy this in to arma and execute it, then it will show that _campPos1 that will output "any" and the content of FED_CampPos_Array. In this example FED_CampPos_Array is already defined it will be possible to replicate without any problem. Got something i will try something when i get back from work.
  10. FederalRazer89

    Rounding is replacing a number with any

    Well i make a lot of mistakes, and that have made me learn new stuff. it happens.
  11. FederalRazer89

    Rounding is replacing a number with any

    True I have tried "round" and "floor". But of both of them should achieve similar result, which is enough for my usage.
  12. FederalRazer89

    Rounding is replacing a number with any

    Tried it but the array size didnt decrese, and apperantly the loop hit the limit that i put in place. Can it be because its a global array?
  13. FederalRazer89

    Rounding is replacing a number with any

    I am sort of trying to use a random element, but i want to test it so i am sure that it is not the same as the others. When i used the selectRandom directly there would be serveral instances of the same position for multiple markers. What would be the right syntax for the round command? I used this before, but will rewrite it.
  14. Hello I am creating a script that will make AI squad members search for ammo for there primary weapon. And it works for any dead bodys, but it dont work if they seaching a vehicle. The AI unit walk to the vehicle but they dont do anything, just trigger the next part of the script without any errors. Because there is no error is kind of hard to solve it. But i know the line were it fails to create the action that i wants. the init for the script. Function for each squad member. (Problem in this function) Any suggestions would be nice
  15. FederalRazer89

    Need help with a scavenging script for AI

    You could create one sqf dokument and copy the function first and at the bottom of the dokument insert the init. Then you will have to activate it with the metod of your chose. Untill they fix this bug or i find a way to workaround it this will only work with dead bodies. To make it easy for you copy this into a sqf dokument, then use some command like addaction or radio trigger to activate this script. Then depending on how you want to use it, you might want to use execVM or spawn. ------------------------------------------------------------------------------------------------------------------------------------------ exemple: [ ] execVM "Rootdirectory\Rearm" ; or fn_Rearm = compile preprocessFileLineNumbers "Rootdirectory\Rearm.sqf"; [ ] spawn fn_Rearm; ------------------------------------------------------------------------------------------------------------------------------------------ if you have it in the mission folder and not in any sub folders then the path should be like this: [ ] execVM "Rearm" ; or fn_Rearm = compile preprocessFileLineNumbers "Rearm.sqf"; [ ] spawn fn_Rearm; ------------------------------------------------------------------------------------------------------------------------------------------ If you want to use a radio command then: With execVM _trg = createTrigger ["EmptyDetector", [0,0,0]]; _trg setTriggerActivation ["ALPHA","PRESENT", true]; _trg setTriggerStatements ["this", '[ ] execVM "Rootdirectory\Rearm";',"sleep 1" ]; 1 setRadioMsg "Rearm"; With spawn _trg = createTrigger ["EmptyDetector", [0,0,0]]; _trg setTriggerActivation ["ALPHA","PRESENT", true]; _trg setTriggerStatements ["this", '[] spawn fn_Rearm;',"sleep 1" ]; 1 setRadioMsg "Rearm"; ------------------------------------------------------------------------------------------------------------------------------------------ I am not sure how much you know about scripting but i am going to work and will be gone for some time so i decided to give these exemples of how to use it.
  16. FederalRazer89

    Need help with a scavenging script for AI

    Tried to make a workaround, but i could make is so it replaces the lost cargo from clearMagazineCargo. But on the bright side it did give me some ideas on other things. I uploaded my current version of the script if anyone to try, but i think i will wait untill that bug gets fixed. Or someone suggest another solution. Init function
  17. FederalRazer89

    Need help with a scavenging script for AI

    So that was a bug, thought it was weird that it worked on bodies but not vehicles. Thought about a similar approach, will try and use a workaround. Thanks mrcurry would have been stuck in an long loop of troubleshooting and testing if i didnt know this.
  18. FederalRazer89

    Ravage

    I tried two of them but they didnt detonate and apperntly you cant just take a classname for a munition to create a explosion. Got the "RPG32_F" to work before but sometimes it could fly away if the terrain were slanted. I will balance it at a later date when i tested some more.
  19. FederalRazer89

    Ravage

    haleks i tried your version, but when i spawned a APC the zombies wouldnt hit it. But i found a solution that works for me. My version for anyone that is interested. The script: Anyone know what the class name would be for a AT missile or small charge? want to balance the explosion.
  20. FederalRazer89

    Ravage

    anyone know a way to make zombies explode when they get close to humans? Trying to make a explosiv zombie so armor have some weak point, and prevents them from recklessly drive into zombies or towns. At the moment i can make them explode on death, but not when they are close to humans. The script: _pos = _this select 0; _zed = createAgent [call zedsToSpawn, _pos, [], 300, "NONE"]; _zed setDir random 359; _zed setpos _pos; sleep 0.1; _dead = 0; _exlode = 0; while {true} do { _zedpos = getpos _zed; _getTarget = count (_zed nearTargets 10); for "_i" from 0 to (_getTarget -1) do { if (_getTarget >= 1) exitWith {_exlode = "bomb" createVehicle _zedpos; _exlode setDamage 1;_dead = 1; sleep 1; deleteVehicle _explode}; }; if (_dead == 1) exitWith {}; if (!alive _zed) exitWith {_exlode = "bomb" createVehicle _zedpos; _exlode setDamage 1; sleep 1; deleteVehicle _explode}; sleep 0.01; };
  21. I solved my problem with a global array that i added the groups and the locations. But is there anyway to sort an array by the time that it got added?
  22. Hello I am trying to make a function that make helicopters transport random groups to there waypoints unless they are close to the the groups waypoint (500 m). I got this to work and the helicopters transported the random AI groups to there respective destinations, but sometimes they will fly to coordinates [0,0,0] and this happens at random. It unpredictible and i have tried to make a check that compare the waypoints to [0,0,0] but that dosent solve it. So i am wondering if there is a way to attach som locations variables to the group and when the helicopter function choses a group it can extract that variable or if there is a more reliable way to get another groups waypoint position? The function is kind of butchered when i was trying to solve this so i will rewrite it when i get a more reliable way to handle this, but included it if someone is interested. After work i might try and use arrays to try and solve this problem. _Newpos = waypointPosition [_randomUnit,1]; <--------------this is how i get the units waypoint position. And sometimes it -----------------------------------------------Cut---------------------------------------------------------------------------- _biglist = _veh nearEntities ["man",5000]; <---------------------- this is how i get a random unit. _SmallList = []; for "_i" from 0 to ((count _biglist) - 1) do { if (side (_biglist select _i) == west) then { _SmallList pushBack (_biglist select _i); }; }; _SmallList = _SmallList apply {[_x distance _veh, _x] }; _SmallList sort true; _randomUnit = group ((_SmallList select 0) select 1); <---------------------- this is how i get the group that the random unit is assigned to. The Complete function:
  23. Didnt notice any preformance drop when i added the functions, but i will implement them. Thanks. I sort by distance to get the closest group and then i test the group if the leader is a player or an officer. If they are then it will chose another group at random.
×