Play as Creeper Template

Started by Hubs, December 14, 2014, 12:37:10 AM

Previous topic - Next topic

Hubs

It's finally here! The Play as Creeper template map is attached. Instructions for making your own PAC map will show in the editor. Have fun and create lots of really fun PAC maps!

Note that there are a few added controls: Press "Y" when a spore tower is selected to make all spore towers go into auto target mode. Press "Y" when an emitter is selected to make all emitters stop supporting. Now when a spore tower is selected you will see a small targeting circle where your mouse is. You can now select a spore tower by clicking the red target (works similar to bertha target selection). Many other tweaks were made as well as a complete re-write of Abraxis.crpl (computer AI), GameFlow.crpl (scripted events), and Temp.crpl (finalizing the map).

Also, credit goes to stewbasic for creating most of the PAC scripts used here, stdout and teknotiss for also working on the code, and all the other contributors to PAC improvement suggestions!

Full detailed instructions for making PAC maps are below (this is also in the README.crpl file in the template):

### Section 0 - Index ###

Section 0         Index
Section 1         Creating a PAC map
Section 2         Additional Buildings
Section 3         Custom dialogue and scripts
Section 4         Advanced PAC map modifications (Incomplete)
Section 5         Turn existing maps into PAC (Need image names and locations)
Section 6         Reverting a map
Section 7         Tips for making PAC maps
Section 8         List of scripts
Section 9         Credits

### Section 1 - Creating a PAC map ###

Creating a PAC map is now simpler than ever! To get started, get a copy of the PAC map template. You can get it from the CW3 forums by searching for the "Play as Creeper Template" thread. These instructions are meant for players with some experience making maps.

Copy the template file into a new map folder and rename the PAC-Template.cw3 file to Save.cw3. Open the map in the map editor. The template should have a single crpl core in the top left corner with help text above it. You should also see 3 command nodes on the map.

If you want to resize your map, now is the best time to do it. If resized later with many units on the map the game may crash. Always make a backup first if you are going to resize!

At this point the controls are all normal. You can add units in edit mode and change the terrain. When out of edit mode you can select units and change their settings, such as bertha auto target, cannon target digitalis only, bomber target and relaunch, or Sprayer release excess AC.

Up to this point you should not unpause the game. When you are ready to test your map out, make sure to save the map in edit mode. Then you can close edit mode and unpause the game. When the game reaches the first frame (the game processes 30 frames per second) the temporary crpl core in the top left will create everything needed for a PAC map, then remove itself. This can also be triggered by pressing "N" while the game is still paused as that will move 1 frame, thus triggering the PAC conversion. Once this happens the map is completely playable as a PAC map. All controls and Abraxis (the AI that rebuilds stuff) should work just like in all the other PAC maps. As you are play testing your map be very careful not to go into edit mode and save while in PAC mode. You will have to go through additional steps to revert your map back to an editable PAC map (see section 6). When done testing, simply go into edit mode and load to return to the state just before you converted to a PAC map.

While not in edit mode you can press "U" to make an emitter or "I" to make a spore tower. This will make towers that will be present at the beginning of the map. Also, make sure you add totems to your map. They are necessary to use the field ability and will make your game take much longer without them.

You can also play your map without converting to a PAC map simply by removing the script "Temp.crpl" from the crpl core in the top left of the map. This way you can play the map a bit to create extra anti-creeper and max out health and ammo for units. After playing the map you can save changes. When ready to convert it back to a PAC map again, just add the script "Temp.crpl" back to the core in the top left corner of the map, save, then reload. After that you can unpause or press "N" to convert the map to PAC.

If you want to have nullifiers in your map, or easily queue buildings to start creating when possible, you'll need to follow the steps in section 2.

When you are ready to publish your map, make a backup of the .CW3 file to be safe. Zoom out as far as you can; this is important so your map screenshot doesn't include the build tab. Then, close out of edit mode and while the game is still paused, press 'N' to advance 1 frame. Now save and create a finalized map.

### Section 2 - Additional Buildings ###

Creating Nullifiers and other buildings that can be built by Abraxis is easy to add, but you will need to get into the CRPL a little, but I promise it's really easy! Open Abraxis.crpl (either from the scripts menu in the game or directly from the scripts folder for your map.

You'll need to find the section that looks like this (should be around line 62:

# Manually add additional units
# This is mainly done for nullifiers so they don't show up on the map when the player starts
# Specify unit type, x coordinate, y coordinate.  Example:     "NULLIFIER" 15 20 @AddUnit
# To get coordinates for placement of the unit, just move your mouse to the spot you want it placed in the map editor and use the coordinates shown
# "NULLIFIER" 15 20 @AddUnit

Adding more units is simple. Just follow the instructions above (also in the crpl code). Simply add a line for each building you need.  Most of the time you'll just need nullifiers, so your code might look something like this:

