Hi, i started with the Workshop 55 from the AUM magazine.
But i have a problem with script30.wdl from the donwloadsection.
If i start the level via WED it works well. But if i try to start the level with SED, i get a black window but no errors.
There is only the script30.wdl
///////////////////////////////////////////////////////////////////////////////////////
var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode
var video_screen = 1; // start the engine in full screen mode
////////////////////////////////////////////////////////////////////////////////////////
string work30_wmb = <work30.wmb>;
string bullet_mdl = <bullet.mdl>; // always define ent_created bullet models as strings!
////////////////////////////////////////////////////////////////////////////////////////
function fire_bullets(); // creates the bullets
function move_bullets(); // moves the bullets
function remove_bullets(); // removes the bullets after they've hit something
////////////////////////////////////////////////////////////////////////////////////////
function main()
{
level_load (work30_wmb);
wait(2);
}
action players_code
{
player = my; // I'm the player
my.invisible = on; // no need to see player's model in 1st person mode
while (1)
{
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (my, vector(10 * (key_w - key_s) * time, 6 * (key_a - key_d) * time, 0), nullvector, glide);
if (mouse_left == on) // if the player presses the left mouse button
{
fire_bullets(); // call this function
}
vec_set (camera.x, player.x); // use player's x and y for the camera as well
camera.z += 30; // place the camera 30 quants above the player on the z axis (approximate eye level)
camera.pan -= 5 * mouse_force.x * time; // rotate the camera around by moving the mouse
camera.tilt += 3 * mouse_force.y * time; // on its x and y axis
player.pan = camera.pan; // the camera and the player have the same pan angle
wait (1);
}
}
function fire_bullets()
{
proc_kill(4); // don't allow more than 1 instance of this function to run
while (mouse_left == on) {wait (1);} // wait until the player releases the mouse button
ent_create (bullet_mdl, camera.x, move_bullets); // create the bullet at camera's position and attach it the "move_bullets" function
}
function move_bullets()
{
var bullet_speed; // this var will store the speed of the bullet
my.enable_impact = on; // the bullet is sensitive to impact
my.enable_entity = on; // and to other entities
my.enable_block = on; // as well as to level blocks
my.event = remove_bullets; // when it collides with something, its event function (remove_bullets) will run
my.pan = camera.pan; // the bullet has the same pan
my.tilt = camera.tilt; // and tilt with the camera
bullet_speed.x = 50 * time; // adjust the speed of the bullet here; it will move in the direction given by the camera
bullet_speed.y = 0; // the bullet doesn't move sideways
bullet_speed.z = 0; // or up / down on the z axis
while (my != null) // this loop will run for as long as the bullet exists (it isn't "null")
{
c_move (my, bullet_speed, nullvector, ignore_you); // move the bullet ignoring its creator (the player)
wait (1);
}
}
function remove_bullets() // this function runs when the bullet collides with something
{
wait (1); // wait a frame to be sure (don't trigger engine warnings)
ent_remove (my); // and then remove the bullet
}
I had other levels and they worked in WED and SED, so i cannot
say what is not right.
Can someone say me what could cause this problem ?
I use the A7 Trial version
Greetings fanatiker