To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 399
398  |  400
Subject: 
Re: Problems with FindWorld() function
Newsgroups: 
lugnet.robotics.spybotics
Date: 
Wed, 8 Jun 2005 20:49:49 GMT
Viewed: 
7317 times
  
In lugnet.robotics.spybotics, Wolfgang Heinrich wrote:
I'm checking out the function FindWorld() [with BrixC and nqc version 3.1 a1
(built Mar  8 2005, 07:33:11)] and run into problems. The call
  int t = -1;
  ClearWorld();
  FindWorld(t, SPY_RANGE, REL_GT, RANGE_NOWHERE);
seems to work quite well. However if I try to restrict the conditions for
finding items I get bad results.

FindWorld(t, SPY_RANGE, REL_EQ, ... )
finds no items. I tried it out with last parameter = RANGE_HERE, RANGE_THERE and
RANGE_ANYWHERE. None of them worked.

If I try
FindWorld(t, SPY_RANGE, REL_GT, ... )
then FindWorld always finds an item regardless of the last parameter. E.g.
FindWorld(t, SPY_RANGE, REL_GT, RANGE_THERE)
finds items in the THERE range, too.

I'm not sure if this is a bug in NQC (or in the firmware ?!?) or if I do
something wrong. Can anybody help?

The code generated by NQC appears to be correct.  I've had reports over the
years from lots of people who have had great success with using the world
relation table information in the Spybot so I doubt that the firmware is buggy
in this respect (i.e., find world).  Possibly you are calling FindWorld too
quickly after calling ClearWorld.  ClearWorld will remove all entries from the
world relation table.  FindWorld just returns the first entry in the table that
matches the specified criteria so if the table is empty then it would not find
anything.  There are at least two very good examples of using the FindWorld API
function in NQC in the Lugnet Newsgroups.

http://news.lugnet.com/robotics/spybotics/?n=269

http://news.lugnet.com/robotics/spybotics/?n=367

Unfortunately, neither of these exercise the FindWorld function with values
other than REL_GT and RANGE_NOWHERE.  I will try to run some tests myself to
verify whether other parameters work correctly.

John Hansen



Message has 1 Reply:
  Re: Problems with FindWorld() function
 
(...) Nope. NQC is definitely generating bad code. My apologies. I will fix it right away. John Hansen (19 years ago, 9-Jun-05, to lugnet.robotics.spybotics)

Message is in Reply To:
  Problems with FindWorld() function
 
I'm checking out the function FindWorld() [with BrixC and nqc version 3.1 a1 (built Mar 8 2005, 07:33:11)] and run into problems. The call int t = -1; ClearWorld(); FindWorld(t, SPY_RANGE, REL_GT, RANGE_NOWHERE); seems to work quite well. However if (...) (19 years ago, 8-Jun-05, to lugnet.robotics.spybotics)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR