PDA

View Full Version : Solved: Snap Into AND Find Location For fail


MogHughson
25th Jan 2010, 05:48 PM
I have a small object that is failing both a call to "Snap Into" to place on desk or table, and the subsequent call to "Find Location For" which just finds a nearby spot - on the floor if necessary - to place it. The code making the calls to "Snap Into" and "Find Location For" both work fine with another small object, but not with this one. Both objects use the same function for initialisation and setting of all the placement flags and allowed height flags so these shouldn't be the problem (?); they also both have the same values for OBJD User Placements flags (including Use Default Placement flags = 0 so these shouldn't be used anyway); and they also both have the same value for OBJD Object Size (quantity per shelf).

What else about an object can cause it to fail these calls?

Cheers
Mog :Pint:

xkiwix
25th Jan 2010, 11:04 PM
Both objects really using the same global and same function for initialisation? Because "[prim 0x0002] Expression (My 0x001B (weight) := Literal 0x0002)" and "[prim 0x0002] Expression (My 0x001C (support strength) := Literal 0x0003)" are important, too.
If the weight to big, you can't place it on a table or desk.

---
sorry for my english :wtf:

MogHughson
26th Jan 2010, 08:21 PM
They are both really using the same global and the same function for init. The fact that the "Find Location For" which just ends up putting it on a free tile on the floor for the working object, surely means that weight isn't an issue. Can't any weight be on the floor. The init function sets weight to zero for both.

Thanks for the suggestions though - but I think I have ruled those out.

xkiwix
26th Jan 2010, 09:19 PM
maybe you can upload the object? it sounds "interesting".

Inge Jones
26th Jan 2010, 10:49 PM
Is the original object one that is allowed to be placed on the floor - ie same sort of location you want it to be placed programmatically?

Echo
26th Jan 2010, 10:54 PM
Any chance of a stack trace? Are you sure that's the line which is breaking, and it's not just a flow through from an earlier error?

MogHughson
28th Jan 2010, 09:04 PM
Is the original object one that is allowed to be placed on the floor - ie same sort of location you want it to be placed programmatically?The one I cloned it from is, but when I made this object buyable just now to test placing it from Buy Mode it was unhappy so that probably means it would be unhappy with these other calls too.

I will reclone - probably took too much out somewhere along the lines and see if it works better. I'll be back here to let you know or beg for more help!!

Thanks for the ideas so far.
Cheers
Mog :Pint:

MogHughson
31st Jan 2010, 03:07 PM
I found my error - essentially any error in early life of the object will of course mean that instructions to place it somewhere, will fail. I have created the wiki page for "Find Location For" 0x0010 and added the advise I learned to a section within it - for future reference and to close the loop on this thread.