1st) It's called the MANUAL... You will hear this very often, lol. It contains (almost) everything you need to know.

2nd) It's SPRITE (like the soda), not SPIRIT (like a ghost). sprites are simply images. The problem is, what you are trying to do (shattering on the window) requires decals, and A6 currently does NOT support this. However, it is an upcomming feature. However, you may also position a sprite along the window, but you'd have to carefully place your window so that the sprite does not show up anywhere past the window.

3rd) Writing code "from the air". Well, I wish it were simply in the air to grab, but it's not . In truth, I still use the manual, but rarely. After you've been writing it for >3 years, you start to remember basic concepts of how things work. However, sometimes you have to look up the syntax of a function (which parameters to use), like i do.


finally) I've seem to be helpin you out alot lately, so why stop now . First off, the gate code. Now, physics gates (like in Manhunt) are a little harder to make, so I'm just gonna give you one that opens when the player is close to it. You will need to put the origin of the model on one of the sides of the gate (where the hinges would be).

Code:

ACTION GATE
{
// Distance from center...
my.skill1 = 500;
//
// Gate Speed...
my.skill2 = 5;
//
// Gate Angle to swing to
my.skill3 = 130;
//
// Set center of gate...
var MCenter[3];
vec_set(MCenter, my.x);
vec_add(MCenter, my.max_x);
MCenter.x -= ((my.max_x - my.min_x) / 2);
MCenter.y -= ((my.max_y - my.min_y) / 2);
MCenter.z -= ((my.max_z - my.min_z) / 2);
//
// Wait until close enough...
while(vec_dist(MCenter, player.x) < my.skill1)
{wait(1);}
//
// Remember original pan angle...
my.skill11 = my.pan;
//
// contains angle to add to original angle
my.skill10 = 0;
//
// Wait until gate reaches angle
while(my.skill10 < my.skill3)
{
// increase gates angle by speed, but don't go too far!
my.skill10 = min(my.skill10 + (my.skill2 * time), my.skill3);
//
// Set pan to original pan + new angle
my.pan = my.skill11 + my.skill10;
wait(1);
}
//
// Done!
}



This is the most work I've ever put into a post, so I hope it's helpful. You're lucky you caught me in a good mood . As for animating, here's a short example...

Code:

// The name of the scene in MED (default: Frame)
string SceneGlassBreak = "Break";
//
// Speed to animate
var AnimSpeed = 10;
//
...
// variable for holding animate position (in percent)
var i = 0;
//
// cycle until animation is done
while(i < 100)
{
// increase i by AnimSpeed, but not past 100%
i = min(i + (AnimSpeed * time), 100);
//
// Animate entity (non cycling animation)...
ent_animate(my, SceneGlassBreak, i, null);
//
wait(1);
}
// Done!
...




Good luck!


xXxGuitar511
- Programmer