Knuckle Cracker

Creeper World 3 => Custom Map Discussion => Topic started by: Xeos on January 09, 2015, 06:50:09 AM

Title: Victory condition not triggering
Post by: Xeos on January 09, 2015, 06:50:09 AM
I have already made 2 PAC maps successfully and published them and I have been working on this new one for the last 3 days. I went through the same procedure before as the last 2 and for some reason, this map will not go to victory condition.
I have scoured the forums to find a solution and tried everything but to no avail :(

So this is what I do

This is very frustrating and I would appreciate your help very much as I have put so much work into this map and want to get it out there.

Any ideas or suggestions please? 
Regards
Xeos
Title: Re: Victory condition not triggering (Map Attached)
Post by: Xeos on January 09, 2015, 07:42:09 AM
This is the Map- I can still play it but it will not go to victory - It is pretty hard if you are not a seasoned PAC map player so I was really excited to get it out there :( 
Title: Re: Victory condition not triggering
Post by: Hubs on January 09, 2015, 08:42:28 AM
It's probably because of the runner nest at the bottom. For the game to trigger victory, all units with "CONST_COUNTSFORVICTORY" attribute must be destroyed. Can't remember if you can turn that off for runner nests. Try selecting it in edit mode and see if there is an option to turn it off.

PAC maps have a core called Abraxis and it is normally the only unit that has CONST_COUNTSFORVICTORY set to true. When the game detects all Abraxis units have been destroyed it displays the victory text, then destroys itself, thus making it so no units with CONST_COUNTSFORVICTORY are alive. Your runner nest is more likely preventing the final victory game trigger.
Title: Re: Victory condition not triggering
Post by: Hubs on January 09, 2015, 08:48:16 AM
If you can't turn off the runner nest victory condition and you still want to have runners, you'll probably need to create a crpl one. Check the forums - someone may have already made one. If not, you'll want to use some of these commands:

CreateRunner (http://knucklecracker.com/wiki/doku.php?id=crpl:docs:createrunner)
GetRunnerCount (http://knucklecracker.com/wiki/doku.php?id=crpl:docs:getrunnercount)
SetUnitAttribute (http://knucklecracker.com/wiki/doku.php?id=crpl:docs:setunitattribute)
GetDigitalis (http://knucklecracker.com/wiki/doku.php?id=crpl:docs:getdigitalis) (If you want it to only work when connected to the network)
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 09:25:18 AM
OK Hubs - thanks for coming back to me so quickly - i deleted the runner and then it worked properly - so I need to work out how to change the scripts to allow that to stay in ( I am a complete noob but I will trawl the forums) - I will try and work it out from your info above :)
Thanks again.
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 11:21:46 AM
I've been looking for a while now and can't find anything that will slot in - I don't have the skills to write my own script so I will have to abandon the idea for now and not publish the map :(
Title: Re: Victory condition not triggering
Post by: Hubs on January 09, 2015, 11:50:03 AM
The maps looks too good to abandon, so I wrote this:
$name: "RunnerNest"
$spawninterval: 60 # number of frames between spawns
$maxrunners: 20 # max number of runners spawned at a time by this core
$runnermovespeed: 2
$runnerhealth: 10
$runnerpayload: 100

# spawn timer must be 0, must have digitalis, and must not be at runner max
if(eq0(GetTimer1) gte(GetDigitalis(CurrentX CurrentY) 0.5) lt(GetRunnerCount <-maxrunners) and and)
CreateRunner(CurrentX CurrentY <-runnermovespeed <-runnerhealth <-runnerpayload)
SetTimer1(<-spawninterval)
endif

:awake
SetUnitAttribute(self CONST_COUNTSFORVICTORY TRUE)
SetUnitAttribute(self CONST_CREATEPZ TRUE)
SetUnitAttribute(self CONST_NULLIFIERDAMAGES TRUE)
SetUnitAttribute(self CONST_TAKEMAPSPACE TRUE)
SetUnitAttribute(self CONST_SUPPORTSDIGITALIS FALSE)


Create a new script file and copy that in. Then create a core and add the script to it and set the image to the runner nest. I think it's one of the built in options, but if not you can get the image here (http://knucklecracker.com/wiki/doku.php?id=cw3:units:enemy).

I haven't tested the code, so I can't gauruntee it will work. The top section contains all the variables that you can tweak to get the runners the way you want them. For max runners, I wouldn't go over 100 because it will probably bog down the map alot.

Quote from: Xeos on January 09, 2015, 10:18:17 AM
I have used a runner in my new map (THE DEVIOUS ARACHNID) as a logic gate - it isn't modified in anyway - it is how you play it normally in a conventional map and it i can see it being quite useful in a few ways if used as I have here.

How are you using it as a logic gate?
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 12:28:17 PM
Oh Wow that is amazing you did that  ;D Let me try and get it working now and if I can , then I will post it up .

The way I think about maps is to think in a sequential way. I want the player to plot a path around the map so I need to force them to have to do something in a particular order to achieve the desired result and progress. So I look to use features of the game to help me do that. I did that with the runner. Without giving to much away, you will see when you play it :)
So excited .. and thanks again so much yay :)
Cheers
Ian
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 12:43:53 PM
I did that and on the compile it said :-

RunnerNest.crpl: Line: 1: An input var must have some default value: $name:

Ok fixed it - it was to do with the way it was formatted with the space between the colon: and the number :) Ok , going to try it now :)
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 01:20:28 PM
Ok - I put it on the map and it produced runners but it still didn't go to victory :(
Anything else I can try please?
Thanks
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 01:31:59 PM
It works as it should in the game but it still will not go to the victory condition :( I set the counts for victory to off as well and it didn't make any difference :(
Title: Re: Victory condition not triggering
Post by: Hubs on January 09, 2015, 01:38:20 PM
Oops, change this line to false:

SetUnitAttribute(self CONST_COUNTSFORVICTORY TRUE)


That should do the trick. Was the runner nest a default image?
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 01:49:16 PM
It works :) Hubs I am so grateful for your help :) I can't thank you enough as I spent 3 full days and nights designing, building and testing this map. I hope peeps like it although it is on the hard side :)
Thanks again
Title: Re: Victory condition not triggering
Post by: stdout on January 09, 2015, 02:03:34 PM
I'm looking forward to playing this map.
Title: Re: Victory condition not triggering
Post by: Hubs on January 09, 2015, 02:20:46 PM
Glad I could help :)  Can't wait to play it!
Title: Re: Victory condition not triggering
Post by: Xeos on January 09, 2015, 03:19:00 PM
Its up and its hard .. I think :) Hope you like it   ;D
Title: Re: Victory condition not triggering
Post by: 4xC on January 09, 2015, 07:00:27 PM
A PAC map with Runner Nests instead of Spore Towers modified to spawn runners?

