Victory condition not triggering

Started by Xeos, January 09, 2015, 06:50:09 AM

Previous topic - Next topic

Xeos

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

  • Back-up file
  • Come out of edit mode and save the game to a slot
  • click the text at the top and return to edit mode and finalise
  • Then come out of the game and go load & play the game in the Finalized worlds to completion but alas, no victory condition. The final dialogue box comes up though

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
A child of 5 could beat this map ... Go fetch a child of 5 !

Xeos

#1
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 :( 
A child of 5 could beat this map ... Go fetch a child of 5 !

Hubs

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.

Hubs

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
GetRunnerCount
SetUnitAttribute
GetDigitalis (If you want it to only work when connected to the network)

Xeos

#4
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.
A child of 5 could beat this map ... Go fetch a child of 5 !

Xeos

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 :(
A child of 5 could beat this map ... Go fetch a child of 5 !

Hubs

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.

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?

Xeos

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
A child of 5 could beat this map ... Go fetch a child of 5 !

Xeos

#8
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 :)
A child of 5 could beat this map ... Go fetch a child of 5 !

Xeos

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
A child of 5 could beat this map ... Go fetch a child of 5 !

Xeos

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 :(
A child of 5 could beat this map ... Go fetch a child of 5 !

Hubs

Oops, change this line to false:

SetUnitAttribute(self CONST_COUNTSFORVICTORY TRUE)


That should do the trick. Was the runner nest a default image?

Xeos

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
A child of 5 could beat this map ... Go fetch a child of 5 !

stdout

I'm looking forward to playing this map.

Hubs

Glad I could help :)  Can't wait to play it!