Hello again. This time I have a number of questions for smarter people than I out there, in a last ditch attempt to somehow attain a working program.
1.) I was trying to work with particles, but whenever I ran the file, I got this little error:
So I fixed that problem, but it still says it can't load the level.
I've heard worse... And better still, the program runs fine after that! Just, without entities... They disappear. (I found some little blurb in AUM 30 suggesting that the error was caused by starter functions or functions from a previous level that hadn't terminated. Except, I had neither of those.)
So, next, I delete main and some variables and create a second file called "gEffects.wdl", and include it into my game.
Running it, I've discovered that there really was no problem, as I get no error. That is, until the create() instructions.
A little context:
Code:
function createGreenSparks01(VECTOR* effectCenter)
{
vec_scale(normal,100); // produce an explosion into the normal direction
effect(effect_beam,5,effectCenter.x,normal);
}
... (and in another file)
//within the bullet01 event function
if (Event_type == EVENT_Block)
{
my.alpha=9;
createGreenSparks01(me);
}
It looks all right to me. But, I get this error after shooting a bullet at the wall:
Is there some problem with my function? Did I pass incorrect variables? Why????
Any answer would be most appreciated...
Oh, yes, you may want to see the particle functions:
Code:
function effect_beam()
{
vec_randomize_beam(temp,13); // gives three random velocity vectors
vec_add(my.vel_x,temp);
my.alpha = 30 + random(25);
my.size=2;
my.bmap = NULL; //don't need a bmap, just use squares
my.red=100;
my.blue=129;
my.green=225;
my.flare = on;
my.bright = on;
my.beam = on; //streak
my.move = on;
my.function = part_alphafade; //fade out the particle
}
function part_alphafade() //fades out a particle
{
my.alpha -= 5*time_step;
if (my.alpha <= 0) { my.lifespan = 0; }
}
2.) Question numero 2. What is it with vectors? Not really having a problem with them right now, but the manual seems unable to give a satisfactory explanation. Obviously they are not entities, but I can give an entity pointer to a procedure that takes a vector and it won't complain. Also, they seem to have the normal x, y, z, pan, tilt, roll variables, so what are they? If you could clear the windshield for me, that would be really appreciated.
3.) Almost directly involved with vectors, I still find myself unable to work with vector_for_screen() and vec_to_ang().
A quick problem from an RTS-like game:
Code:
//controls setting the point to move to
if (mouse_right == 1) && (my.selected == 1)
{
my.targetset=1; //true
vec_set(temp, mouse_pos); //get the mouse position
vec_for_screen(temp, camera); //get the real-world coords
my.TargetX=temp.X; //save for later
my.TargetY=temp.Y;
vec_sub(temp, my.x);
vec_to_angle (my.pan, temp); //turn to face the mouse pos
my.tilt=0; // keep me level
}
What is the problem there? Idk where I went wrong, so I'd love some help... (By the way, the player ends up facing dead south (towards the camera) )
4.) my.POLYGON = ON; //beat head against wall
I can't seem to get this to work. I know it says to not use it for moving enitites, but can I, if I'm willing to take the processing speed hit? Also, when I c_rotate my ship enitity, the wings just pass right through the blocks! Can someone explain the Polygon flag to me?
Any answers you could give me would be appreciated!!