weedomatic 0 Posted August 23, 2007 What I could think of is that such top-classes are read-only -- if you mean it is not working as in "nothing happens". Could as well be other (minor) issues (your script(-s), the config, ...) which I did not spot ad hoc'ly or I do not know. Someone else? Cannot test anything atm. Share this post Link to post Share on other sites
dmarkwick 261 Posted August 23, 2007 Well it all works when I add the evenhandler by trigger, but not by config. So I assume the scripts re OK, but I'm fudging up the config somehow. By "works" I mean the smoke effects work, by "not work" I mean the game runs but no smoke effects. Share this post Link to post Share on other sites
.kju 3245 Posted August 23, 2007 try this <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches { class DMSmokeEffects { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAData"}; }; }; class CfgVehicles { class All; class AllVehicles: All { class eventhandlers { killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf"""; }; }; }; (hand over the complete _this i'd say) --- access setting from the main config: class CfgVehicles { access = 1; class All { access = 0; Quote[/b] ]0 ReadAndWrite additional values can be added1 ReadAndCreate only adding new class members is allowed 2 ReadOnly no modifications enabled 3 ReadOnlyVerified no modifications enabled, CRC test applied Share this post Link to post Share on other sites
dmarkwick 261 Posted August 23, 2007 OK, between the lot of us we got this thing to work many, many thanks for all help, I really appreciate it. Now I can release a new version of DMSmokeEffects that "just works" merely by having the addon. For reference, the eventual config looked like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches { class DMSmokeEffects { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAData","CATracked"}; }; }; class CfgVehicles { access = 0; class All { access = 0; }; class AllVehicles : All { class eventhandlers { killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf"""; }; }; }; Share this post Link to post Share on other sites
weedomatic 0 Posted August 23, 2007 Ty Q, hooray DM. Forgot to ask: What was/solved the last problem? Missing inheritance (added by Q in last code-snippet) or passing the complete handler-array (mod' by Q)? Share this post Link to post Share on other sites
dmarkwick 261 Posted August 23, 2007 Ty Q, hooray DM.Forgot to ask: What was/solved the last problem? Missing inheritance (added by Q in last code-snippet) or passing the complete handler-array (mod' by Q)? Can't really say inheritance etc is a bit of a mystery. I tried various variations of classes within classes, classes declared then referred to, classes with changed access codes. Eventually even a blind man must stumble out of a forest I found out through trial & error that a class declared can then be used as a base class for another class, but not if the class is nested within. Stuff like that. I have a model of activity in my mind about this, but I have no real knowledge of why these things happen One little problem I have since discovered, Helicopter classes no longer have the smoke effects, despite being under the AllVehicles class. Weird, since Car class and Tank class are OK. Share this post Link to post Share on other sites
dmarkwick 261 Posted August 23, 2007 Hmm weird. I haven't been able to get Helicopters (in fact any air vehicle) included with the AllVehicles class eventhandler addition, even though the Biki lists them as a sub-class. Does anyone know what base class is used when code like "foreach thislist" is used on a trigger? 'Cos aircraft were certainly included then. Share this post Link to post Share on other sites
.kju 3245 Posted August 23, 2007 a few thoughts: main config class Helicopter: Air dustEffect = "HeliDust"; waterEffect = "HeliWater"; damageEffect = "DamageSmokeHeli"; class Plane: Air damageEffect = "DamageSmokePlane"; sidenote: without having checked your implementation of the effects i'd say one should go mainly for editing these damageXXX definitions - i guess one could add a lot of additional effects via the build in effect system there. air.pbo config: (i guess thats it) class Helicopter: Air class EventHandlers{}; class Plane: Air class EventHandlers{}; so what you need to do is this: your cfgPatches needs to have this entry added: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches { class DMSmokeEffects { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAData","CATracked","CAAir","CAAir3"}; }; }; Share this post Link to post Share on other sites
dmarkwick 261 Posted August 24, 2007 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches{ class DMSmokeEffects { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAData","CATracked","CAAir","CAAir3"}; }; }; I tried that Q, (minus the CAAir3 but I tried that after I saw you suggest it) but still the Air vehicles still don't act the same way as the ground vehicles. All Air vehicles get the same piece of code executed as fuel trucks, and fuel trucks work OK. I can only assume the Air vehicles are not receiving their new eventhandler for some reason. It's maddening, because the eventhandler was being added to ALL units with no problems before when I used a trigger to add in on mission start. Share this post Link to post Share on other sites
.kju 3245 Posted August 24, 2007 well in the air.pbo config these two classes get an empty EH definition: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class EventHandlers{}; so if your addon doesn't overwrite this correctly, it is no miracle that it doesn't work. however the suggested cfgPatches change should do the trick. maybe switch the order of the requiredAddons entries. Share this post Link to post Share on other sites
dmarkwick 261 Posted August 25, 2007 maybe switch the order of the requiredAddons entries. Well I tried it, but it dint work Share this post Link to post Share on other sites
UNN 0 Posted August 26, 2007 Quote[/b] ]so if your addon doesn't overwrite this correctly, it is no miraclethat it doesn't work. however the suggested cfgPatches change should do the trick. Â maybe switch the order of the requiredAddons entries. I'm not sure if the required addons order will help in this case, as you pointed out the empty class definitions are the problem. I think DMarkwick will have to move up a class to get the events working. Add your events to the following classes, then you should be ok: LandVehicle Plane Helicopter Ship Man (if you want infantry to) I think that about covers it, but I may have missed some out? Share this post Link to post Share on other sites
dmarkwick 261 Posted August 26, 2007 Well I'm fucked if I can work it all out. I don't understand inheritance and quite frankly I'm too frigging pissed off to endlessly try out new config after new config. When it doesn't whine about something being wrong on bootup (which is most of the time) it whines about something else ingame. The whole lot is this close >< to being thrown out the window. The config I have now, that works for everything except aircraft, looks like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches { class DMSmokeEffects { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"CAAir", "CAAir3", "CAData","CATracked", "CAA10", "CaWheeled", "CaWheeled3"}; }; }; class CfgVehicles { access = 0; class All { access = 0; }; class AllVehicles : All { class eventhandlers { killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf"""; }; }; }; Share this post Link to post Share on other sites
UNN 0 Posted August 26, 2007 Try this, just to see if the aircraft work? (untested): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches     {     class DMSmokeEffects         {         units[] = {};         weapons[] = {};         requiredVersion = 1.08;         requiredAddons[] = {"CAAir", "CAAir3", "CAData","CATracked", "CAA10", "CaWheeled", "CaWheeled3"};         };     }; class CfgVehicles     {     class Air;         class Plane : Air         {         class eventhandlers             {             killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf""";             };         };     class Helicopter : Air         {         class eventhandlers             {             killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf""";             };         };     }; Share this post Link to post Share on other sites
.kju 3245 Posted August 27, 2007 yupp UNN, you are correct of course. Quote[/b] ]I'm not sure if the required addons order will help in this case, as you pointed out the empty class definitions are the problem.I think DMarkwick will have to move up a class to get the events working. --- the complete would like this. even though like UNN suggests, you might add the EH to the actual unit base classes like plane, helicopter, LandVehicle (car, tank), men, ship etc. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgPatches { class DMSmokeEffects { units[] = {}; weapons[] = {}; requiredVersion = 1.08; requiredAddons[] = {"CAAir", "CAAir3", "CAData","CATracked", "CAA10", "CaWheeled", "CaWheeled3"}; }; }; class CfgVehicles { class All; class Air; class AllVehicles : All { class eventhandlers { killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf"""; }; }; class Plane : Air { class eventhandlers { killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf"""; }; }; class Helicopter : Air { class eventhandlers { killed = "_this execVM ""DMSmokeEffects\Scripts\DMSmokeEffects.sqf"""; }; }; }; Share this post Link to post Share on other sites
dmarkwick 261 Posted August 27, 2007 Thanks guys Again, I appreciate it I will try out the suggested configs and let you know. Apologies for my flouncing, I'm not very good socially when I'm: Tired. Hungry. Needing the toilet. Flabbergasted. Any combination of the above. Share this post Link to post Share on other sites
dmarkwick 261 Posted August 27, 2007 Nice one guys, the supplied solution(s) work. Thanks very, very much Share this post Link to post Share on other sites