"NULLIFIER" 15 20 @AddUnit
"NULLIFIER" 28 31 @AddUnit
"NULLIFIER" 47 12 @AddUnit

There's no limit to how many units can be added this way. Remember that nullifiers only build when an emitter or spore tower is within range (10 cells), so if they aren't building, they probably aren't close enough to power zones.
Other ideas: This feature can also be used to easily have units start building when the game starts, such as having Berthas or Thors start building so that there will be an added challenge a bit later in the game. You can also have units set to build where starting emitters and spore towers are. If a nullifier destroys the tower and other units destroy all of the creeper and digitalis at that power zone, a cannon or mortar could start building there. This could add further challenge to the player and pose a cost to losing one of the starting buildings.

### Section 3 - Custom dialogue and scripts ###

This section will explain the main area to modify dialogue in the game and custom scripts. This is done in the GameFlow.crpl script.

In GameFlow.crpl you will see a few sections of code that are clearly labelled as far as what it does. For game dialogue you'll see a section for dialogue to display at the start of the game and at the end of the game. You can easily change the text here or add/remove lines. Opening dialogue will show after 1 frame, and the defeat dialogue will show when all creeper buildings are destroyed.

The one exception to this is the victory dialogue, which is in Abraxis.crpl (this is because it is where the game checks to see if all Abraxis units are dead. The code for this is around line 146.

Also in GameFlow.crpl you can add further scripts. Bertha fire rate is very common and is included in this template. Bertha's will automatically receive extra ammo in proportion to how many creeper buildings are present on the map. You can remove this if you don't want it in your map or change the value assigned to the variable berthaBoost to make the boost more or less powerful.

### Section 4 - Advanced PAC map modifications ###

If you really want to customize the PAC map you can easily tweak the following settings:

To change the amount emitted by emitters, open Emitter.crpl. At the top of the script you can change the variables amt, interval, and maxCharge. This controls the creeper amount and charge amount for normal and burst mode.

To change spore tower settings, open SporeTower.crpl. At the top of the script you can change the variables amt, interval, maxCharge, and hp. This controls how fast spores charge, the max charge, and the health of the spore. You can also change showtargetpercent (default is 0.80). This will adjust when the spore tower target shows in red on the map. 0.80 = 80%, so when the tower is 80% charged, the target shows. This number can be anything from 0.0 to 1.0.

To modify the field settings, open FieldBuilder.crpl. At the top of the script you can change the variables maxRange (controls how long the field can be), minRange (controls the minimum length of the field), and baseStrength (controls how strong the field is - gets multiplied by how many totems have been captured). baseStrength will need to be a very high number to see the effect.
### Section 5 - Turn existing maps into PAC ###

Have an existing map that you really enjoy the terrain/layout on? Turn it into a PAC map in 4 easy steps!

First, you'll need the map you want to convert to PAC and a copy of the PAC template.

Next, open the PAC template map in the editor and press "I". This will place all of the custom images in a folder on your PC: documents/creeperworld3/worldeditor/[PAC Template Folder]/extracted images. You should also see a scripts folder. Copy both the extracted images and the scripts folder into the folder for your map.

Now, open your map in the editor. Go to scripts and compile all. You should see all of the PAC scripts in the list. Also, you'll need to attach all of the custom images. These include the unit icons and building buttons and are essential to making your PAC map look right. If you have custom images already, you should assign them to different image slots. Here is a list of images and what they need to be assigned to:

Image Name    Image Slot
--------------------------------------
Image0          Custom0 (64x64)
Image1          Custom1 (64x64)
Image2          Custom2 (64x64)
Image3          Custom3 (64x64)
Image4          Custom4 (64x64)
Image5          Custom5 (64x64)
Image6          Custom6 (64x64)
Image7          Custom7 (64x64)
Image8          Custom8 (64x64)
Image9          Custom9 (64x64)
Image10         Custom10 (64x64)
Image135        Custom0_256 (256x256)
Image136        Custom1_256 (256x256)
Image163        Custom0pp (64x64 PP)
Image164        Custom1pp (64x64 PP)
Image165        Custom2pp (64x64 PP)
Image166        Custom3pp (64x64 PP)
Image167        Custom4pp (64x64 PP)
Image168        Custom5pp (64x64 PP)
Image169        Custom6pp (64x64 PP)
Image170        Custom7pp (64x64 PP)

Next you will need to create a CRPL Core. This is typically placed in the top left corner of the map because some help text is displayed. Once added all you need to do is add the script "Temp.crpl" to it. Save your map and load it in the editor. It is now set up as a PAC editable map. Follow the rest of the instructions in this document to complete you PAC map.

If your map uses CRPL you'll need to do plenty of testing to make sure it doesn't interfere with the PAC CRPL.

### Section 6 – Reverting a map ###

If you accidently save your map after it has converted, or you grab a completed map and want to edit (this only works with PAC maps that used this template), follow these steps.

First, go into edit mode and add a crpl core unit. Don't worry about any of the settings, just add the script "Temp.crpl" to it.

Now save, and load the map. The script you added will remove all of the PAC cores and scripts and make the map fully editable again.

### Section 7 - Tips for making PAC maps ###

This section contains tips for making PAC maps fun, enjoyable, and challenging. Players have high expectations for PAC maps, so take the time to read some of these suggestions.

Balance: this is the most important part of PAC maps! Without a good balance of challenge and fun, your PAC map won't be as enjoyable to play. Make sure you test your map multiple times using different strategies. Does your map play better to a mainly emitter game (lots of beams) or does it focus a lot on spores (lots of void/not many beams)? The map authors that make the best maps are the ones that test it over and over to get a fun balance. Don't be afraid to post it on the CW3 forum either. There are many players out there that would love to test your maps and provide feedback.

Are you trying to make a short game or long game? If it's short, does it offer something interesting or some level of challenge to complete? If it's a long game, is it interesting to play for an hour or more? Try to create challenges throughout the map. Usually this is done by having more difficult terrain to play through and more units on power zones near the end of the level.

Replayability is also something to consider. After creating and testing your map a dozen times do you still enjoy it? Are there multiple ways to win? Is there something unique about your map that people haven't seen in other PAC maps?

The beginning is a very important part of the game. Is it so difficult to start that players will get frustrated and quit? Try to offer a challenge so it's not too easy, but still make it doable for the people playing your map.

Make sure your map has totems somewhat close to the start! Without totems the field ability is useless and can make your map very long and boring.

### Section 8 - List of scripts ###

The following is a list of the scripts used in the PAC map template.

These scripts are the main scripts that run the game.

GameFlow.crpl: Used to check to see if the mission failed (no more towers left).  Also used for additional custom game events such as bertha fire rate boost and the mass convert Artifact of Odin.  This is where all additional crpl for scripted events and other additions to the PAC map should go.
Abraxis.crpl: AI for the computer player.  Attempts to rebuild destroyed units. If you want to add additional buildings, such as nullifiers, do it here.  This could also be used to trigger construction of a Thor or Bertha at the start of the game.
Temp.crpl: This will initially be the only script on the PAC template. Once the game gets to the first frame it will create all of the core units and add the appropriate scripts.

These scripts control everything else in the game. Editing these scripts is discouraged as it will probably break the game if you do.           

AlternateControl.crpl: Allows the alternate controls for PAC maps to be used and disables being able to select human units.
Builder. crpl: Used when the build emitter or spore tower buttons are clicked to place buildings.
BuildTab. crpl: Creates the build tab at the bottom of the screen.
DigitalisBuilder. crpl: Used when building digitalis to show the area to build digitalis and create digitalis.
Emitter. crpl: Used to update ammo and timing to produce creeper
EmitterBuilder. crpl: Used to build emitters - defers to Builder.
FieldBuilder. crpl: Used to build fields - takes into consideration number of totems captured.
FieldDisplay. crpl: Displays the field and updates the scrolling triangles.
FieldViewer. crpl: Used for displaying images in fields.
Label. crpl: Creates the labels above the controls at the bottom.
README. crpl: Explains how to create and properly upload a Play as Creeper map.
Select. crpl: Used to determine what unit to select when the users clicks on a creeper building - can only select emitters or spore towers.
SporeBuilder. crpl: Used to build spore towers - defers to Builder.
SporeTower. crpl: Used to update ammo and timing to launch a spore.
StructureGui. crpl: This controls the interface for emitters and spore towers including the "E"/"R" keys for toggling through different modes, "T" for emitter support and mass spore targeting, for individual targeting of emitter support and spore towers, and "Y" to make all spore towers go into auto-target or emitters to stop supporting.
Temp. crpl: This is the script that displays help text in edit mode and what converts the map to PAC mode.
TotemListener. crpl: A helper script that is attached to a core which wants to receive updates from TotemWatcher.
TotemWatcher. crpl: Watches totems to check if they are supported by digitalis.

### Section 9 - Credits ###

Play as Creeper maps have taken a lot of work to get to this point. This section is to give credit to the main contributors.

The main credit for PAC maps goes to stewbasic, who originally wrote the first PAC map: Creeper Come Back. This is where it all started! he did a great job writing the majority of the code used in this template and revolutionized Creeper World 3!

Additional credit goes to stdout and teknotiss who also created additional PAC maps and contributed to the code. They are the ones who created most of the early maps to really build up interest in these types of maps.

Lastly, credit goes to Hubs, who put the finishing touches on the code and created this template. He rewrote much of the AI and added a few tweaks to the interface to make the game easier to play.

** Edit  **
Dec 14, 2014 - Updated template and read me to include instructions to zoom out before finalizing map.
Jan 2, 2015 - Updated template with controls added by stewbasic.
July 21, 2015 - added a more recent template to this post. (PlayAsCreeper-2015-01-25)

stdout

Christmas came early this year!  :)

