If you can make any sense of this post, congratulations
EDIT: solved this one too
trying to move a point (x & y) a arbitrary distance at an arbitrary angle. Too much fixed point vs map point, radians vs deg, byte angle vs blah angle...
Don't even think the cosine is spitting out the right thing because google gave me cos(45) is 0.52532198881... but acs was telling me it was about 0.7 or so I think.
I think <<8 was needed to make the byte angle a fixed point angle.
function int moveByAngle(int startx, int starty, int distance, int angle)
//int startx = -3296, starty = 2080, distance = 88, angle = 32;
movedPoint = startx + (cos(angle<<8) * distance);
movedPoint = starty + (sin(angle<<8) * distance);
Supposedly cos(angle<<8) should return a fixed point number but trying to >>16 or <<16 or whatever it didn't seem to work.
Basically the above is probably full of fail and I'm doing it wrong.
EDIT: BELOW WAS SOLVED/IGNORE figured the below out, so ignore it. I had to type compat_nopassover = "false" in the console. Apparently it has been set to true all this time, don't remember why.
So I guess you can't spawn monsters on top of eachother? This is weird because this is zdoom doom in hexen, and it at least spawned a flat plane of 8x8 pain elementals (even though I wanted a 8x8x8 cube which spawn failed to make). But even though the plane was 256 high, I couldn't walk underneath them... I thought zdoom had no infinite tallness doubleyou tee eff.
The 2nd column part prints z each time, so you can see z is correct but it just doesn't spawn anymore when a monster has already been spawned exactly below it.
script 1 open
//tried to spawn 8x8x8 cube of pain elementals, but it only spawned 1 flat 8x8 2d plane
int xoffset = -2976;
int yoffset = 1568;
int zoffset = 256;
int spacing = 88;
int tid = 1;
spawn("painelemental",(xoffset+(x*spacing))<<16, (yoffset+(y*spacing))<<16, (zoffset+(z*spacing))<<16, tid, 192);
//tried to spawn a column, only spawned a single
int myTid = 2000;
spawn("painelemental",(-2976-256)<<16, 1568<<16, (zoffset+(z*spacing))<<16, myTid, 192);
Last edited by gggmork on Jan 12 2013 at 13:23