Events/Listeners? Creeper/AntiCreeper count?

The Paul · 271

The Paul

  • Newbie
  • *
    • Posts: 4
on: November 22, 2019, 11:03:46 am
So thanks to the folks who threw me some tips and got my forum registration working over the discord, but I've got some further questions.

Looking through the CRPL reference there doesn't seem to be much in the way of listeners or event handles etc.  It looks like there's a "destroyed" function that gets called when and CRPLCore is destroyed (can I call that from existing objects like emitters and mortars?) but nothing for a weapon fires, creeper is destroyed, creeper is emitted, digitalis is destroyed, etc.

Is there a secret list of event handlers or something that isn't in the reference, or am I going to have to get creative?  Or, middle ground, are these all a bunch of problems that other people have already solved?

There also doesn't seem to be a built-in function to count all the creeper or anticreeper on the map.  I guess I could count and total every cell, but that seems a bit wildly inefficient.  Same questions as above, I guess.



Karsten75

  • Hero Member
  • *****
    • Posts: 6833
Reply #1 on: November 22, 2019, 12:09:55 pm
So thanks to the folks who threw me some tips and got my forum registration working over the discord, but I've got some further questions.

You're welcome, and we appreciate that you alerted us to a problem that was holding back a number of registrations.

Quote

Looking through the CRPL reference there doesn't seem to be much in the way of listeners or event handles etc.  It looks like there's a "destroyed" function that gets called when and CRPLCore is destroyed (can I call that from existing objects like emitters and mortars?) but nothing for a weapon fires, creeper is destroyed, creeper is emitted, digitalis is destroyed, etc.

Is there a secret list of event handlers or something that isn't in the reference, or am I going to have to get creative?  Or, middle ground, are these all a bunch of problems that other people have already solved?

I can only speak to the CRPL portions of your question, not for some of the highly complex code some of the maven coders coded.

There are no event handlers or listeners - there is no "secret list" of undocumented APIs (at least not in CW3) - this isn't Windows! :)

Quote
There also doesn't seem to be a built-in function to count all the creeper or anticreeper on the map.  I guess I could count and total every cell, but that seems a bit wildly inefficient.  Same questions as above, I guess.

Yep, another thing that will be there in CW4 that's missing from the CW3 repertoire.

"Any leftover cabbage can and will be mixed with mayo"
   - Cole's Law


The Paul

  • Newbie
  • *
    • Posts: 4
Reply #2 on: November 22, 2019, 12:33:28 pm
There are no event handlers or listeners - there is no "secret list" of undocumented APIs (at least not in CW3) - this isn't Windows! :)

Hah.  I guess it's only expensive professional software that comes in a big ball of undocumented mystery, and indy coders show their work.