Level Feedback Wanted: Find the Spy


#1

I’d appreciate some feedback on my first level.

At the moment I’m having trouble getting Captain Anya to show up correctly at the beginning and end of the level. I’ve been just trying to duplicate scripts written by others, but is there some documentation on the correct way to handle that?


#2

Ah, this is a nice little level. Is the idea that the player will use a for-loop over the enemy spies and then find the ones where the team is different? A bit of documentation on how to tell if a spy is an enemy would be helpful. This feels like a natural progression from Emphasis on Aim, combining that with needing to know how to loop.

To add Captain Anya to the level, check out the UI System: add the default indieSprites property in its config. Then she should be available for scripting.


#3

Yes, that was the idea for the level. I had a little blurb if you clicked on the “Guide” button, but without Anya I couldn’t get it to pop up by default.

Perhaps I’ll also put in some comments in the default code.

Thanks for the tip on indieSprites. I’ll look into that.


#4

OK, I seem to have really messed something up now. When I tried to add anything to the UI System, all I got was a blank box, so I removed the UI System and re-added it, which allowed me to then add indieSprites. However, when I saved a new version so I could see if that changed anything, now when I try to open it up in an editor it just sits at “Loading” forever.

I reverted back to an old version that would load, and then I tried splitting it up into two steps. I was able to remove and re-add the UI system, and that didn’t cause any problems. However, when I added indieSprites to the UI system, it went to “Loading” forever. Even weirder, if I try reverting back to the previously working version after I removed and added the UI system (v0.14 in this case) it no longer loads properly. However, I can still roll back to version 0.12.

Is there some way to find out why the editor won’t load certain versions? An error log somewhere?


#5

By the way, the Javascript error console shows:

GET http://codecombat.com/db/thang.type/Captain%20Anya/version 404 (Not Found)

But I assume that’s not what’s preventing the level from loading.


#6

I’ve had the same problem for a few days now. Strangely enough, i can load ‘official’ levels (the ones published on the site), but my own level, or WIP’s from other people are either stuck on ‘loading’ or when they load, the ‘world view’ is all grayed out. I can still see the editor itself, but not the thangs i put in my world.

Btw, this started when i tried to resize a house-thang to double it’s size. Since i read they’re vectors, i thought that was totally legit, but obviously something got messed up…

Unfortunately reverting to a previous save did not solve the problem.


#7

Try having the IndieSprie’s ThangType as “Anya” instead of “Captain Anya” (it should autocomplete). If you do have a 404 on /db/thang.type/something/version (and it’s not …/portrait), then that will cause this problem.


#8

Ah, OK, setting the ThangType to “Anya” worked. It defaulted to “None” for some reason.


#9

OK, I think I have everything sorted out finally. The thing that eventually got Anya to show up and give an intro was:

Originally, in the scripts tab, I had one action group that added the goals, then a second action group that had Anya’s dialog. Something about the first action group seems to have been preventing the second group from executing. I dumped the action group that added goals and merged that into the action group that had the rest, and now everything is triggering properly.

Really, I think something went wrong when I created this level, because all sorts of things have ended up corrupted, and most of my problems have been fixed by deleting and then readding whatever was causing problems. Perhaps I created the level right in the middle of a code change on the server or something.


#10

Sorry about the problems with the level. Yeah, it’s looking good now. I would include the programming.UsesSnippets Component so that people can get examples of the syntax for for-loops and if-statements, and maybe some nice dungeon decorations to liven up the ambience. After that, would be happy to promote the level to the user-created levels section!


#11

OK, I’ve added the snippets and some dungeon decorations. However, two new problems have come up.

  1. My decorations are casting weird shadows. All of the candlesticks and bookcases have a 1x1 dark square under them.

  2. I can’t get the victory scripts to trigger properly. It plays to the end of the animation and then just sits there instead of showing a victory screen (even though the goals show as green). Then if I quit and reload the level, it gives me a victory screen right away since the level is already solved. Can someone take a look at my scripts and tell me what I got wrong such that it doesn’t show the victory screen (or Anya’s congratulations dialog for that matter) the first time?


#12

For #1, change the shape of the candlesticks to “ellipsoid” in the Physical Components, and set the bookshelf width, height, and depth to something like 4x3x4m. I’ll update the default Components for those to match the shapes and sizes.

For #2, I think your previous scripts are still running. Scripts either need to have a set duration or to be explicitly continued past by the player (by pressing shift+space). So usually when you have a script that doesn’t have a dialogue in it, you want to set a duration. Try setting script durations on your intro scripts.


#13

OK, that seems to have fixed everything, thanks!

Any other recommendations to improve the level?


#14

I tried it. No problem encountered.
Nice easy level to search in an array.
Maybe the soldiers could move to make to level more dynamic :slight_smile:


#15

That’s a great idea. You can make the soldiers patrol with the ai.PatrolsAndAttacks Component with the patrolChaseRange set to 0 meters.

Otherwise, it looks good to me. Want to submit a pull request adding it to the user-created levels section of the site? https://github.com/codecombat/codecombat/blob/master/app/views/play_view.coffee#L216


Level: Find the Spy
#16

Sorry I took so long to get back to this. One problem is that if I add the Patrol and Attack Component, it automatically adds the “Attack” component, and then even with patrolChaseRange set to 0 meters the soldiers on different teams will still attack each other. Since I can’t patrol without attacking it seems, and since I can’t set the attack range to 0, I solved the problem by setting visualRange to 0. Is that an acceptable solution, or is there a better way to do it?


#17

Good thinking; that will work fine. Really, there should be another AI Component that will have the Thang patrol without attacking, but I haven’t written one yet.


#18

Sorry if this is a stupid question, but is there documentation somewhere on the proper way to request inclusion as a user-created level?


#19

Not yet–as soon as we do #111 we’ll have a good process. For now, you can submit a pull request on GitHub adding the level to play_view.coffee. (You can do this through the GitHub web editor.)