Custom Map #256: Bloom-4. By: First

Started by AutoPost, February 25, 2014, 11:46:14 PM

Previous topic - Next topic

AutoPost

This topic is for discussion of map #256: Bloom-4


Author: First
Size: 162x162

Desc:
Creeper grows like weeds on Bloom-4. Updated -- now select your own starting positions. Scripts, hints, tips and comments on the CW3 forums. Click View Topic ... and leave a comment!

First

Scripts used for this map. Gametower - controls assignment of colors, types and links.


# gametower.crpl
# Created on: 2/22/2014 4:09:46 PM
# ------------------------------------------

$Color:"Red"
$Type:"Emitter"
$xLoc:0
$yLoc:0
$xLink:0
$yLink:0

once
"
" ->LFCR
1 @ShowMessageDialogCallback
endonce

:ShowMessageDialogCallback
1 eq if
PauseGame
@RollStartingPositions
"Want to play this starting position?" "Yes! Play" "No! Re-roll" ShowMessageDialog
else
UnpauseGame
endif

:awake
CurrentCoords Swap ->xLoc ->yLoc

#hack a random seed
ElapsedTime 10000 mod 0 do
0 1 RandInt ->dummy
loop


:RollStartingPositions
#locate the starting nodes, assign their scripts and inits
CreateList ->NodesColors
"Blue" "Cyan" "Green" "Magenta" "Orange" "Purple" "Red" "Violet" "Yellow" "YellowGreen" <-NodesColors PrependStackToList
CurrentCoords 999 GetEnemyUnitsInRange ->numUnits
CreateList ->NodesUID
<-NodesUID AppendStackToList
#filter out Self
<-NodesUID GetListCount 0 do
<-NodesUID I GetListElement ->currUnit
<-currUnit Self eq if
<-NodesUID I RemoveListElement
endif
loop
0 ->imgCount
while <-NodesUID GetListCount 0 gt repeat
0 <-NodesUID GetListCount RandInt ->which
<-NodesUID <-which GetListElement ->currUnit1
<-NodesUID <-which RemoveListElement
0 <-NodesUID GetListCount RandInt ->which
<-NodesUID <-which GetListElement ->currUnit2
<-NodesUID <-which RemoveListElement
<-NodesColors 0 GetListElement ->Color
<-NodesColors 0 RemoveListElement
<-Color Trace

<-currUnit1 "main" "Custom" <-imgCount Concat SetImage
<-currUnit1 "linktower.crpl" "MyImage" "Custom" <-imgCount Concat SetScriptVar
<-currUnit2 "linktower.crpl" "LinkImage" "Custom" <-imgCount Concat SetScriptVar
<-imgCount 1 add ->imgCount
<-currUnit1 "linktower.crpl" "xLoc" GetScriptVar ->xLoc1
<-currUnit1 "linktower.crpl" "yLoc" GetScriptVar ->yLoc1

<-currUnit2 "main" "Custom" <-imgCount Concat SetImage
<-currUnit1 "linktower.crpl" "LinkImage" "Custom" <-imgCount Concat SetScriptVar
<-currUnit2 "linktower.crpl" "MyImage" "Custom" <-imgCount Concat SetScriptVar
<-imgCount 1 add ->imgCount
<-currUnit2 "linktower.crpl" "xLoc" GetScriptVar ->xLoc2
<-currUnit2 "linktower.crpl" "yLoc" GetScriptVar ->yLoc2

#set up links
<-currUnit1 "linktower.crpl" "xLink" <-xLoc2 SetScriptVar
<-currUnit1 "linktower.crpl" "yLink" <-yLoc2 SetScriptVar
<-currUnit2 "linktower.crpl" "xLink" <-xLoc1 SetScriptVar
<-currUnit2 "linktower.crpl" "yLink" <-yLoc1 SetScriptVar

