forums

TNT Basic Forums > Programming Q&A
Re
< Last Thread     Next Thread >
Author
Thread        Post A Reply

09-07-2002 23:38

Posted by:
Mathew

Click Here to Email Mathew   Find more posts by Mathew

This code is quite hard to read. Could you send me the file?

09-07-2002 23:46

Posted by:
Holmes

Click Here to Email Holmes   Find more posts by Holmes

Yeah, the forum didn't seems to have taken out all the formatting characters!

I'd send you the file but it is HUGE, and also has pages upon pages of irrelevent code you could get lost in. Lemme try this again, with a simpler print statement:

Procedure rotatevehicle(int vx,int vy)
int m
float rotation
for m = 0 to map polygon count-1
if in map polygon (m,vx,vy,0) = true
rotation = 270
print "Object IS in Polygon"
else if in map polygon (m,vx,vy,0) = false
print "Object is NOT within Polygon"
end if
next m
end Proc (rotation)

the parameters vx and vy are being sent in tile coordinates (aka pixels over tile width) but I've also tried sending them as pixels and neither works.

09-07-2002 23:47

Posted by:
Holmes

Click Here to Email Holmes   Find more posts by Holmes

arg! Why won't this stupid forum format my code! Oh well, I think you could indent that yourself and make sense of it.

09-08-2002 13:37

Posted by:
Mathew

Find more posts by Mathew

Verify you've been using the good parameters in IN MAP POLYGON. If you put the wrong number at the wrong place, it might not work. Also, you could try it out of the procedure. Procedures are harder to use, so make sure the map is loaded and the variables exist and all that kind of things.

09-08-2002 22:10

Posted by:
Holmes

Click Here to Email Holmes   Find more posts by Holmes

Yeah, I did all those things. I just can't figure out whats wrong. I've gone to using map objects instead of polygons and sort of simulating the way polygons work.

09-09-2002 22:49

Posted by:
Mathew

Click Here to Email Mathew   Find more posts by Mathew

Try reproducing the bug into a smaller file with no extra code, and then send it to me.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.