Jump to content

Holdenman5000

'a' encountered instead of '=' error

Recommended Posts

Im trying to repack a custom mod with arma 3 tools but im getting an error in line 14 for 'a' encountered instead of '='. The thing is that line 14 is blank...

 

Im very new to modding and scripting and would appreciate it if someone could take a look and provide some feedback. Thanks!

 

class CfgVehicles {
    class B_Plane_Fighter_01_F; // Base class for the Black Wasp

    class B_Plane_Fighter_01_StealthWasp : B_Plane_Fighter_01_F {
        scope = 2; // Set the scope to 2 to make the class accessible
        displayName = "Stealth Wasp"; // Display name
        radarTargetSize = 0.65; // Adjust these values as needed
        radarTargetSizeConc = 0.65;
        irTargetSize = 0.75;
        irTargetSizeConc = 0.75;

        // Laser Interception Script
        laserFiring = false;

        this addEventHandler ["FiredNear", {
            params ["_missile", "_shooter", "_distance"];

            // Check if the missile is targeting this vehicle
            if (vehicle _missile == _this) then {
                // Trigger laser firing sound
                _missile playSound3D "Explosion15";

                // Calculate the distance between the missile and this vehicle
                _missileDistance = _missile distance _this;

                // Check if the missile is intercepted (distance threshold can be adjusted)
                if (_missileDistance < 100) then {
                    // Trigger explosion particle effects
                    _missile spawn {
                        sleep 0.1;
                        deleteVehicle _this;
                    };
                    _this spawn {
                        sleep 0.5;
                        deleteVehicle _this;
                    };

                    // Play explosion sound
                    _this playSound3D "Explosion20";

                    // Apply any other gameplay effects

                    // Reset laserFiring state
                    laserFiring = false;
                };
            };
        }];

        while {true} do {
            // Sleep for a short duration before checking again
            sleep 0.1;
        };
    };
};

Share this post


Link to post
Share on other sites

I know very little with regards to vehicle configs but your method of adding eventHandlers to your vehicle is breaking your config

The "a" encountered instead of "=" is from the 'a' in addEventHandler

        this addEventHandler ["FiredNear", {

 

You'll need to add proper eventhandler subclasses and maybe even custom functions to get your code to work. Hopefully someone here will be able to correct your code for you as I have no clue.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×