CRPLCORE - Taking damage from creeper

Started by First, February 16, 2014, 01:59:01 AM

Previous topic - Next topic

First

I would like to use a CRPLCORE unit as a friendly unit, but can't figure out how to get it take damage from creeper using the native code (ie. without implementing it in crpl).

Is it possible? Eg. CONST_TAKESCREEPERDAMAGE or some such.

Help!

- First

Flabort

A brief check shows no constants that govern this, or commands directly related.
Or for responding to any Enemy Units in a similar matter to player units; For example, there is no CONST_RUNNERTARGET, CONST_PLAYERUNIT (for GetEnemyUnitsInRange vs GetUnitsInRange), or any commands for an interface window (with deactivate, disarm, and packet-control buttons, plus unit specific commands).

The first two constants, plus TAKESCREEPERDAMAGE, should be easy enough, I would imagine, for V to implement. The interface commands would probably be a lot harder to put together. Maybe?

All of them, except PLAYERUNIT, can be done using crpl, if you're clever enough. I imaging that the interface-window stuff would make heavy use of disabling regular controls and re-enabling them.
My maps: Top scores: Sugarplum, Cryz Dal, Cryz Torri, Cryz Bohz (Click fetch scores, page courtesy of kwinse)

First

The GetCreeper / Damage commands can be used in crpl, but the native implementation is so well done that it would feel like a poorly conceived hack...

pawel345

There probably will not be a specific command to do this, as this is easily done using such script:

CurrentCoords GetCreeper 0 lt if
Self CONST_HEALTH Self CONST_HEALTH GetUnitAttribute <-damage sub SetUnitAttribute
endif

The CRPL is there to use it. That's the point of it, so that V doesn't have to implement stuff using the native code, we can code our ideas in a way that we want them to. This way it's much more versatile.