OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Nemesis6 on 21 Jul 2004, 17:22:06

Title: Two eventhandlers for the same thing
Post by: Nemesis6 on 21 Jul 2004, 17:22:06
As simple as that! I'm trying to convert a .cpp file to .bin, but I'm getting an error among these lines -

Quote
      };
      class EventHandlers
      {
init = [_this,"M16","M16"] exec "\TACTEvents\onPlayerInit.sqs";    
hit = if (player == _this select 0) then {_this call TACTfuncHit};    
killed = if (player == _this select 0) then {_this exec "\TACTEvents\onPlayerDeathBlack.sqs"};  
fired = if (TACTWeaponFXinit) then {_this call TACTfuncFiredEH} && _this exec "\nmod_effects\backblast.sqs"
      };
   };

Now, it works as an editable .CPP file, but I cannot convert it to a .BIN file.

Help?
Title: Re:Two eventhandlers for the same thing
Post by: h- on 21 Jul 2004, 18:38:55
Code: [Select]
     };
      class EventHandlers
      {
init = "[_this,""M16"",""M16""] exec ""\TACTEvents\onPlayerInit.sqs""";  
hit = "if (player == _this select 0) then {_this call TACTfuncHit}";  
killed = "if (player == _this select 0) then {_this exec ""\TACTEvents\onPlayerDeathBlack.sqs""}";
fired = "if (TACTWeaponFXinit) then {_this call TACTfuncFiredEH}; _this exec ""\nmod_effects\backblast.sqs""";
      };
   };

Should work...
The cpp (c++) code is a bit different from the regular OFP sqs/sqf...

Why would you want to convert the cpp to bin...? There's no need to...

And the cpp to bin converter (what you are prolly using ??) is veeery picky what it converts and what it doesn't...
Title: Re:Two eventhandlers for the same thing
Post by: Nemesis6 on 21 Jul 2004, 18:51:40
You are a lifesaver! Thank you once again!