Problem with oasis guardian ID & type (might be a bug)

I tried everyhingI can think of: .id(oasis guardian) & .type(oasis guardian) & .id(oasis) & .type(guardian)
Nothing seems to work, I even tried to get the id by say(.id). Either this is a bug or I am missing something.

you were close. as with standard type naming it uses dashes.


you can loop over the enemies and have your hero .say(enemy,type) to see the type of any unit btw.

It should be renamed, all other enemies are: name - type how the hell can I guess that I need a - inbetween. Standard for whitespaces is oasis_guardian. This annoys me rly bad.

I will add it into the default source code comments. It is not going to be changed. :slight_smile: standard naming for unit “types” is dash separated.

update: i have added a new line in the default source code for the level to tell the player what the type is on the oasis guardian so they don’t have to debug and figure it out themselves

What you are seeing here is a combination of the name of the unit (id) and the type. Which means nothing to you in this level. As the name is just randomly generated garbage each simulation. Bob fred, whatever ogre names it picks. You couldn’t use the name to do any sensible coding around it. It would also kill the role-playing / atmosphere aspect of it to see some random garbage name there and the game engine does not let you change the id of a unit thats been spawned. Considering types in codecombat are always dash separated. such as this.isReady(“fire-trap”), the type for Ogre Thrower is “ogre-thrower”, etc. I could go on all day listing them. It’s a pretty standard naming scheme throughout the game, plus you can always find out any units type by having the hero say it, as i already explained.

I tried .say(enemy.type) but my hero dies before he gets to the guardian. The hero always pauses when saying something. Something like a console would be nice, or the hero being able to say stuff while moving. So my only option was to guess it until I got fed up with it and asked here.

Indeed this is a large issue that will be solved when they re-enable the active debugger. Its disabled because it was too buggy… Unfortunately say is all we have for now :frowning:

One possible thing you could have done is to compare the maxHealth of the unit. If the unit’s hp is equal to the health of the guardian, say the type. (Guardian health is considerably higher than any other regular units on the level 300). You can always pause the game and read it. The good thing is the level is not repeatable so failing doesn’t matter much!

Thx didn’t think of using the health, that’s a good workaround.

I dono if this intentional but my champ gets stuck on those camels from time to time depending on how I write the code.

Turns out there was a bug with thang templates that was forcing the oasis guardian’s type to be “Ogre” but it’s been fixed and the type is now as it should have been “oasis-guardian”.