Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: First on February 16, 2014, 01:59:01 AM

Title: CRPLCORE - Taking damage from creeper
Post by: First on February 16, 2014, 01:59:01 AM
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
Title: Re: CRPLCORE - Taking damage from creeper
Post by: Flabort on February 16, 2014, 02:14:19 AM
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.
Title: Re: CRPLCORE - Taking damage from creeper
Post by: First on February 16, 2014, 02:27:30 AM
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...
Title: Re: CRPLCORE - Taking damage from creeper
Post by: pawel345 on February 16, 2014, 02:48:16 AM
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.