Home   Help Search Login Register  

Author Topic: ECP_EventHandlers  (Read 1476 times)

0 Members and 1 Guest are viewing this topic.

Offline Hannibal

  • Members
  • *
ECP_EventHandlers
« on: 18 Jan 2022, 14:08:33 »
I recently learned about the class and I had even more questions. I was tired of the default explosion from tank shells and stationary guns, and I decided to find explosion scripts after the shell hit the ground. What I liked most about the ECP redux mod. If there are still developers of this mod here, then I ask you to help me. If possible then I would like to use explosion scripts in my mod. The ECP redux mod is very complicated, but I found in the EventHandlers class in ECP Redux/config.cpp

class ECP_EventHandlers
{
   Init=ECP_EH_INIT
   Killed="_this call (ECP_resources select 42)"
   Hit="_this call (ECP_resources select 43)"
   Fired="_this call (ECP_resources select 41)"
   IncomingMissile="_this call (ECP_resources select 44)"
   getout="_this call (ECP_resources select 75)"
};


I need  Init=ECP_EH_INIT and Fired="_this call (ECP_resources select 41)"
These two things are responsible for the explosion effects after the tank/stationary gun is fired. I understand that "_this call (ECP_resources select 41)" is registered in the global init SQF where there should be a link to the ECP_resources select 41 scripts. But I did not find any of this. What scripts are responsible for this? What scripts are included in ECP_EH_INIT? And how do I port to another mod so that everything works? The questions may seem complicated, but I don't know who to turn to for help.
« Last Edit: 18 Jan 2022, 14:15:33 by Hannibal »

Offline RichUK

  • OFPEC Patron
  • ****
  • Have fun!
Re: ECP_EventHandlers
« Reply #1 on: 13 Feb 2022, 13:49:40 »
Hi Hannibal

I have just noticed your post.  I am sorry but I have not been using OFPEC so much recently, but wanted to show you that someone had seen it.

You have posted under OFP, but wonder if you really intended to do so under Arma, specifically related to Arma: Cold War Assault that is a recreation of the OFP content in the first version of Arma?

Although I used to help with the Editor's Depot, it was quite some years ago and I do not feel able to help you with specifics regarding the ECP Redux mod - sorry!

I found this info regarding the ECP Redux mod as used in Arma: Cold War Assault on Steam:

https://steamcommunity.com/app/65790/discussions/0/490123938434436953/

You might try and find someone on there, or other forums, with the knowledge to help you?

Cheers, Richard.




Offline Hannibal

  • Members
  • *
Re: ECP_EventHandlers
« Reply #2 on: 11 Jun 2022, 20:25:28 »
Hi. thanks for the answer. Unfortunately, the Steam community does not have the information I need. in fact, I just want to get scripts (scripts for projectile explosions) from this mod.
ESP Redux mod developers are "dead" and it's sad

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: ECP_EventHandlers
« Reply #3 on: 12 Jun 2022, 21:51:30 »
Why not just use the mod, much easier?  :dunno:

The codebase is quite horrible format wise so it's basically unreadable.
ECP_Resources is a absolutely massive array of codes, apparently all written basically on one single line. Seems to be defined in addons -> ECP_Effects -> ECPdatabase.ldf.sqf

Anyway, most of the codes call other code from within the same array so only way to find out is to manually extract each element from that array so that you can find what the 42, 43, 41 and so on reference to (and what other elements those codes might reference to).

ECP_INIT_EH is (from bin -> config.cpp)
Code: [Select]
"IF (format[{%1},ECP_path] == {scalar bool array string 0xfcffffef}) THEN { ECP_path = {\ECP_Effects\}; _this exec (ECP_path+{ECPinit.sqs});{_c = _x camcreate [0,0,0]} foreach [{ECP_MKII},{ECP_M61},{ECP_M67},{ECP_F1},{ECP_RGO},{ECP_RDG1},{ECP_ANM8},{ECP_ANM83},{ECP_M18Red},{ECP_M18Green}]}; _this exec (ECP_path+{init.sqs})"

Dunno about their licensing though, whether permission is needed to rip that thing apart.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Hannibal

  • Members
  • *
Re: ECP_EventHandlers
« Reply #4 on: 16 Jun 2022, 11:20:18 »
thanks for answers. I want to use only effects from this mod in ww2mp mod. yes, indeed the mod was created too complicated and it is impossible for a simple player to figure it out, but I managed to find out all the scripts involved in the explosion effects, and I didn’t understand anything else. I believe that there is no longer any copyright for this mod. The creators of the mod stopped getting in touch and everyone forgot about OFP

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: ECP_EventHandlers
« Reply #5 on: 16 Jun 2022, 21:15:03 »
It is possible to get the codes from that ECP_resources array, it's just very tedious work.
Basically you look for }, and press enter after the comma and do that for every element in the array.
Then you can count which code is the 41st element and so on. Just remember that count starts from 0 (so the first element is 0, second is 1 and so on).

As in the ECP_resources array goes like this basically
Code: [Select]
[{<some code 0>},{<some code 1>},{<some code 2>},{<some code 3>}]So you need to start separating those in some text file to one per line so that it looks like this
Code: [Select]
[
    {<some code 0>},
    {<some code 1>},
    {<some code 2>},
    {<some code 3>}
]
and count them (starting from zero) to get which one the select command selects.

When you have the codes then you basically need to make functions out of the codes and call them instead of the ECP_resources select XX stuff.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.