Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

[Adventurer] Pet Engineer


A Desert pet level! Here: Pet Engineer

Check it out and try to break it, so we can make it perfect for public release.

This is @Bryukh’s level, so he’ll fix it up.

List of items and levels

I can’t get this to work. The pet just stands still in the middle. It won’t go left or right, even after I use pet.moveXY.

In the default code, I have:

var archer = pet.findNearestByType("archer");
var soldier = pet.findNearestByType("soldier");

but the pet doesn’t seem to recognize this method (findNearestByType)? So I changed it to:

var archer = pet.findNearest(pet.findByType("archer"));
var soldier = pet.findNearest(pet.findByType("soldier"));

I’m not sure if pet also has findByType method. After that doesn’t work, I switch to hero.findByType. But it also fails.

var archer = pet.findNearest(hero.findByType("archer"));
var soldier = pet.findNearest(hero.findByType("soldier"));

Also, it would be helpful if we can get the list of methods our pet can do. In the previous levels I think it depends on our glasses. If our glasses doesn’t have findNearestItem/findNearestEnemy, than the pet can’t use it too, am I correct?

Edit: I reload the level and it works with the default code (pet.findNearestByType). Sorry for the false alarm :smiley: but I still hope we can get the list of pet’s methods.


It’s a pet’s method for items and units. pet.findNearestItem() will be deprecated I think.

It’s weird. I suppose it was some network error. Please, write me if it repeat.

  • I was able to complete the level by a sword upgrade or armor upgrade without any additional code.
  • Using my default gear at that point in the game with complex code I can also complete the level.

So I would personally rank the level at medium difficulty and fun overall.

I submitted a patch for some grammar updates. Otherwise I can’t see anything else. Looks good.


Yep. I know. As for many levels with combat. I tested it with course equipment.


I lost until I specified that my hero should chase down only foes with a minimum x.pos and a maximum y.pos. Before that, he tried to guard everything (which is odd, since I’m using the Enchanted Lenses, which don’t see through walls).


Maybe your hero sees enemies in the right side?


He apparently sees and chases all enemies, no matter what side they appear on.


Hm. It’s weird. Could you send me sessionID for that case?


Sure thing. How do I do that?


Open dev console in your browser and look for something like sessionID. But exactly for that level.


Is this it?

|Zeus's Ray| Generated random seed 5455029322 of type submissionCount from sessionIDs [Bryukh took this] submissionCount 1


Yep. It is.

Interesting. Thanks, I don’t understand how, but it looks like your hero see enemies through walls. I will make some research about it.


Oh. Stupid stupid Bryukh. Sorry, fixed. I forgot to “switch on” vision system "wall checking’.


It works! Thanks much!


i used okar stompfoot and deflector and guarded my side with only shield() :grinning:


I used distanceTo and only attack enemies that are 15 meters close.


Thanks for the tips! When I reopened this level I’m surprised it fails (it succeeded before). But then I see Anya is running back and forth between the left & right bottom gates, whereas she should be guarding the right bottom gates only.


If she’s programmed to attack all enemies she sees, she could be chasing enemies she’s not supposed to attack. You could try adding requirements for enemy.pos before attacking.


Which glasses are you using?