#colors and types
<-currUnit1 "linktower.crpl" "Color" <-Color SetScriptVar
<-currUnit2 "linktower.crpl" "Color" <-Color SetScriptVar
<-currUnit1 "linktower.crpl" "Type" "Emitter" SetScriptVar
<-currUnit2 "linktower.crpl" "Type" "Spore" SetScriptVar
endwhile

:AllTowersImageScale
->scale
CurrentCoords 999 GetEnemyUnitsInRange ->numUnits
CreateList ->NodesUID
<-NodesUID AppendStackToList
#filter out Self
<-NodesUID GetListCount 0 do
<-NodesUID I GetListElement ->currUnit
<-currUnit Self eq not if
<-NodesUID I GetListElement "main" <-scale <-scale
endif
loop

First

Scripts used for this map. Linktower - controls the towers - growth, production, destruction


# linktower.crpl
# Created on: 2/23/2014 12:59:34 AM
# ------------------------------------------

$Color:"Red"
$Type:"Emitter"
$MyImage:"Custom0"
$LinkImage:"Custom1"
$xLoc:0
$yLoc:0
$xLink:0
$yLink:0

#Timer0 - 1 second timer for misc wait states (avoids updating stuff every frame)
#Timer1 - used to time buildout phase of core
#Timer2 - used to time action phase of core (emitting creeper or spores)
#Timer3 -
#isBuilding - True means in buildout phase, False means in production phase
#isInit - Waiting 30 frames for gametotem.crpl to finish assigning the links (to avoid race condition)

once
#ShowTraceLog
"
" ->LFCR
False ->isBuilding
False ->isSapling
True ->isInit
5 SetTimer0
"Init" Trace
#Initialize
60 80 RandInt ->EmStr
1800 2700 RandInt ->EmInitIntFrms
15 45 RandInt ->EmIntFrms
2 5 RandInt ->SpNum
1800 2700 RandInt ->SpInitIntFrms
2700 4500 RandInt ->SpIntFrms
50 100 ->SpStr
endonce

#Init wait is over, begin building
GetTimer0 eq0 <-isInit and if
"Finished Init" Trace
False ->isInit
True ->isBuilding
True ->isSapling
#Start Building
"Emitter" <-Type eq if
<-EmInitIntFrms SetTimer1
else
<-SpInitIntFrms SetTimer1
endif
30 SetTimer0
endif

#Update popuptext for partially built units - showing %build completion and imagesize, until building is finished
GetTimer0 eq0 <-isBuilding and <-isInit not and if
"Building" Trace
"Emitter" <-Type eq if
1.0 <-EmInitIntFrms mul GetTimer1 sub <-EmInitIntFrms div 100.0 mul floor ->percComp
<-percComp 33.3 lt ->isSapling
<-isSapling if
"Fragile " <-Color Concat <-LFCR Concat <-percComp Concat " %" Concat SetPopupText
else
<-Color <-LFCR Concat <-percComp Concat " %" Concat SetPopupText
endif
1.0 <-EmInitIntFrms mul GetTimer1 sub <-SpInitIntFrms div 2.0 0.33333 sub mul 0.33333 add ->imgScale
else
1.0 <-SpInitIntFrms mul GetTimer1 sub <-SpInitIntFrms div 100.0 mul floor ->percComp
<-percComp 33.3 lt ->isSapling
<-isSapling if
"Fragile " <-Color Concat <-LFCR Concat <-percComp Concat " %" Concat SetPopupText
else
<-Color <-LFCR Concat <-percComp Concat " %" Concat SetPopupText
endif
1.0 <-SpInitIntFrms mul GetTimer1 sub <-SpInitIntFrms div 2.0 0.33333 sub mul 0.33333 add ->imgScale
endif
True SetPopupTextAlwaysVisible
Self "main" <-imgScale <-imgScale SetImageScale
30 SetTimer0
else
endif

