LavishNav List<Region> problem

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
onlyme
GamingTools Subscriber
Posts: 11
Joined: Wed May 31, 2006 8:42 am

LavishNav List<Region> problem

Post by onlyme » Sat Jan 13, 2007 7:34 pm

Hi,

I dont realy know if this is the right place for this, but as I have diffrent waking houres than Lax :)

All functions returning List<Region> seem to be generating a IndexOutOfBounds problem.

Functions I tested by now include
DescendantsWithin.
NearestChildren, and
RegionsWithin

But I am guessing it apply to all of them.

I have tried to replicte the DescendantsWithin with

Code: Select all

        public List<Region> DescendantsWithin&#40;Region _base,double X, double Y, double Z, double MaxDist&#41;
        &#123;

            List<Region> list2 = new List<Region>&#40;&#41;;
            LavishScriptObject obj1 = LavishScript.Objects.NewObject&#40;"index&#58;lnavregionref"&#41;;
            if &#40;obj1 == null&#41;
            &#123;
                return null;
            &#125;
            int num1 = _base.GetMember<int>&#40;"DescendantsWithin", obj1.GetLSReference&#40;&#41;, MaxDist.ToString&#40;&#41;, X.ToString&#40;&#41;, Y.ToString&#40;&#41;, Z.ToString&#40;&#41;&#41;;
            OnLog&#40;"in DescendantsWithin&#40;&#41; num1="+num1.ToString&#40;&#41;&#41;;
            if &#40;num1 <= 0&#41;
            &#123;
                return null;
            &#125;
            List<Region> list1 = new List<Region>&#40;num1&#41;;
            for &#40;int num2 = 1; num2 < num1; num2++&#41;
            &#123;
                Region tmp = new Region&#40;obj1.GetIndex&#40;num2.ToString&#40;&#41;&#41;&#41;;
                if &#40;tmp.Name != null &#41;list1.Add&#40;tmp&#41;;
            &#125;
            list2 = list1;
            return list2;
        &#125;
Thanx for help on that one Greyman for giving me tha dasm of the original

However even tho this seem to work it once in a while return illigal objects that when I try to assign them generate a "Heck No" Errormessage.

I also sent an email to Lax before.

/Me

onlyme
GamingTools Subscriber
Posts: 11
Joined: Wed May 31, 2006 8:42 am

Post by onlyme » Mon Jan 15, 2007 3:57 pm

Lax, no OutOfIndex now but I still get unasignable objects in the list giving the "Heck No" IS Crash Error

/Me

onlyme
GamingTools Subscriber
Posts: 11
Joined: Wed May 31, 2006 8:42 am

Post by onlyme » Thu Jan 18, 2007 7:56 pm

Lax, did you find anything on the illigal returns in or did you want me to send an example program showing the problem?

/Me

Post Reply