This represents a gigantic effort on your part, Hubs, and we all owe you a debt of gratitude. Thank you, and well done! I'm looking forward to diving in and playing with what you've made here.

teknotiss

good job dude, we perhaps see if this is popular or useful enough to get stickied  8)
"Is God willing to prevent evil, but not able? Then he is not omnipotent.... Is he able, but not willing? Then he is malevolent.... Is he both able and willing? Then whence cometh evil?.... Is he neither able nor willing? Then why call him God?" --- Epicurus

Asbestos

#3
http://i.imgur.com/zCBQP8s.jpg  <<off-topic img tag redacted - K>>
Looks interesting!

After experimenting a bit, I've found a bug where Abraxis tries to replace a unit over and over even though it has creeper on it, creating a huge series of explosions.

Hubs

Just wanted to let everyone know that I updated the template and read me text to include the instruction to zoom out as far as you can before you finalize your map. This is important so that your map screenshot doesn't include the creeper build tab. If you've already downloaded the template you don't need to update it, just make sure you zoom out before finalizing.

Hubs

Has anyone tried the template yet? Is it working for you? Just looking for some feedback...

teknotiss

sorry dude, haven't had time yet.
but perhaps tonight, rest assured i'll let you know as soon as i do! 8)
"Is God willing to prevent evil, but not able? Then he is not omnipotent.... Is he able, but not willing? Then he is malevolent.... Is he both able and willing? Then whence cometh evil?.... Is he neither able nor willing? Then why call him God?" --- Epicurus

