Jump to content

Squirtman

Member
  • Content Count

    36
  • Joined

  • Last visited

  • Medals

Posts posted by Squirtman


  1. So i have 2 questions for the community

     

    First I am working a custom mission and am trying to implement an objective to defend an obj in the world from attacking enemy forces (destroy waypoint) and was wondering if there is a way to make an object actually take damage from small arms fire. as it stands i am using the power generator (land_powergenerator_F) as the object that has to be protected however no firearms short of a 9.5mm sniper rifle will actually do any damage to the object. I have a handledamage event handler on the object that for now shows the amount of damage done each time the event handler is called. I remember reading somewhere in the research i have done working on other parts of this project that it was possible to allow vehicles to take damage from small arms fire however i have been unable to find that source again and don't remember how i stumbled across it in the first place.

     

    Second i was wondering if anyone could explain what the armorypoints value in [USERNAME].ArmaXProfile is used for as the wiki doesn't. see https://community.bistudio.com/wiki/armoryPoints if you are confused about what i am talking about. 

     

    I thank you in advance for any assitance you would willing to provide


  2. With the code below you are able to create an array with all the magazines that can be used in a weapon. What i would like to know is there some way to do the same thing with attachments/accessories. I've looked at several weapons in the config viewer but i haven't been able to tell what determines what controls what attachments are allowed. Thank you in advance for your time and any assistance you can provide.

        _weap = selectrandom ["hgun_Pistol_heavy_01_F", "hgun_ACPC2_F","hgun_P07_F"];
        _mags = (getArray(configFile >> 'CfgWeapons' >> _weap >> 'magazines'));

     


  3. well excuse me for trying to help. As i said in my post before that one i never tested my first solution so i didn't know if it would work. And no I don't know every little intricacy about armas scripting language. As far as my "weird" half a code it was merely meant to be an example of a way i did know for sure would work sorry it wasn't the most efficient method and up to your standards of excellence.


  4. Here is another method of accomplishing this without using the "time" command and thereby avoiding any bugs it carries with it.

    Timer starts on server launch

    1. place an object somewhere in the world (doesn't matter what it is)
    2. give it a variable name(in this example "timer" without quotes)
    3. uncheck enable damage under object:special states to prevent it being destroyed by accident
    4. uncheck show model if you don't want it to be visible but that is optional
    5. place an empty marker where you want your trigger to be and give it a name (in this example "triggerlocation" without quotes)
    6. put whatever code you want the trigger to execute into a script (in this example "script.sqf")
    7. place a trigger somewhere in the world. type = none, activation = none, check server only to prevent it possibly executing multiple times
    8. in the condition field put "alive timer"(no quotes)
    9. in the activation field place the code located below
    10. in the trigger timer section select timeout and enter the delay time you want in seconds in the min, mid, max boxes

    to start the timer when at least one player is present do the same as above starting on step 5 an put "count allplayers > 0"(no quotes) in the condition field of the trigger

    if (isServer) then {
    _trig1 = createTrigger["EmptyDetector", getmarkerpos "triggerlocation"]; //creates a trigger at marker triggerlocation
    _trig1 setTriggerArea [10,10,-1,false];  //[x radius, y radius, z height, is rectangle]
    _trig1 setTriggerActivation ["WEST", "PRESENT", false]; //[by, type, repeating] check link below for more information
    _trig1 setTriggerStatements ["this", "execvm 'script.sqf'", "this"]; //[condition, activation, deactivation] all must have something in them
    };

    when the mission has been loaded for the amount of time you set in step 10 it will create a trigger that is activated upon BLUFOR present

    I would recommend checking command list for the syntax of the commands in the code should you want to change anything about the trigger being created


  5. try enclosing each getmarkerpos in parentheses () or brackets []

    _town = [(getMarkerPos "town_1"),(getMarkerPos "town_2"),(getMarkerPos "town_3"),etc.

    I don't know what i was thinking earlier it should have been like that to begin with.

     

    If that doesn't work then you may have to use a random/if statements combination

    _num = floor(random x);
    
    if (_num==0) then {	_town = getmarkerpos town_y	};
    if (_num==1) then {	_town = getmarkerpos town_y	};
    if (_num==2) then {	_town = getmarkerpos town_y	};

    where x = number of markers and y = marker number

    see getmarkerpos and Random for reference.

     

    I know the second method will work as i have used it for similar purposes but with the number of markers you have it's going to mean a good bit of copy paste and change numbers.


  6. I believe your problem is that _town is a variable and not a marker name so getmarkerpos can't actually get a location from it.

    try using

    private ["_telep"];
    _town = [getMarkerPos "town_1",getMarkerPos "town_2",getMarkerPos "town_3",getMarkerPos "town_4",getMarkerPos "town_5",getMarkerPos "town_6",getMarkerPos "town_7",getMarkerPos "town_8",getMarkerPos "town_9",getMarkerPos "town_10",getMarkerPos "town_11",getMarkerPos "town_12",getMarkerPos "town_13",getMarkerPos "town_14",getMarkerPos "town_15",getMarkerPos "town_16",getMarkerPos "town_17",getMarkerPos "town_18",getMarkerPos "town_19",getMarkerPos "town_20",getMarkerPos "town_21",getMarkerPos "town_22",getMarkerPos "town_23",getMarkerPos "town_24",getMarkerPos "town_25",getMarkerPos "town_26",getMarkerPos "town_27",getMarkerPos "town_28",getMarkerPos "town_29",getMarkerPos "town_30",getMarkerPos "town_31"] call BIS_fnc_selectRandom; 
    _Blu_Base = ["Task",_town,0,0,true,true] call LARs_fnc_spawnComp;

    I haven't tested this so i don't know if it will work but i believe it will


  7. I'm working on a project that i want to have cup weapons in but i don't want to use the default weapon firing sounds. I would like to replace them with my own sound files however i can not find any good information on how to do this. everything i have found has either been incomplete or so incomprehensible that it is useless. Not to mention every different "tutorial" or "guide" contains conflicting information to the previous one i found.

     

    Can anyone that knows how to do this possibly explain it please. Sample code would be appreciated as well.

     

    Thanks in advance for your assistance


  8. I'm working on a project that i want to have cup weapons in but i don't want to use the default weapon firing sounds. I would like to replace them with my own sound files however i can not find any good information on how to do this. everything i have found has either been incomplete or so incomprehensible that it is useless. Not to mention every different "tutorial" or "guide" contains conflicting information to the previous one i found.

     

    Can anyone that knows how to do this possibly explain it please. Sample code would be appreciated as well.

     

    Thanks in advance for your assistance


  9. I'm working on a project and one of the things I want to implement is removing the ability to change the attachments that are on a weapon. For instance if you pick up an MX that has an ACO and a flashlight and then pickup an MX that has a suppressor I don't want players to be able to take the suppressor off the second one and transfer it to the first one. Does anyone know if this is possible and if it is could you provide an example of how it is done or at least point towards the information I need to make this work.

     

    If this is not possible is there at least a way to limit what attachments can go on what weapons.

     

    I realize this sounds like a step backwards and in all honesty it is but for what i have in mind certain weapon/attachment combinations would break the balance i am trying to achieve.

     

    Thank you in advance for any assistance anyone is willing to provide.


  10. _num = floor(random 3);
    
    if (_num==0) then 
    	{
    		//spawn composition1
    	};
    if (_num==1) then
    	{
    		//spawn composition2
    	};
    if (_num==2) then
    	{
    		//spawn composition3
    	};

    this is the method i use for selecting code blocks at random i would recommend reading the wiki entry on random located at https://community.bistudio.com/wiki/random to understand the different types of output random can have. for instance in this instance floor(random 3) has an equal chance to output a number between 0 and 2. for what you want to do you would use random 5 and then if statements for 0-4


  11. the only real limit i have encountered to adding items to a player using virtual arsenal is the storage space of your uniform/vest/backpack. Once you have reached the storage limit of the inventory you are trying to add items to the virtual arsenal will no longer allow you to continue adding items. To the best of my knowledge it is not possible to add items to a player that would exceed the storage limit of said players inventories, at least not without a mod that remove storage limits. However i have no idea if a mod such as this even exists. When using scripts to add items to a player the script will add items one at a time to the desired inventory however if the inventory doesn't have enough free space the command to add the item to the inventory will silently fail(the item won't be added but you will also not receive errors or crashes,at least most of the time)

     

    and if i completely misunderstood your question i apologize.

     

    hope this helps.


  12. I don't like using the support module for certain situations because it is dependent on you placing a vehicle in the world from the start and if that vehicle happens to be destroyed you can no longer call for support unless they have changed it recently. But that is also a valid method of doing the same thing


  13. 2 hours ago, Commander Salamander said:

    The tank spawned 150 meters in the air and plummeted to the ground without any damage, although there weren't any parachutes. I suspect that the cause of this failure may be that there isn't any reference saved in my registry of animations/functions/calls for this:

    
    _tank call KK_fnc_paraDrop;

    Do I need to download and install the KK (Kill-zone-Kids) functions file if there is one?

    most likely you will need the files that contain that function as it is not in base game.
     

    Another method of doing this is to use create vehicle to create an airdrop parachute and then attach the tank to the parachute. I created a script that drops an equipment case in this manner when an aircraft i created reaches a certain waypoint.

     

    this is a simple example of how to create a tank and attach it to a parachute so it actually airdrops in.

    _chute = createvehicle ["i_parachute_02_f", [3723,4156,150],[],0,"can_collide"];
    _tank = createVehicle ["rhs_bmd2", [4863.116,9891.143,150],[],0,"can_collide"]; 
    _tank attachto [_chute,[0,0,2]];

    one thing to be aware of when using this method is that the airdrop will continue to fall until the chutes 0,0,0 point reaches ground level causing the item attached to it to sink through the terrain until the chutes 0,0,0 point reaches the ground and is deleted. Once the chute deleted items that have sunk through the terrain will spring back up to ground level. If the item is too far below terrain level it will spring back up with incredible force. This is why the tank is attached at 0,0,2 and not 0,0,0. I have tested this code and it does work although you may want to play with the point at which the tank is attached to the chute to get it to be exactly where you want it.

     

    With this method you cannot set the tanks direction however a solution to this would be to

    spawn the tank somewhere in the world

    set the tanks direction

    spawn the chute where you want it

    setposatl the tank to the chutes location

    attach the tank to the chute

    ???????

    profit

     

    If you would like copies of the scripts I wrote for the full airdrop sequence I created PM me.

     

    Hope this helps

    • Like 3

  14. 3 hours ago, UnDeaD. said:

    I have another problem, but this time its related to the loot. ( Luckily I managed to prevent my character from dying when joining the server, some scripts were messed up)

    Since the 1.70 update came in, I was not able to loot some "containers", especially the white ones that spawn mostly in military locations, and the white ones that look like a weapon case (or something like that). Anyone might wanna check it out?

     

    I reported this the day of the jets release and recieved a message back that they confirmed the problem. I do not have any information as to when it will be fixed but it has been brought to their attention.

     

    @haleks thanks for the info on the horde modules. I didn't try this because you have it listed as disabled in the original post and on armaholic, at least the last time i looked.

    • Like 2
×