#Finished Building, start the activity timer
GetTimer1 eq0 <-isInit not and <-isBuilding and if
"Built" Trace
"Emitter" <-Type eq if
<-EmIntFrms SetTimer2
else
<-SpIntFrms SetTimer2
endif
False ->isBuilding
endif

#update the popuptext for fully built units - showing tower activity (strength, spores, etc)
GetTimer0 eq0 <-isBuilding not and <-isInit not and if
"Emitter" <-Type eq if
<-Color <-LFCR Concat "Strength: " Concat <-EmStr Concat <-LFCR Concat "Interval: " Concat <-EmIntFrms 30.0 div 100.0 mul floor 100.0 div Concat " sec" Concat SetPopupText
False SetPopupTextAlwaysVisible
else
GetTimer2 30.0 div 60.0 div floor ->minRemaining
GetTimer2 30.0 div 60.0 mod floor ->secRemaining
<-secRemaining 10 lt if
<-Color <-LFCR Concat <-SpNum Concat " spores" Concat <-LFCR Concat <-minRemaining Concat ":0" Concat <-secRemaining Concat SetPopupText
else
<-Color <-LFCR Concat <-SpNum Concat " spores" Concat <-LFCR Concat <-minRemaining Concat ":" Concat <-secRemaining Concat SetPopupText
endif
False SetPopupTextAlwaysVisible
endif
30 SetTimer0
endif

#Action required timer has expired, emit something
GetTimer2 eq0 <-isBuilding not and <-isInit not and if
"Doing Something" Trace
"Emitter" <-Type eq if
CurrentCoords <-EmStr SetCreeper
<-EmIntFrms SetTimer2
else
<-SpNum 0 do
CurrentCoords RandUnitCoords 1.0 <-SpStr CreateSpore
loop
<-SpIntFrms SetTimer2
endif
endif

#check if my link is dead, if so
#only allow me to start respawn if (1) I am not already respawning and (2) I am not building myself
<-xLink <-yLink GetUnitAt ->linkUnit
<-linkUnit -1 eq  <-isInit not and if
<-isSapling if
#kill myself if I'm currently building - can't survive death of link
Self CONST_CREATEPZ 1 SetUnitAttribute
"POWERZONE" <-xLink <-yLink CreateUnit
Self 0 Destroy
else
#spawn my link back into life if I am currently built - can survive death of link
"Spawning" Trace
"CRPLCORE" <-xLink <-yLink CreateUnit ->currUnit
<-currUnit "linktower.crpl" AddScriptToUnit
<-currUnit "main" <-LinkImage SetImage
<-currUnit "linktower.crpl" "MyImage" <-LinkImage SetScriptVar
<-currUnit "linktower.crpl" "LinkImage" <-MyImage SetScriptVar
CurrentCoords Swap ->x ->y
<-currUnit "linktower.crpl" "xLoc" <-xLink SetScriptVar
<-currUnit "linktower.crpl" "yLoc" <-yLink SetScriptVar
<-currUnit "linktower.crpl" "xLink" <-x SetScriptVar
<-currUnit "linktower.crpl" "yLink" <-y SetScriptVar

<-currUnit "linktower.crpl" "Color" <-Color SetScriptVar
<-Type "Emitter" eq if
<-currUnit "linktower.crpl" "Type" "Spore" SetScriptVar
else
<-currUnit "linktower.crpl" "Type" "Emitter" SetScriptVar
endif
<-currUnit "linktower.crpl" "EmStr" <-EmStr SetScriptVar
<-currUnit "linktower.crpl" "EmInitIntFrms" <-EmInitIntFrms SetScriptVar
<-currUnit "linktower.crpl" "EmIntFrms" <-EmIntFrms SetScriptVar
<-currUnit "linktower.crpl" "SpNum" <-SpNum SetScriptVar
<-currUnit "linktower.crpl" "SpInitIntFrms" <-SpInitIntFrms SetScriptVar
<-currUnit "linktower.crpl" "SpIntFrms" <-SpIntFrms SetScriptVar
<-currUnit "linktower.crpl" "SpStr" <-SpStr SetScriptVar
endif
endif

