Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, VoroneTZ, 1 invisible), 1,512 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Particles, vectors, collision, and other questions #172956
12/15/07 17:35
12/15/07 17:35
Joined: Apr 2007
Posts: 67
suriname0 Offline OP
Junior Member
suriname0  Offline OP
Junior Member

Joined: Apr 2007
Posts: 67
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!!


If I am posting, it probably means I am asking a question. Or faking my knowledge by agreeing with somebody else.
Re: Particles, vectors, collision, and other quest [Re: suriname0] #172957
12/15/07 17:46
12/15/07 17:46
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Your problem seems that youre confusing different things in your game. The first error means youre confusing a level with an image, and in the particle problem youre confusing a VECTOR with an ENTITY.

All those are different things meant for different purposes. When you want to load an image you must not load a level, and when a function like your createGreenSparks01 needs a VECTOR you have to give it a VECTOR and not an entity like "me".


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1