Combat Support module help

  1. 7 years ago

    I'm placing this code into the code area of the combat support module.

    _this addEventHandler ["fired", {_this spawn fnc_Track_Napalm}];

    I want this to be added to each arty piece. When the mission runs the code throws an error. When I put that code into an already placed units init field it dosent return an error. Any idea why it doesnt work when placed in the code section of the combat support module?

  2. well, what's the error? ^^

  3. the error says

    addEventHandler ["fired", {_this spawn fnc_Track_Napalm}........ error missing ;

    the is a star and a hash somewhere before the part that says fired also.

    In the original init I called the variable this not _this that's a typo

  4. remove the semicolon from the end of the code and try again.

  5. After removing the semicolon it returned a similar error.

  6. any ideas?

  7. I know it's frustrating Cobra but the devs have a lot going on right now. They don't miss any of the posts in here, I can assure you. I'm sure when someone has a chance they'll help you out the best they can.

  8. Alright, the combat support code part is a little bit weird.. Replace all instances of "_this" with "this". :D

  9. Can you post your full RPT please, thanks.

  10. Put this in your init.sqf

    CBR_fnc_addNapalmTracker = {
        _this addEventHandler ["fired", {
            _this spawn fnc_Track_Napalm;
        }];
    };

    then put the following in the CS code field

    this call CBR_fnc_addNapalmTracker;

    CS does some weird stuff preventing your code to work but the above should work around that. ^^

  11. When I try this work around it returns the error

    undefined variable in expression: CBR_fnc_addNapalmTracker

  12. Edited 7 years ago by marceldev89

    Try adding the function to the init for "ALiVE (required)" instead of init.sqf. (or the init field for the combat support module I guess)

  13. I dont receive the errors now , but the function dosent work. I've tried it in the combat support init and the required alive init. If I place on map artillery and set it up with the codes to make it work with combat support, then add the function call it works fine. I hope someday it will be possible to hand place all the pieces, group them, make them batteries bypassing the placement module . The individual placement modules are just too restrictive.

  14. So it's safe to assume that your issue has been resolved right now?

  15. It dosent work. I dont receive the error, but the function dosent work.

  16. It works if I put the function in the init of a hand placed arty piece that is synced and setup with the combat support module. Hand placed arty pieces do not work right though and do not fire the correct amount of rounds and cannot be setup with multiple pieces in a battery. Thats why im trying to get the function to work with module placed pieces. So they shoot and function properly.

  17. The method I posted above definitely works. I'd say that whatever fnc_Track_Napalm is doesn't work properly. ^^

  18. Edited 7 years ago by marceldev89

    Here's a mission showing that adding the event handler works just fine: https://www.dropbox.com/s/2qzeqvqhc17b0dm/cobra_arty_code.zip?dl=1 . Check ALiVE (Required) for the function and the arty module for the usage.

    Might also be a good idea to post whatever fnc_Track_Napalm is to pastebin.com .

  19. It was indeed a problem with some code in the mission init.sqf that was messing up the function. It works as intended with the battery and the combat support module after fixing the init. Thanks a million for all the help.

 

or Sign Up to reply!