Jump to content

semedar

Member
  • Content Count

    65
  • Joined

  • Last visited

  • Medals

Posts posted by semedar


  1. Just tried it and didn't work.


    _light = "#lightpoint" createVehicleLocal position C130;

    while { true } do
    {
    _light setLightBrightness 25;
    _light setLightAmbient[0.0, 0.0, 0.0];
    _light setLightColor[0.2, 0.5, 0.3];
    _light lightAttachObject [C130, [0,0,0]];
    Sleep 3;
    _light setLightBrightness 0;
    };
    [/Code]

    Edit: I fixed it, it just needed another Sleep after setting the brightness to 0.

    [Code]
    _light = "#lightpoint" createVehicleLocal position C130;

    while { true } do
    {
    _light setLightBrightness 25;
    _light setLightAmbient[0.0, 0.0, 0.0];
    _light setLightColor[0.2, 0.5, 0.3];
    _light lightAttachObject [C130, [0,0,0]];
    Sleep 1;
    _light setLightBrightness 0;
    Sleep 1;
    };
    [/Code]


  2. Hah, that seems to have done it! Thanks. :)

    Wonder why it needs to be so bright when it's bright enough at ground level. :confused:

    ---------- Post added at 02:52 PM ---------- Previous post was at 01:11 PM ----------

    Ok, I'm trying to make the light blink and I tried creating a light, attaching it to the C130, detaching it, and attaching it to another object but I can't seem to get it to work.

    _light = "#lightpoint" createVehicleLocal position C130;
    
    while { true } do
    { 
    _light setLightBrightness 25;
    _light setLightAmbient[0.0, 0.0, 0.0];
    _light setLightColor[0.2, 0.5, 0.3];
    _light lightAttachObject [C130, [0,0,0]];
    Sleep 3;
    _light lightDetachObject [C130, [0,0,0]];
    _light lightAttachObject [C130_Off, [0,0,0]];
    };
    

    When I try to just create a light it works:

    _light = "#lightpoint" createVehicleLocal position C130;
    _light setLightBrightness 25;
    _light setLightAmbient[0.0, 0.0, 0.0];
    _light setLightColor[0.2, 0.5, 0.3];
    _light lightAttachObject [C130, [0,0,0]];
    

    I've also tried to delete the light and creating it but can't seem to get that to work.

    C130Light = true;
    
    while { C130Light } do
    {
    _C130Light = "#lightpoint" createVehicle getPos C130;
    _C130Light setLightBrightness 25;
    _C130Light setLightAmbient[0.0, 0.0, 0.0];
    _C130Light setLightColor[0.2, 0.5, 0.3];
    _C130Light lightAttachObject [C130, [0,0,0]];
    Sleep 3;
    _C130Light lightDetachObject [C130, [0,0,0]];
    deleteVehicle _C130Light;
    }
    


  3. I have a static C-130 with a height of 5000 where I para down to the town/target but I can't seem to place any lights up there. I've tried the gamelogic way as I always have but I can't get any lights up there. :confused:

    Gamelogic Way:

    Game logic init:

    light = "#lightpoint" createVehicleLocal position this;
    light setLightBrightness 0.2;
    light setLightAmbient[0.0, 0.0, 0.0];
    light setLightColor[0.2, 0.5, 0.3];
    light lightAttachObject [this, [2,1,2]];
    this setPos [getPos this select 0, getPos this select 1, [color="Red"]5000[/color]];

    Anyone help me out? If possible, it would be awesome if it was either green or red and it blinks. But if it's impossible to blink, that's ok. :rolleyes:


  4. So I made a mission where I have this:

    ["<t size='.5'>[ <t color='#4E7906'>Weapons</t> | <t color='#2265BC'>Ammo</t> | <t color='#8A896A'>Backpacks</t> ]",position Ammobox,15,0] spawn bis_fnc_3Dcredits;
    ["<t size='.5'>[ <t color='#D10000'>Field</t> <t color='#BDDFB5'>Hospital</t> ]",position MedTent,15,0] spawn bis_fnc_3Dcredits;
    ["<t size='.5'>[ <t color='#808080'>SATCOM</t> ]",position UAV,15,0] spawn bis_fnc_3Dcredits;
    ["<t size='.5'>[ <t color='#4A4A31'>Heavy Equipment</t> ]",position HeavyEquip,15,0] spawn bis_fnc_3Dcredits;
    
    

    In a script ".sqf". When I try my mission out in the editor, I can see it, but once I host a game, it doesn't show any no one can see the text.

    Anyone help me out? :confused:


  5. How would I add a sideChat feature to it so every time I kill someone, it plays a random sound AND the person who killed the enemy would say something like: "Tango Down" along with a sound file I have that says exactly that. I thought it would be simple to just put something like this:

    waitUntil {!(isNil "bis_fnc_init")};
    _responses = [["GotHim","Got Him!"],["Contact","Contact!"],["TangoDown","Tango Down!"],["BingoBingo","Bingo Bingo!"],["ThreatNeutralized","Threat Neutralized!"]];
    _indx = floor random 3;
    playsound ((_responses select _indx) select 0);
    player sidechat ((_responses select _indx) select 1);
    

    But everyone says the response (assuming they're an actual player). And if an AI kills an enemy, it will make me say the response. I just want the killer to say the response.

    tl:dr: How would I be able to make the killer say the response but everyone else be able to hear the sound file?


  6. Try this instead mate.....

    {_x addEventHandler ["killed", "([color="Red"]_this[/color]) execVM ""KillSoundTest.sqf"""]} forEach thisList;

    EDIT: Actually I"m not sure that will work...but it's 3:30 am.... I'll catch ya tomorrow!

    That worked to execute an .sqf but still can't figure out how to do the sideChat feature. =\ I got it to play a random sound but not the sideChat bit. :386:

    KillSound_Test.utes


  7. Download the demo mission above...it's all there. It's the exact same code I'm going to give you anyway! Just replace my sound and text with your sound and text.

    Also...pay attention to how the script is being called (look in the East group leaders init). You seem to be calling an .sqs script. My scripts and all newer scripts are .sqf and called with execVM.

    Stick with .sqf as it is newer, more efficient and better.

    Aye, in my post it shows I'm using .sqf now instead of my previous .sqs.

    But I'm trying to call this script with one single trigger to add all the OPFOR an event handler to have them call the script one they're killed. I don't want to put an execVM in all my OPFOR units in the mission. And all my units in my existing mission aren't in any group whatsoever. So I don't want to create a unique group for each unit in the mission because that'll be inefficient.

    IE: foxmist1, foxmist1_1, foxmist1_2, foxmist1_3, foxmist1_4, foxmist1_ect..

    Also, I've changed

    {_x addEventHandler ["killed", "(_this select 1) [b]exec[/b] ""KillSoundTest.sqf"""]} forEach thisList
    

    to

    {_x addEventHandler ["killed", "(_this select 1) [b]execVM[/b] ""KillSoundTest.sqf"""]} forEach thisList
    

    In the trigger On Act and ArmA doesn't really like that and doesn't even call in the script when it did before. :confused: Lol

    Basically, all I'm trying to do is have this script have the ability to also do a sideChat feature as to the one you posted:

    http://www.semedar.com/arma-scripts/killsound


  8. You still have some errors....

    You forgot the underscore in _responses.... and you didn't assign anything to _response1, _response2, _response3!

    _response1 = "sound10";

    _response2 = "sound11";

    _response3 = "sound12";

    But then...hang on a second!. You don't need _response1, _response2 and _response3 at all if you just use the actual sound itself.

    _target = _this select 0;
    _killer = _this select 1;
    
    [color="SeaGreen"]_responses[/color] = [[[color="Red"]"sound10"[/color],"He's down"],[[color="Red"]"sound11"[/color],"Eliminated"],[[color="Red"]"sound12"[/color],"Target down"]];
    
    _indx = 0;
    
    if (group _killer == foxmist1) then {
    _indx = floor random 3;
    playsound (_responses select _indx) select 0;
    _killer sidechat (_responses select _indx) select 1;
    };

    EDIT: OK... I made a demo for you. Works sweet! There's another error that I missed above and that is... The Eventhandler passes an array [victim,killer] to your script.... so to get the killer and the victim you have to extract them from the passed array like this:-

    [color="Red"]_array = _this select 0[/color];
    
    _target =[color="Red"] _array[/color] select 0;
    _killer = [color="Red"]_array[/color] select 1;

    I knew that all along but without testing I just did not see it.

    I'm wondering on how I could implement a part of that script into mine.

    I have something very similar set up to that, but I just want it to sideChat the responses to it and I don't know how.

    Also, there won't be any groups involved.

    My version:

    KillSound.sqs

    waitUntil {!(isNil "bis_fnc_init")};  
    _sound = ["GotHim","Contact","TangoDown","BingoBingo","ThreatNeutralized"] call bis_fnc_selectRandom;  
    playSound _sound;
    

    Trigger:

    Axis A/B: 999999
    Act: OPFOR (ONCE)
    Present
    Cond: True
    On Act:
    {_x addEventHandler ["killed", "(_this select 1) exec ""KillSound.sqs"""]} forEach thisList
    

    I came up with this, it works by playing the sounds but it just doesn't do the sideChat bit.

    My Attempt:

    Trigger:

    Axis A/B: 999999
    Act: OPFOR (ONCE)
    Present
    Cond: True
    On Act:
    {_x addEventHandler ["KILLED", "(_this select 1) exec ""KillSoundTest.sqf"""]} forEach thisList
    

    KillSoundTest.sqf

    waitUntil {!(isNil "bis_fnc_init")}; 
    
    _killer = player select 1; 
    _responses = [["GotHim","Got Him!"],["Contact","Contact!"],["TangoDown","Tango Down!"],["BingoBingo","Bingo Bingo!"],["ThreatNeutralized","Threat Neutralized!"]];
    _indx = floor random 3;
    playsound ((_responses select _indx) select 0);
    _killer sidechat ((_responses select _indx) select 1);
    exit
    


  9. The way I'm using it to place objects like that on my mission is as follows:

    Castle.sqf

    if(isServer)then{
    // Castle
    _castle = "Land_A_Castle_Bergfrit" createVehicle (position castle);
    
    // Stairs
    _stairs = "Land_A_Castle_Stairs_A" createVehicle (position stairs);
    
    // Walls
    _castlewall = "Land_A_Castle_Wall2_30" createVehicle (position castlewall);
    _castlewall2 = "Land_A_Castle_Wall2_End" createVehicle (position castlewall2);
    };

    With a Game logic named castle, stairs, castlewall, castlewall2 in the map to tell it where I want them.

    I just don't know how to rotate them. >_<


  10. Mission Init:

    strobeOn = player addAction ["MS-2000 On","strobeStart.sqf"];

    strobeStart.sqf: (Working Now)

    // strobeStart.sqf
    // By Semedar
    // Player Init: unit addAction ["MS-2000 On", "strobeStart.sqf"];
    
    player removeAction strobeOn;
    Sleep 0.1;
    strobeOff = player addAction ["MS-2000 Off", "strobeStop.sqf"];
    
    strobe = true;
    
    while { strobe } do
    { 
    _irstrobe = "NVG_TargetC" createVehicle getpos player;
    _irstrobe attachTo [player,[0,0,0.2],"neck"];
    Sleep 0.8;
    detach _irstrobe;
    deleteVehicle _irstrobe;
    Sleep 0.1;
    };
    
    WaitUntil{not isNull player};
    player addEventHandler ["killed", {strobe = false}];
    

    strobeStop.sqf: (Working Now)

    // strobeStop.sqf
    // By Semedar
    // Player Init: unit addAction ["MS-2000 Off", "strobeStop.sqf"];
    
    player removeAction strobeOff;
    Sleep 0.1;
    strobeOn = player addaction ["MS-2000 On","strobeStart.sqf"];
    
    strobe = false;
    
    detach _irstrobe;
    _irstrobe setPosATL [-10000,-10000,100000];
    deleteVehicle _irstrobe;
    

    Strobe_Test.utes.zip

    Edit: Fixed :D Reason being the actions were local Edited the script I posted in case someone wants to use it. :D


  11. you need to detach it first I guess

    Hah, it was that simple, huh? :D

    It worked, though! :D

    while { true } do
    { 
    _irstrobeplayer = "IRStrobe" createVehicle  getPos  player;
    _irstrobeplayer attachTo [player,[0,0,1],""];
    Sleep 15;
    detach _irstrobeplayer;
    _irstrobeplayer setPosATL [-10000,-10000,100000];
    Sleep 0.1;
    deleteVehicle _irstrobeplayer;
    Sleep 0.1;
    };
    

    Question now, though:

    1. How would I be able to start/stop this script via Action Menu
    2. How to stop it when the player dies

    ---------- Post added at 03:01 AM ---------- Previous post was at 02:26 AM ----------

    Would something like this work?

    // Strobe2.sqf
    // By Semedar
    // Player Init: p1 addAction [("<t color=""#FFFFFF"">" + ("Strobe") +"</t>"), "Strobe2.sqf"];
    
    strobe = true;
    
    while { strobe } do
    { 
    _irstrobeplayer = "IRStrobe" createVehicle  getPos  player;
    _irstrobeplayer attachTo [player,[0,0,2],""];
    Sleep 14.8;
    detach _irstrobeplayer;
    _irstrobeplayer setPosATL [-10000,-10000,100000];
    Sleep 0.1;
    deleteVehicle _irstrobeplayer;
    Sleep 0.1;
    };
    
    WaitUntil{not isNull player};
    player addEventHandler ["killed", {strobe = false}];
    


  12. setPos it to [-10000,-10000,100000] before you delete it

    Won't work either. :(

    while { true } do
    { 
    _irstrobeplayer = "IRStrobe" createVehicle  getPos  player;
    _irstrobeplayer attachTo [player,[0,0,2],""];
    Sleep 10;
    [b]_irstrobeplayer setPosATL [-10000,-10000,100000];[/b]
    deleteVehicle _irstrobeplayer;
    };

    My test mission:

    Strobe_Test.utes.zip


  13. Hi,

    if attachTo doesn't work, you can use this alternative:

    stroboDrop = false;
    _irstrobe = "IR_Strobe_Marker" createVehicle (getPos  player);
    
    while {!stroboDrop} do { 
    _irstrobe setpos [(getPos player select 0), (getPos player select 1), 1];
    _irstrobe setDir (getDir player);
    sleep 0.01;
    };
    
    _irstrobe setpos [(getPos player select 0), (getPos player select 1), 0];

    This way, to drop the strobo, you just have to set stroboDrop to true.

    stroboDrop = true;

    Then you can call it again, and so on.

    Tried yours but it just makes the strobe spawn and stay on the ground. :(

    I think we're going to have to send a bug report because I don't think we can move/delete/mess around with an IR Strobe once it's been "deployed". As in the model disappears and all it leaves behind is the strobe light.


  14. This is what I have so far. It works, but when you start to run, the strobe eventually detaches from the character and is stuck on the ground.

    //Strobe.sqf
    //By Semedar
    //Player Init: p1 addAction [("<t color=""#FFFFFF"">" + ("Strobe") +"</t>"), "Scripts\Player\Strobe.sqf"];
    
    while { true } do
    { 
    _irstrobe = "IR_Strobe_Marker" createVehicle  getPos  player;
    _irstrobe attachTo [player,[0,0,1],""];
    Sleep 5;
    deleteVehicle _irstrobe;
    };
    

    Edit: I found out it detaches when the model disappears but the strobe is still on. Anyone know how to make the strobe light follow the character?

    Edit 2: I also found out that the IR Strobe model disappears somewhere around 13-15 seconds. So maybe having it delete the IR Strobe and then creating a new one every 12-13 seconds?

    Another Edit: I can't seem to delete the IR Strobe that I created via createVehicle with deleteVehicle. Anyone help me here?


  15. Is there a way to addAction a player that will create an IR Stobe and attach it to said player?

    My goal: Player is in thick woods at night while buddy is flying overhead with a littlebird but doesnt want to kill me. So I scroll my action menu and select "Turn IR On" and an IR Strobe follows me everywhere I go until I die.

    This is the closest I found but it's for ACE, which I don't want to use:

    http://ace.dev-heaven.net/wagn/IR_Strobes+notes

    Something like this perhaps? Just an idea. :rolleyes:

    Player Init

     p1 addAction [("<t color=""#EEEE00"">" + ("Turn IR On") +"</t>"), "Scripts\IR_Strobe.sqf"];
    

    IR_Strobe.sqf

     _irstrobe = "ACE_IRStrobe_Object" createVehicle  getPos  p1;
     _irstrobe attachTo[p1,[0,0,0],""];
     ["ace_sys_irstrobe_aradd", [_irstrobe]] call CBA_fnc_globalEvent;
    

×