Someone has been making comparative leaps and bounds in this direction.
Title: Re: Victory condition not triggering
Post by: stewbasic on January 09, 2015, 07:59:41 PM
I think I can add a line to prevent normal enemy units interfering with victory... I'll include that in the next template update. Sorry it wasn't in time for your map... Hubs was just too fast ;)
Title: Re: Victory condition not triggering
Post by: Hubs on January 09, 2015, 08:56:50 PM
How would you do that other than destroying them at the end?  I have a sweet AET idea if you can make that work cleanly.
Title: Re: Victory condition not triggering
Post by: stewbasic on January 10, 2015, 03:44:46 PM
Quote from: Hubs on January 09, 2015, 08:56:50 PM
How would you do that other than destroying them at the end?  I have a sweet AET idea if you can make that work cleanly.
I was just planning to destroy them. I don't think people will be bothered by it after they win. If the appearance of the map at the end is considered important, I could add some dummy cores with the same image.
Title: Re: Victory condition not triggering
Post by: Hubs on January 10, 2015, 04:33:44 PM
Personally I wouldn't like them being destroyed, but I'm picky.  The custom runner nest was pretty easy to make. Only thing I would want to add is an AET. How hard would that be to make? Is there a command for the anti air zone?
Title: Re: Victory condition not triggering
Post by: stewbasic on January 10, 2015, 08:36:23 PM
I couldn't see any air exclusion CRPL commands on the wiki. If destroyed silently with an image over the top, I doubt anyone would even notice.