Results 1 to 8 of 8

Thread: Script not activated in CfgWeapons

  1. #1
    Hello all, real quick config question here.

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    class CfgWeapons
    {
    class Default {};
    class CarHorn&#58; Default {};
    class SportCarHorn&#58; CarHorn {};
    class NewHorn&#58; SportCarHorn
    {
    displayName=&#34;Scream&#34;;
    drySound&#91;&#93;={&#34;&#92;scripts&#92;sound.og g&#34;,30.0,1};
    condition = &#34;player in this && alive this&#34;;
    statement = &#34;&#91;this&#93; exec &#34;&#34;&#92;scripts&#92;script.sqs&#34;&#34;&#3 4;;
    };
    };[/QUOTE]

    Could someone explain why that script &#92;scripts&#92;script.sqs isnt being activated even tho the condition is being met?
    I just need a script to be activated when that NewHorn weapon is used in a vehicle.

    Also, why can I see "blinking = true" in some BI made scripts, but when I put it into my own light class or reflector class, it does nothing?
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    class Reflectors {
    class Left {
    color&#91;&#93; = {0.1, 0.1, 1, 1};
    ambient&#91;&#93; = {0.5, 0.5, 0.5, 1};
    position = &#34;konec L svetla&#34;;
    direction = &#34;konec L svetla&#34;;
    hitpoint = &#34;L svetlo&#34;;
    selection = &#34;L svetlo&#34;;
    size = 0.2;
    brightness = 0.25;
    blinking = true;
    };
    [/QUOTE]




  2. #2
    Quote Originally Posted by [b
    Quote[/b] ]condition = "player in this && alive this";
    statement = "[this] exec ""&#92;scripts&#92;script.sqs""";
    You can&#39;t execute scripts from a weapon that way. Normally you would use a fired event handler, but that won&#39;t work either, with the default car horn.

    You might be able to re-configure your own car horn to work with the event handler, but I&#39;ve never tried it. So unless someone else can help, you may be out of luck?

    Quote Originally Posted by [b
    Quote[/b] ] Also, why can I see "blinking = true" in some BI made scripts, but when I put it into my own light class or reflector class, it does nothing?
    Have you defined the variable true, in your config?

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#define true 1;[/QUOTE]

    If not, try this:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> blinking = 1;[/QUOTE]

  3. #3
    Staff Sergeant nullsystems's Avatar
    Join Date
    Jun 5 2007
    Location
    Liverpool
    Posts
    329
    Author of the Thread
    Aye, I understand what your saying there.
    Its a shame about that.

    Blinking, well I just checked and I have the define...and ive also tried the 1 method. Its just simply not working.

    In the configs for UH60 and Road Sign Small ( two examples ) it has

    class MarkerLights {
    class RedBlinking {
    blah;
    blah;
    blinking = 1;
    };
    };

    No reflector class or light class...Just those.
    I tried putting that in, but nothing happened...thats REALLY odd.

    Do you think it could be assigned to AIR and STATIC only?

  4. #4
    It&#39;s defined in Bin.pbo under class AllVehicles. But I&#39;ve only seen it used in buildings.pbo, so you might be right about it only applying to a certain class?

    It is possible to do the same thing with a script, using the lightAttachObject command.

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Vehicle=_This Select 0;

    _light = &#34;#lightpoint&#34; createVehicleLocal &#91;0,0,0&#93;;

    _light lightAttachObject &#91;_Vehicle,_Vehicle selectionPosition &#34;L svetlo&#34;&#93;;
    _light setLightAmbient&#91;0.0, 1.0, 0.0&#93;;
    _light setLightColor&#91;0.0, 1.0, 0.0&#93;;

    WaitUntil
    *** *** *** ***{
    *** *** *** ***_light setLightBrightness 1.0;

    *** *** *** ***Sleep 1;

    *** *** *** ***_light setLightBrightness 0;

    *** *** *** ***Sleep 1;

    *** *** *** ***&#33;&#40;Alive _Vehicle&#41;
    *** *** *** ***};

    lightDetachObject _light;

    DeleteVehicle _Light;
    [/QUOTE]

  5. #5
    i tryed this out but keep getting error msg




    bean looking for a blue flashing light for a wil got blue not got flash (script code not my hot point )

    bk1276
    What Is A Veteran?
    A 'Veteran' -- whether active duty, discharged, retired, or reserve --
    is someone who, at one point in his life, wrote a blank check made
    payable to his country for an amount of 'up to, and including his life.'

  6. #6
    managed to get it working ok stupid thing it was was useing SQS instead of SQF.


    just goes to show you what a letter can do


    UNN

    thank you lovely little script


    bk1276

  7. #7
    Staff Sergeant nullsystems's Avatar
    Join Date
    Jun 5 2007
    Location
    Liverpool
    Posts
    329
    Author of the Thread
    lol UNN you read my mind. Just checked the post you made and had it setup like that yesterday.

    Its a shame you cant impliment the blinking function, but we always find a way

    While the reflector class would of been nice to use for the function I need, an "orb" of light will do fine I suppose lol

  8. #8
    Quote Originally Posted by [b
    Quote[/b] ]lol UNN you read my mind. Just checked the post you made and had it setup like that yesterday.

    Its a shame you cant impliment the blinking function, but we always find a way.
    Yeah, it would be better if we could do all this within the configs. Plus the light source you get with that command, does not work well over large areas. But something is better than nothing.

    Glad it came in handy for you, bk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •