Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Azraile on May 21, 2014, 11:07:28 PM

Title: victory conditions
Post by: Azraile on May 21, 2014, 11:07:28 PM
I'm trying to figure out how to set a vitory condition...

there a few maps I'm working on that have ideas i'm working on

map 1 - when all of a certen kind of CRPL core is gone and one is powered up fully.

map 2 - victory when shields are build in center places...

map 3 - victory when a certen core is powered up fully
Title: Re: victory conditions
Post by: Azraile on May 21, 2014, 11:15:28 PM
x.x sorry I thought I was posting this in coders corner x.x
Title: Re: victory conditions
Post by: planetfall on May 22, 2014, 06:13:10 AM
The map will only complete when all enemies are destroyed. So you will have to add an extra core, that cannot damaged by nullifiers, that detects these conditions, and when they are met, destroys all the enemies including itself.
Title: Re: victory conditions
Post by: Michionlion on May 22, 2014, 10:41:26 AM
Isn't there an explicit 'win mission' message, akin to the FailMission method?
Title: Re: victory conditions
Post by: Grayzzur on May 22, 2014, 11:16:51 AM
Not exactly. There's a "DestroyAllEnemyUnits" command which should effectively do the same thing. It's not documented on the wiki, but it takes no arguments and does pretty much exactly what it's name implies. I've had some situations where it doesn't cause a win condition, but it's possible that is due to some of my old test maps being bugged from older versions.
Title: Re: victory conditions
Post by: knucracker on May 22, 2014, 11:30:04 AM
DestroyAllEnemyUnits should do the trick most of the time I believe.  It destroys all units on the map that are target-able by nullifiers.
Title: Re: victory conditions
Post by: Grayzzur on May 22, 2014, 11:32:12 AM
So, unless you have some CRPL Cores that can't be destroyed by nullifers but are required for victory, that should do the trick then. If you do, it wouldn't be hard to destroy those manually in CRPL.
Title: Re: victory conditions
Post by: Karsten75 on May 22, 2014, 12:30:30 PM
Quote from: Grayzzur on May 22, 2014, 11:16:51 AM
Not exactly. There's a "DestroyAllEnemyUnits" command which should effectively do the same thing. It's not documented on the wiki, but it takes no arguments and does pretty much exactly what it's name implies. I've had some situations where it doesn't cause a win condition, but it's possible that is due to some of my old test maps being bugged from older versions.

And

Quote from: Azraile on May 21, 2014, 04:26:22 PM
the inhibitor image oddly isn't on the wiki

We should help Virgil to keep the wiki well-stocked. :) So instead of him sitting there wondering what time today will be the best time to release the new game on Kongregate, we can make a list of these things and he can fill in the omissions. :)