|
Problem with SED
#223759
08/26/08 13:35
08/26/08 13:35
|
Joined: Dec 2004
Posts: 35 Germany
Fanatiker
OP
Newbie
|
OP
Newbie
Joined: Dec 2004
Posts: 35
Germany
|
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
|
|
|
Re: Problem with SED
[Re: Fanatiker]
#223812
08/26/08 19:37
08/26/08 19:37
|
Joined: Jan 2008
Posts: 1,580
Blade280891
Serious User
|
Serious User
Joined: Jan 2008
Posts: 1,580
|
Im not sure, but shouldnt var video_mode = 7; // 800x600 pixels var video_depth = 32; // 32 bit mode var video_screen = 1; // start the engine in full screen mode
be in the main function?
My Avatar Randomness V2"Someone get me to the doctor, and someone call the nurse And someone buy me roses, and someone burned the church"
|
|
|
Re: Problem with SED
[Re: Blade280891]
#223817
08/26/08 19:48
08/26/08 19:48
|
Joined: Apr 2006
Posts: 624 DEEP 13
badapple
User
|
User
Joined: Apr 2006
Posts: 624
DEEP 13
|
no they shouldnt , they are correct where they are
@fanatiker ..... if you can start it with wed and it works well then you should start it with wed , but i hear ya , i dont like it when something doesnt work right either
Last edited by badapple; 08/26/08 19:55.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|