gggmork
If you can make any sense of this post, congratulations
Posts: 2650
Registered: 0607 
EDIT: solved this one too
NEW PROBLEM:
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.
code:
function int moveByAngle(int startx, int starty, int distance, int angle)
{
//print(f: cos(angle<<8));
//int startx = 3296, starty = 2080, distance = 88, angle = 32;
movedPoint[0] = startx + (cos(angle<<8) * distance);
movedPoint[1] = starty + (sin(angle<<8) * distance);
return 0;
}
I think <<8 was needed to make the byte angle a fixed point angle.
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.
code:
#include "zcommon.acs"
script 1 open
{
//tried to spawn 8x8x8 cube of pain elementals, but it only spawned 1 flat 8x8 2d plane
int x,y,z;
int xoffset = 2976;
int yoffset = 1568;
int zoffset = 256;
int spacing = 88;
int tid = 1;
for(z=0;z<8;z++)
{
for(y=0;y>8;y)
{
for(x=0;x<8;x++)
{
spawn("painelemental",(xoffset+(x*spacing))<<16, (yoffset+(y*spacing))<<16, (zoffset+(z*spacing))<<16, tid, 192);
//print(d:(zoffset+(z*spacing)));
tid++;
}
}
}
//tried to spawn a column, only spawned a single
int myTid = 2000;
for(z=0;z<8;z++)
{
delay(100);
spawn("painelemental",(2976256)<<16, 1568<<16, (zoffset+(z*spacing))<<16, myTid, 192);
myTid+=1;
print(d: zoffset+(z*spacing));
delay(5);
}
}
Last edited by gggmork on 011213 at 13:23