stdout

I was chomping at the bit but life got in the way and I haven't been able to yet, either.

mzimmer74

Given how much I love the PAC maps I decided to try your template out.  It was quite easy to get set up and, by following your instructions, I was able to create one to play.  However, I had to admit that I'm still completely inept when it comes to designing maps so will leave that to far more qualified individuals.  Nevertheless, I just wanted to let you know that it was VERY easy to create one using your template.  Excellent work!
Omnipotence doesn't mean the ability to do what is logically impossible. It's possible, therefore, for God to create beings with the kind of free will that can choose between good and evil, but he can't also force those creatures to choose good. If he forced their choice, it wouldn't be free.

Hubs

Quote from: mzimmer74 on December 17, 2014, 10:34:37 AM
Given how much I love the PAC maps I decided to try your template out.  It was quite easy to get set up and, by following your instructions, I was able to create one to play.  However, I had to admit that I'm still completely inept when it comes to designing maps so will leave that to far more qualified individuals.  Nevertheless, I just wanted to let you know that it was VERY easy to create one using your template.  Excellent work!

Glad it worked for you! And don't give up on publishing a map! Lay out the terrain and add units, then test it. If you've played lots of PAC maps think about what your map needs to be better, then add it and test again. It ultimately comes down to tweaking it enough to be fun to play.

teknotiss

Quote from: mzimmer74 on December 17, 2014, 10:34:37 AM
Given how much I love the PAC maps I decided to try your template out.  It was quite easy to get set up and, by following your instructions, I was able to create one to play.  However, I had to admit that I'm still completely inept when it comes to designing maps so will leave that to far more qualified individuals.  Nevertheless, I just wanted to let you know that it was VERY easy to create one using your template.  Excellent work!

post it in a thread and let us help play test it! then you can learn to make them with some support and advice! :)
"Is God willing to prevent evil, but not able? Then he is not omnipotent.... Is he able, but not willing? Then he is malevolent.... Is he both able and willing? Then whence cometh evil?.... Is he neither able nor willing? Then why call him God?" --- Epicurus

_Kreeper_

I love all your maps guys, and I was hoping to get some expert feedback on the map I created with this template. It will be posted in a thread shortly after this, so look for a thread called "Astrox: Moon of Genos". I'm really looking forward your comments!

PS.
As soon as I beat my map, the victory GUI did not appear. It might be my computer, but I'm hoping you guys can beat it, because I'm worried of going into the CRPL and destroying the map.

Asbestos

There's a new template over at the Theory and Practical thread with changed controls and other stuff. Is your map the updated template? If not, you can probably just transplant most of the scripts from there to yours.

Hubs

I put the most up to date copy here on Jan 2. If you got the template before that you can just copy the scripts from the new template and paste them in you map. I keep an edit log at the bottom of the main post when I change the template.

_Kreeper_

I have the most up to date template, I think I'll try to run through it one more time to see if it works.