Events/Listeners? Creeper/AntiCreeper count?

Started by The Paul, November 22, 2019, 11:03:46 AM

Previous topic - Next topic

The Paul

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

Quote from: The Paul 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.

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.

The Paul

Quote from: Karsten75 on November 22, 2019, 12:09:55 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.