Jump to content

The smoking light is off ladies and gentlemen...


Grahame

Recommended Posts

smoking.jpg

Okay... it's post-Apocalypse... you really need a cigarette... And they can be rare loot ... worth a lot in a trade, but how do you add them to an A3E server? Easy, follow these easy steps.

(1) Add the Immersion (I always preferred it when it was Murshun... but... meh) Cigarettes mod to your server

https://steamcommunity.com/sharedfiles/filedetails/?id=753946944

(2) You need to permission some functions so others can see the smoke from your cigarettes. Add 

		class murshun_cigs_fnc_start_cig { allowedTargets=0; }; 
		class murshun_cigs_fnc_start_cig_your { allowedTargets=0; }; 
		class murshun_cigs_fnc_start_cig_his { allowedTargets=0; }; 
		class murshun_cigs_lighter_01 { allowedTargets=0; }; 
		class murshun_cigs_matches_01 { allowedTargets=0; }; 
		class murshun_cigs_matches_02 { allowedTargets=0; }; 
		class murshun_cigs_fnc_anim { allowedTargets=0; }; 
		class murshun_cigs_fnc_smoke { allowedTargets=0; }; 

to epoch_config/Configs/CfgRemoteExec.hpp in your mission file.

(3) Optional: if you enforce the use of a lighter to light fires then change lines 30-38 in epoch_code/compile/interface_event_handlers/EPOCH_handleUIActions.sqf from

	case (_actionName isEqualTo 'FireInflame'): {
		if!('lighter_epoch' in magazines player) then {
			_msg = 'You need a lighter';
			_blocked = true;
		}else{
			[player,'lighter_epoch',-1] call EPOCH_usedItemRepack;
			//[_actionObj] remoteExec ['EPOCH_server_addToFireSystem',2];
		};
	};

to:

	case 'FireInflame': {
		if (["CfgEpochClient", "ActionFireOnLighter", true] call EPOCH_fnc_returnConfigEntryV2) then {
			// New code to handle Murshun fire sources - lighters and matches
			if ('murshun_cigs_lighter' in magazines player) then {
					[player,'murshun_cigs_lighter',-1] call EPOCH_usedItemRepack;
					//[_actionObj] remoteExec ['EPOCH_server_addToFireSystem',2];
				} else {
					if ('murshun_cigs_matches' in magazines player) then {
						[player,'murshun_cigs_matches',-1] call EPOCH_usedItemRepack;
						//[_actionObj] remoteExec ['EPOCH_server_addToFireSystem',2];
					} else {
						_msg = 'You need matches or a lighter';
						_blocked = true;
					};
				};
			};
		};

(4) Now you need to add the addactions every time the player logs in so that they can take a cigarette out and light it, or light someone else's. Create a file called initPlayerLocal.sqf in the root of your mission file that contains the following (if you already have one then just add the four addactions to it):

if (!isDedicated and hasInterface) then 
{ 
	waitUntil {alive vehicle player};	
	waitUntil {typeOF player != "VirtualMan_EPOCH"};
	uisleep 15;	

	// Add Murshun Actions to the scrollwheel
    player addAction [localize "STR_murshun_cigs_start_cig", {params ["_target", "_caller"];[_caller] spawn murshun_cigs_fnc_start_cig_your}, nil, 0, false, true, "", "if (_target != player) exitWith {false}; ((goggles _this) in murshun_cigs_cigsArray) and (!(_this getVariable ['murshun_cigs_cigLitUp', false]))", 5, false];
	player addAction [localize "STR_murshun_cigs_stop_cig", {params ["_target", "_caller"];[_caller] spawn murshun_cigs_fnc_stop_cig}, nil, 0, false, true, "", "if (_target != player) exitWith {false}; ((goggles _this) in murshun_cigs_cigsArray) and ((_this getVariable ['murshun_cigs_cigLitUp', false]))", 5, false];
	player addAction [localize "STR_murshun_cigs_take_cig_from_pack", {params ["_target", "_caller"];[_caller] spawn murshun_cigs_fnc_take_cig_from_pack}, nil, 0, false, true, "", "if (_target != player) exitWith {false}; 'murshun_cigs_cigpack' in (magazineCargo uniformContainer player)", 5, false];
	player addAction [localize "STR_murshun_cigs_start_someones_cig", {params ["_target", "_caller"];[cursorObject, _caller] spawn murshun_cigs_fnc_start_cig_his}, nil, 0, false, true, "", "if !(cursorObject isKindOf 'Man') exitWith {false}; ((goggles cursorObject) in murshun_cigs_cigsArray) && (!(cursorObject getVariable ['murshun_cigs_cigLitUp', false])) && (alive cursorObject)", 5, false];
};