:awake
#hack stores currentcoords so that the main gametower can use getscriptvar to get my coordinates
CurrentCoords Swap ->xLoc ->yLoc
#clears out the popuptext
"" SetPopupText
"" SetText
#Init imagesize to emulate weed-like growth of the tower
Self "main" 2.0 2.0 SetImageScale
Self CONST_CELLHEIGHT 6 SetUnitAttribute
Self CONST_CELLWIDTH 6 SetUnitAttribute
Self CONST_TAKEMAPSPACE 1 SetUnitAttribute
Self CONST_CONNECTABLE 0 SetUnitAttribute
Self CONST_COUNTSFORVICTORY 1 SetUnitAttribute
Self CONST_NULLIFIERDAMAGES 1 SetUnitAttribute
Self CONST_CREATEPZ 0 SetUnitAttribute
Self CONST_CONNECTABLE 0 SetUnitAttribute
Self CONST_REQUESTPACKETS 0 SetUnitAttribute
Self CONST_REQUESTACPACKETS 0 SetUnitAttribute
Self CONST_CANREQUESTAMMO 0 SetUnitAttribute
Self CONST_SUPPORTSDIGITALIS 0 SetUnitAttribute
"Awake" Trace

First

Tips about the game mechanics:

Spoiler
Towers start at 0% health. When they reach 100% they begin emitting creeper or spores, depending on their designation. See the image or the popup text for the designation.
[close]

Spoiler
Pairs of towers are "connected" by a link that allows one tower to resurrect its partner. Pairs are defined by color, which you can see if you mouse over it.
[close]

Spoiler
Killing a tower results in it being resurrected back by it's linked partner, but at 0% health. It will then proceed to grow back to full health over time.
[close]

Spoiler
A linked partner cannot resurrect its dead mate if it's health is below 33.3%. Once it reaches 33.3%, it will resurrect, however.
[close]

Spoiler
To effectively kill a pair, you have to kill them both before either one can reach 33.3% in health.
[close]

First

Hints on gameplay:

Spoiler
Establish a foothold using the power pack that's near the center of the map. Build a few reactors using the powerpack energy. Continue to build reactors to support Bertha's later.
[close]

Spoiler
Spores will be the first real problem. Build some beam towers, maybe 4 to start, but around 8 will be needed. The spore alert bar is not working in this map (too lazy to adopt existing good code). So, keep any eye out for spore timers (mouse over the spore towers for launch countdowns).
[close]

Spoiler
Build a forge early to capitalize on the two aether packs. Once you get the 500 aether, research energy efficiency (the opening phase is energy lean) and at least one firing rate (to kill spores more easily)
[close]

Spoiler
Look for a linked pair that are nearby and close to each other. Go for those first. Once you get a pair killed and cleared, build Berthas on the PZ. Use one on autotarget mode for strategic bombing of the deep creeper. Use on on manual target mode for tactical bombing.
[close]

Spoiler
A few terps will help with the annoying, broken terrain.
[close]

First

Many thanks to planetfall and burguertime for the comments and suggestions!

I added an option to re-roll the colors/types of the towers before starting. Choose easy, medium or hard mode!

burguertime

yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

love ya creepling.

keep the maps rolling. would love to se more of your crazy CRPL ideas.
Don't make a slog just because. Be like Master Mapmaker SPIFFEN:
Quote from: themaskedcrusader on October 05, 2010, 05:09:33 PM
(...)Difficulty is subjective. (...)
SPIFFEN chooses to rate each map as trivial because they believe that the difficulty of the map depends on the capability of the player.
BAD RATING: MEASUREMENT OF MAP HARDNESS.
Quote from: DumbCreeperGamer"Ugh, me no finish map, map too hard, ME RATE ONE.
oOga OoGa to you too.