![]() |
My super move is not so super after all. - Printable Version +- Colobot Forum - International Colobot Community (https://colobot.info/forum) +-- Forum: [Archive] New forum (2015-2019) (https://colobot.info/forum/forumdisplay.php?fid=76) +--- Forum: Colobot: Gold Edition Basics (https://colobot.info/forum/forumdisplay.php?fid=58) +---- Forum: Help (https://colobot.info/forum/forumdisplay.php?fid=61) +---- Thread: My super move is not so super after all. (/showthread.php?tid=913) |
My super move is not so super after all. - Quartofel - 03-27-2017 Code: extern void object::Main() It won't go for set distance, and sometimes it climbs obstacles properly, sometimes don't. Don't know why. RE: My super move is not so super after all. - krzys_h - 03-27-2017 What is the chkpos function supposed to actually do? Return a point c meters in front of the robot? (I'm too lazy to try to understand the whole code ![]() If so... why not just Code: point object::chkpos(int c) I can't see any other immediate problems, other than the way you do the altitude choice could probably be done better - I'd just let the wasp stay at around z=max(topo(this.position), chkpos(20))+some_arbitrary_altitude_above_ground. Anyway, your code seems to work fine for me, unless you have some level with terrain changes big enough for it to break. RE: My super move is not so super after all. - Mrocza - 03-28-2017 It seems needlessly complicated to me for some reason. You can use the wasp's velocity with the chkpos() to return a point x seconds in front of it. Then adjust the motor to the ratio of these two points' topo(). For jet() I always do a single line: Code: jet(( targetPosZ - this.position.z ) / smoothingFactor) RE: My super move is not so super after all. - krzys_h - 03-28-2017 (03-28-2017, 07:57 AM)Mrocza Wrote: You can use the wasp's velocity with the chkpos() to return a point x seconds in front of it.Oh, I totally forgot object.velocity is now a thing... and I'm the one who implemented it ![]() |