﻿ Falling on land when over trees - how to prevent?

Thread Rating:
• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Falling on land when over trees - how to prevent? Rinoldo PracticeBot Posts: 14 Threads: 3 Joined: Mar 2016 Reputation: 0 #1 03-17-2016, 09:32 AM (This post was last modified: 03-17-2016, 09:33 AM by Rinoldo.) In the 3-d mission "Tropica" in the 3-d part where we need to destory AlienAnts my flying shooter falls on the land when it flies over the trees. It's seems to be a bag because when I fly over those trees manually (with buttons w,a,s,d) the flying shooter doesn't fall and everything is ok. I tried to programm bot to fly higher - 20 meters - but nothing changes. Please advice how to solve this problem! Rinoldo PracticeBot Posts: 14 Threads: 3 Joined: Mar 2016 Reputation: 0 #2 03-17-2016, 02:27 PM (This post was last modified: 03-17-2016, 02:27 PM by Rinoldo. Edit Reason: replaced if with while in the very end of code ) Here is my full code for flying Shooter: Code:```extern void object::HuntAnt() { object ant, power; power = radar(PowerStation); point pos, pos2; jet(0.2); aim(-40); while(true) { while(true) { while(radar(AlienAnt, 0, 360, 0, 20) == null) { ant=radar(AlienAnt); turn(direction(ant.position)); motor(1,1); /*errmode(0); int err; err = motor(1,1); if ( err != 0 ) { motor(-1, -1); jet(1); wait(0.5); }*/ jet(0); if (position.z - topo(position) < 8)    jet(1); if(position.z - topo(position) > 9)    jet(-0.1); wait(0.1); pos = position; wait(0.1); pos2 = position; if (pos == pos2) { move(-3); turn(90); move(3); } } fire(1); if (energyCell.energyLevel < 0.3) break; } errmode(0); int err; err = goto(power.position); if ( err != 0 ) { motor(-1, -1); jet(1); wait(0.5); } while (energyCell.energyLevel < 1)    wait(1); } }``` tomaszkax86 TerranovaTeam member Posts: 157 Threads: 5 Joined: Mar 2013 Reputation: 60 #3 03-17-2016, 02:59 PM Do you mean those trees? Those are graviplants. They make you unable to fly inside green spherical gas cloud they create. From what I know, you can't fly above them. "After three days without programming, life becomes meaningless." ~The Tao of Programming RaptorParkowsky Turquoise Raptor Posts: 1,114 Threads: 32 Joined: Oct 2012 Reputation: 53 #4 03-17-2016, 03:03 PM (This post was last modified: 03-17-2016, 03:05 PM by RaptorParkowsky.) Oh, you mean the bot just falling because of gravi-plant? Well, it's not a bug, it's a naturally growing on Tropica planet feature . Every flying bot or astronaut will fall or fly very low to the ground while's under gravi-plant's dome. EDIT: Shoot! @tomaszkax86 was faster than me! Until next time... Simbax A Cat Posts: 837 Threads: 80 Joined: Oct 2012 Reputation: 141 #5 03-17-2016, 04:08 PM (This post was last modified: 03-17-2016, 05:44 PM by Simbax.) Yeah, I was thinking it would be graviplants, but the description of the "bug" is too odd and ambigous to be sure. I can't believe a person could not know about graviplants, especially that this is the third mission on Tropica and there is no posssibility someone would not notice graviplants in the first missions. EDIT: you got to be kidding me...   krzys_h The Programmer Posts: 828 Threads: 26 Joined: Oct 2012 Reputation: 113 #6 03-17-2016, 04:23 PM (03-17-2016, 09:32 AM)Rinoldo Wrote: It's seems to be a bag because when I fly over those trees manually (with buttons w,a,s,d) the flying shooter doesn't fall and everything is ok.If this is true, then it is indeed a bug. You are not supposed to be able to fly at all inside graviplants. Rinoldo PracticeBot Posts: 14 Threads: 3 Joined: Mar 2016 Reputation: 0 #7 03-17-2016, 05:37 PM (03-17-2016, 04:23 PM)krzys_h Wrote: If this is true, then it is indeed a bug. You are not supposed to be able to fly at all inside graviplants. After reading all posts above I tried once more to fly manually over those trees, more thoroughly. And yes you'r right I fell just like flying shooter did!   So it's not bug but damned graviplants. This makes the whole mission more complicated so my next question is, how to stay away from them? How I can tell by bot, that it's too dangerous to come near to graviplant less then n metres? Or may be it is not effective way to kill the ants? How did you people make this mission? tomangelo TerranovaTeam member Posts: 825 Threads: 26 Joined: Oct 2012 Reputation: 90 #8 03-17-2016, 08:04 PM Probably it will require some more complex algorithm instead of simple goto() method, with detecting where these plants are located and avoiding these places. To be honest, I've always do this mission manually, I weren't so good then in all these programming things. Spoiler : krzys_h The Programmer Posts: 828 Threads: 26 Joined: Oct 2012 Reputation: 113 #9 03-17-2016, 08:11 PM The original missions weren't really well designed for doing them with programming only. This is one of the things we are aiming to fix with Gold Edition, although mission refactoring is delayed until a later stage of development. Rinoldo PracticeBot Posts: 14 Threads: 3 Joined: Mar 2016 Reputation: 0 #10 03-18-2016, 05:02 AM (This post was last modified: 03-18-2016, 05:19 AM by Rinoldo.) (03-17-2016, 04:08 PM)Simbax Wrote: Yeah, I was thinking it would be graviplants, but the description of the "bug" is too odd and ambigous to be sure. I can't believe a person could not know about graviplants, especially that this is the third mission on Tropica and there is no posssibility someone would not notice graviplants in the first missions. EDIT: you got to be kidding me... I didn't mentioned that I played the first missions of Tropica about half of year ago. If i wrote code in that moment may be I wouldn't be suprised by this feature of graviplants. Some details fades away from memory as times goes by. The first thing I remember about those green bubbles is that they may kill you if you step into them. (03-17-2016, 08:11 PM)krzys_h Wrote: The original missions weren't really well designed for doing them with programming only. This is one of the things we are aiming to fix with Gold Edition, although mission refactoring is delayed until a later stage of development. I see. I tried to use WheeledShooter but there are some other inconveniences, such as attemts of Wheeled shooter to fire through the graviplants, or the too big difference in vertical axis of the gun and ant because of hilly land, or sometimes the bot hits a graviplant, tries to drive round it meanwhile AlienAnt destroys the shooter. May be these problems are solvable, in this case I'll be grateful if someone point out ways to settle them. Of course I always can pass this mission manually, but I'd like to do the last attempt to pass it by programming. melex750 TrackedGrabber Posts: 43 Threads: 10 Joined: Sep 2015 Reputation: 21 #11 03-18-2016, 07:38 AM Code:```int Graviplant = 715;      object obj = radar(Graviplant);      if (distance2d(this.position, obj.position) <= 32) {     message("very close to graviplant"); }``` krzys_h The Programmer Posts: 828 Threads: 26 Joined: Oct 2012 Reputation: 113 #12 03-18-2016, 08:06 AM @melex750 This is a pretty nice workaround right there I completly forgot you can use radar() with objects that normally don't have a category defined. Rinoldo PracticeBot Posts: 14 Threads: 3 Joined: Mar 2016 Reputation: 0 #13 03-18-2016, 09:39 AM (03-18-2016, 07:38 AM)melex750 Wrote: Code:```int Graviplant = 715;      object obj = radar(Graviplant);      if (distance2d(this.position, obj.position) <= 32) {     message("very close to graviplant"); }``` I'm not sure that I uderstand this code quite clear. I tried to change meaning of int Graviplant. It works only within 710-715. Why is that? Simbax A Cat Posts: 837 Threads: 80 Joined: Oct 2012 Reputation: 141 #14 03-18-2016, 10:04 AM   krzys_h The Programmer Posts: 828 Threads: 26 Joined: Oct 2012 Reputation: 113 #15 03-18-2016, 10:14 AM Keep in mind these numbers are not officialy part of CBot interface, and thus they may change in the future. We tend to avoid changing them though. PS. 715 is Graviplant, 710-714 is other plants with no graviplant effect Rinoldo PracticeBot Posts: 14 Threads: 3 Joined: Mar 2016 Reputation: 0 #16 03-18-2016, 03:47 PM Thank you everybody for help! « Next Oldest | Next Newest »

Forum Jump:

Users browsing this thread: 1 Guest(s)