New Level: Let's Go Fly a Kite

So, I’m working on this modification of Hit’n’Run. I have my archer running around, but she doesn’t do any damage with her bow. How do I get her to actually spawn arrows when she attacks?

1 Like

I’m on it B)

and could you unlock some fancy math functions please? I’d like to try some things for finding the direction of kiting.

Unlocked math for you. Sorry bout that! And I already got her to actually shoot and kill, you should be able to survive the horde!

Thank you! Do you mean you solved the level? I’m still working on a solution, but I’m conviced it’s solvable as she’s so fast.

Zacharias

Yep, solved it. Actually did it without the fancy math. Though i think my solution would fail if the ogres we’re more spread out to start.

Yeah I suppose just putting a few manual waypoints with a similar kiting algorythm like in the Hit’n’Run level would do it for this special case.

My code isn’t really using waypoints, I just don’t worry about anybody other than the closest guy and if I get close to the edge I start to turn, so the edges are hardcoded into the program. Would there be a way to extract the boundary coordinates in the program so it wouldn’t matter the size, I could tell a boundary was coming and adjust? That’d be cool!

1 Like

If we added a Component to somehow expose world.width and world.height, that would be a start. Not sure what the best API for that would be, though.

This level doesn’t really have much input. A user might not know how to make her attack and run. Maybe add more comments?

TJ

I will attempt to get to that, life is crazy right now as I teach. May not happen til June.

OK, well I’m finally back to working on this, but I had a little setback… I was editing the level using the wrong account, so now I have a bunch of patches that I want to apply, but they can’t be applied for some reason. Help!

Not an easy level.
For sure, min max x and y are missing.
I’ve got a funny behavior for the dead ogres : the shadow is turning around the body.
I will wait your patch before giving more feedback.

Yeah, I don’t think I can do anything about the ogre shadows. And even the ogres flipping directions as the archer runs around them.

Should min/max x/y be added in the comments or is there an API to add them?

Also, is there an API for attack range? I tried to add them for both the ogres and the human, but couldn’t find it, ended up just mentioning it in the guide.

OK, so I just redid my updates using the proper account, but in doing so I got some weird shadowing appearing. Not exactly sure what happened. The level is playable, just running through shadows for part of it. How is the documentation now?

The level looks broken now. As the initial position is not the same, my code does not work anymore.
Maybe I should wait an update before adapt it ?

About the documentation, it’s visible.
About the way to store parameters, I copied the JS code but it’s not working.
In other levels I use something like that :

if (this.remember === undefined){
this.remember = 0;
}
this.remember++;

But it’s not working better here.
Maybe “this” is protected, so we can’t add properties.

About min and max, you can take example on http://codecombat.com/play/level/harvest-time, the xmax and ymax are properties of this, so we can have access in the code, and they appear in the available spells.

The Nimoy’s range could be visible in her own properties, as the id of the health. For the ogres, maybe they could appears also in some way in this properties.

Let me know if you update something and want a tester…

I have added the min and max as in harvest-time. And also the range. I’m not sure what is not working for you in storing parameters, it works fine as is for me with the typeof. But, I think in the guide I used self. instead of this. That is updated as well.

I don’t want to post my latest iteration though because for some reason the ogres now just stand there letting me run up to them and start shooting.

OK, updated the new version now. Only issues are the weird shadowing. Thoughts?

As said, the level looks broken. Maybe you should keep the grass everywhere, even if the playground area is smaller.
I had to run clockwise now, but it’s still working.

About parameter memorization, in fact, it works. But the debugger is not displaying the value, you must use this.say to get it. And the value do not appear in this also.

Both code are working :

if (this.remember === undefined){
this.remember = 0;
}

OR

if (typeof this.remember === ‘undefined’){
this.remember = 0;
}

I have posted a new version that doesn’t look broken…

Until you start to play. For some reason the ogres have stopped moving. I’m not sure what I did to make them stop moving. They target the archer, but don’t move. Thus, the level is quite easy currently. Any help waking the ogres from their lazy slumber to be rampaging beasts again would be appreciated!

I had the same problem when modifying your map. I’m not sure what causes this. Fixing an ogre brawler can be achieved by

  1. removing targeting.Targets, which also removes ai.AutoTargetsNearest, ai.ChasesAndAttacks, combat.Attacks and movement.Teleports, and then

  2. restoring ai.AutoTargetsNearest (which also restores targeting.Targets), ai.ChasesAndAttacks (which restores combat.Attacks) and movement.Teleports in this order.

Note that this reverses the order in which ai.AutoTargetsNearest and ai.ChasesAndAttacks occur in the component list. I am not sure if that is relevant though.

Hope that helps, cheers

Aah, thank you! It works now. I’m feeling reasonably good with the version now. Any more tweaks you guys would like for the guide and stuff?

Also, do you think I should come up with a way to give access to the actual boundary objects, or is the description as it stands good enough? I’ve assigned xmin/xmax/ymin/ymax to keep you on the stone, but you can actually move out into the grassy areas as well:

You can go anywhere inside of the red, should I come up with a way to give the wizards specific access to those, or is it fine just sticking with the stones? (It is winnable without leaving the stones.)