Alternate victory conditions

Started by planetfall, February 16, 2014, 11:30:42 AM

Previous topic - Next topic

planetfall

What I'm trying to do is as follows:

1. Core takes up a large amount of map space (is "shielded")
2. When all "corrupted totems" are destroyed, it stops taking map space and begins a countdown.
3. If the countdown ends, the player fails.
4. If the player lands a command node on the core before the countdown ends, all enemies on the map blow up and the player wins.

I have 1-3 working perfectly... but when the command node lands, everything dies, but the map doesn't complete. I reopen the map in the editor, and look at everything left... there are some crplcores left, but they have COUNTSFORVICTORY set to false.

I've tried both destroying the core and disabling its COUNTSFORVICTORY... neither works (though I've decided that the latter achieves more the visual effect I want, since I want an image drawn over the command node.)

Le code:

once
Self "hole" "Custom3" SetImage
Self "hole" 0.1 SetImagePositionZ
Self "hole" 4 4 SetImageScale
11 ->countdown
endonce

#Change color, rotation and size

Self "hole" GetImageRotation ->rotation
Self "hole" <-rotation 0.03 add SetImageRotation
Self "hole" <-rotation sin 1 add 127 mul 0 255 255 SetImageColor
Self "hole" <-rotation sin 2 div 4 add <-rotation sin 2 div 4 add SetImageScale

#Create mist to mask my awful sprites

GetTimer0 eq0 if
5 -4 do
5 -4 do
1 10 RandInt 1 eq if
I J 0 0 Distance 5 lte if
I CurrentX add J CurrentY add CellToPixel -0.2 <-rotation sin 1 add 127 mul 0 255 CreateMist
endif
endif
loop
loop
3 SetTimer0
endif

#Stop doing victory-related stuff if disable is set

<-disable if
return
endif

#Shield becomes more transparent as totems are destroyed

"Corename" "CorruptedTotem" GetCoresWithVar ->count ClearStack
Self "main" 255 255 255 <-count 21 mul SetImageColor

<-count eq0 if
CurrentCoords 8 GetUnitsInRange 0 do
GetUnitType "COMMANDNODE" eq if
#Victory has been achieved. Destroy all enemies and set self to no longer count for victory
0 0 999 GetEnemyUnitsInRange 0 do
->uid
<-uid CONST_COUNTSFORVICTORY GetUnitAttribute <-uid GetUnitType "CRPLCORE" neq or <-uid Self neq and if
<-uid 2 Destroy
endif
loop
Self "hole" -5 SetImagePositionZ
Self CONST_COUNTSFORVICTORY 0 SetUnitAttribute
"" SetText
1 ->disable
endif
loop
Self CONST_TAKEMAPSPACE 0 SetUnitAttribute
11 <-countdown eq if
"Misc0" PlaySound
endif
GetTimer1 eq0 if
<-countdown 1 sub ->countdown
"Retro23" PlaySound
<-countdown SetText
5 SetTextSize
"UpperCenter" SetTextAnchor
255 <-countdown 25 mul 0 255 SetTextColor
30 SetTimer1
endif
<-countdown eq0 if
"TotemExplosion" PlaySound
ClearConversation
0 "Nooo!! The wormhole collapsed!" AddConversationMessage
ShowConversation
PauseGame
CurrentCoords CellToPixel SetCameraPosition
1 Delay
FailMission
Self 0 Destroy
endif
else
#The totems are still there, reset the countdown
"" SetText
Self CONST_TAKEMAPSPACE 1 SetUnitAttribute
<-countdown 11 neq if
11 ->countdown
"Weapons28" PlaySound
endif
0 SetTimer1
endif


So what, exactly, am I doing wrong?
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Clean0nion

Your issue is that the destruction of all units does not cause a win. Many have experienced this problem before.

planetfall

Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

pawel345

Make sure there are no message artefacts and techs on the map. Map doesn't count as completed if there is anything on map.

Clean0nion

Quote from: planetfall on February 16, 2014, 11:50:53 AM
And the solution to this issue?
There is none. It's an issue many of us have had to deal with.

planetfall

Quote from: pawel345 on February 16, 2014, 12:59:29 PM
Make sure there are no message artefacts and techs on the map. Map doesn't count as completed if there is anything on map.

None of those present at all. I did accidentally place a shield key and then delete it, would that maybe be causing it?
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

knucracker

Send me the map save at the point you think it should be complete and I will look at it.

That said note that maps don't complete when in the editor. You have to be playing outside the editor to get the victory condition.  This is on purpose.

Grauniad

Quote from: Clean0nion on February 16, 2014, 11:50:23 AM
Your issue is that the destruction of all units does not cause a win. Many have experienced this problem before.

Do you have an example map to prove this assertion?
A goodnight to all and to all a good night - Goodnight Moon

planetfall

Quote from: virgilw on February 16, 2014, 01:13:37 PM
Send me the map save at the point you think it should be complete and I will look at it.

That said note that maps don't complete when in the editor. You have to be playing outside the editor to get the victory condition.  This is on purpose.

... well, I'm an idiot. Finalizing it has fixed the problem.

It should probably at least display a message in the editor, though. That way people like me don't end up getting all worked up like this. I don't normally finalize until I know that all the crpl works as intended and it's ready to balance-test.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Grauniad

You don't have to finalize it. You can also just load the map and play it.
A goodnight to all and to all a good night - Goodnight Moon