sotonin
February 15, 2015, 8:31pm
3
Vault Door 1 is not it’s type, it’s the name.
If you insist on using type, the type for all the doors is simply “door”. nothing impossible about it. You just need to get creative and debug stuff. You can easily find out anything’s type by having your hero say enemy.type. That simple.
2 Likes
WHOOHOO I beat the level Deadly Dungeon Rescue!!!
1 Like
sotonin
February 15, 2015, 9:35pm
5
congrats! i hope it presented a challenge and overcoming it was satisfying
2 Likes
look here. This is ending… But for those of you who need help can come
1 Like
Inrideo
February 15, 2015, 11:31pm
7
The say command is a great debugging tool. Definitely something people may overlook.
2 Likes
PixelAA
February 21, 2015, 6:51pm
8
What is the exact syntax for the say command to return the name of an item like a door or chest? I can’t find it in my panel.
1 Like
Door is your enemy
self.moveXY(150, 28)
enemy=self.findNearest(self.findEnemies())
self.attack(enemy)
self.attack(enemy)
1 Like
Vlevo
February 21, 2015, 7:09pm
10
On this level “chests” aren’t actual objects . . . so you have to use a flag or the x,y location of the image on the map.
doors are enemies, so:
enemy = <insert find enemy command here>
if enemy:
self.say(enemy)
That will actually say the name of any enemy.
doors are of type door, so:
if enemy.type == "door":
self.say(enemy)
will only “say” if the enemy is a door
But as juraj suggests, you don’t need to know its name if you’re happy/safe attacking whatever is closest.
2 Likes
When i complete this level i hasnt any problem with identify doors as the enemy without naming. i think you can atack it without enemy.type naming
1 Like
You can just make your guy not attack munchkins, since the guards are munchkins.
1 Like
if (enemy) {
if (enemy != "munchkin") {
this.attack(enemy);
}
}
My hero still killed the guard, so not attacking Munchkins doesn’t solve failing the mission with kills.
1 Like
Well, enemy returns the name of the nearest enemy, I assume, and as far as I know, there is no ogre named “munchkin.” Try if (enemy.type != "munchkin") {
.
1 Like
Perhaps there is more than 1 type? I have to check and see.
1 Like
amadej
May 20, 2015, 2:21pm
16
Chests are type “chest” and called “Treasure Chest 1” / “Treasure Chest 2” / “Treasure Chest 3” / “Treasure Chest 4” by name
1 Like
amadej
May 20, 2015, 2:22pm
17
I have another problem: after cracking one chest (any of four) hero don’t want to do anything more. What’s wrong? Is it just me?
1 Like
Vlevo
May 20, 2015, 7:48pm
18
That sounds like a problem with your code…
1 Like
amadej
May 20, 2015, 7:58pm
19
Tried different ways. Action stops even with:
self.moveXY(150, 28)
enemy=self.findNearest(self.findEnemies())
self.attack("Vault Door 1")
self.attack("Vault Door 1")
self.attack("Treasure Chest 1")
self.attack("Treasure Chest 2")
and chest 2 never was attacked, hero didn’t any step more…
PS and yes, I’m already know, that there is no need to crack chest, but…
1 Like
Vlevo
May 20, 2015, 8:08pm
20
I don’t see you telling the hero to do anything after:
self.attack(“Treasure Chest 2”)
so why do you expect that it will?
1 Like
amadej
May 21, 2015, 8:10am
23
Hero stops doing annything after
self.attack("Treasure Chest 1")
Treasure Chest 2 will not being attacked in example case
1 Like
You just need to move to the position of the chest.
2 Likes