Finally just add the following classes into your trader price lists (and spawn them as rare Epoch and mission loot as you'd like):

    class murshun_cigs_cigpack { price = 100; };	// Beautiful, wonderful Murshun cigarettes, pack of 20
    class murshun_cigs_matches { price = 5; };		// Pack of matches
    class murshun_cigs_lighter { price = 20; };		// Zippo
    class immersion_pops_poppack { price = 5; };	// Lollipops

And remove the Epoch lighter (which won't work with Murshun without a client side preinit function... :ph34r:

That's it. RePBO your mission file and upload to your server...

Link to comment
Share on other sites

Mine is cheap and dirty, but without mod:

Connect script:

init.sqf

blaze_it = compileFinal  preprocessFileLineNumbers "addons\blazeit.sqf";

Bring the smoke:

addons/blazeit.sqf

disableUserInput true;
closeDialog 0;
hint "...that makes me feel alright!";
_smoke = createVehicle ["SmokeShell", position player, [], 0, "NONE"];  
_smoke attachTo [player, [-0.03,0,0.7]];
uisleep 40;
disableUserInput false;

make Action Menu (Press Space) work+connect with Hemp

\epoch_config\Configs\CfgActionMenu\CfgActionMenu_self.hpp

   
	class smoke
{    
    condition = "!dyna_inVehicle && InSafeZone";
    action = "if !('ItemKiloHemp' in magazines player) exitwith {['Get atleast one kilo of hemp to smoke...who needs less?',5] call Epoch_Message;};[] spawn{ player playMove 'amovpsitmstpsnonwnondnon_smoking';uisleep 2;call blaze_it;['Great stuff ...',5] call Epoch_Message;0.9 call epoch_setDrunk;player removeitem 'ItemKiloHemp';};";
    icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
    tooltip = "Smoke Weed";
};
	

 

Link to comment
Share on other sites

I'll find the script I modded from A2 to A3 for visual and animation effects specifically for weed smoking if you'd like. Basically it was the old A2 one with just the player animations changed (since the A2 ones don't exist in A3). Worked pretty well, rolling around on the ground with psychedelic visual effects :cool:

Link to comment
Share on other sites

On 5/24/2018 at 9:56 AM, Tarabas said:

Mine is cheap and dirty, but without mod:

Connect script:

init.sqf


blaze_it = compileFinal  preprocessFileLineNumbers "addons\blazeit.sqf";

Bring the smoke:

addons/blazeit.sqf 


disableUserInput true;
closeDialog 0;
hint "...that makes me feel alright!";
_smoke = createVehicle ["SmokeShell", position player, [], 0, "NONE"];  
_smoke attachTo [player, [-0.03,0,0.7]];
uisleep 40;
disableUserInput false;

make Action Menu (Press Space) work+connect with Hemp

\epoch_config\Configs\CfgActionMenu\CfgActionMenu_self.hpp


   
	class smoke
{    
    condition = "!dyna_inVehicle && InSafeZone";
    action = "if !('ItemKiloHemp' in magazines player) exitwith {['Get atleast one kilo of hemp to smoke...who needs less?',5] call Epoch_Message;};[] spawn{ player playMove 'amovpsitmstpsnonwnondnon_smoking';uisleep 2;call blaze_it;['Great stuff ...',5] call Epoch_Message;0.9 call epoch_setDrunk;player removeitem 'ItemKiloHemp';};";
    icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
    tooltip = "Smoke Weed";
};
	

 

I get this error:

 

12:53:26 Error in expression <_cur_mp.Altis\addons\blazeit.sqf"
disabl#eUserInput true;
closeDialog 0;
hint >
12:53:26   Error position: <#eUserInput true;
closeDialog 0;
hint >
12:53:26   Error Missing ;
12:53:26 File mpmissions\__cur_mp.Altis\addons\blazeit.sqf, line 1
12:53:26 Error in expression <_cur_mp.Altis\addons\blazeit.sqf"
disabl#eUserInput true;
closeDialog 0;
hint >
12:53:26   Error position: <#eUserInput true;
closeDialog 0;
hint >
12:53:26   Error Missing ;
12:53:26 File mpmissions\__cur_mp.Altis\addons\blazeit.sqf, line 1

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...