ok i did some editing and came up with this. i had todo this because when i downloaded this tutorial it wouldn't work....
c_move(me, vector(1, 0 ,-1 ), vector(0, 0 ,0 ), GLIDE); // i put in this line so the actor actualy moves towards the location.
from a programmers point of view , i can say that the "noobs" have problems finding the right piece of code to make things work. Dont flame me about it iam just pointing it out that its still hard to get things done with the help file ect... also looking for piece`s of code take allot of time. iam alone and don't have anyone to work with that can help me ect.
/////////////////////////////////////////////////////////////////////////////////////////////
// copy this folder inside your gamestudio folder
// open rpg1.wmp, build it and run it using rpg1.wdl
/////////////////////////////////////////////////////////////////////////////////////////////
var video_mode = 12; // 800x600 pixels
var video_depth = 16; // 16 bit mode
/////////////////////////////////////////////////////////////////////////////////////////////
string rpg1_wmb = "test.wmb";
string destination_mdl = "destination.mdl";
/////////////////////////////////////////////////////////////////////////////////////////////
sound beep_sound = <beep.wav>;
/////////////////////////////////////////////////////////////////////////////////////////////
function set_target();
function show_target();
/////////////////////////////////////////////////////////////////////////////////////////////
entity* destination;
/////////////////////////////////////////////////////////////////////////////////////////////
bmap pointer_pcx = <pointer.pcx>;
/////////////////////////////////////////////////////////////////////////////////////////////
action warlock
{
player = me;
while (1)
{
my.skill1 = 5 * time;
my.skill2 = 0;
vec_set (temp, my.x);
temp.z -= 3000;
trace_mode = ignore_you + ignore_passable + use_box;
my.skill3 = -trace (my.x, temp);
if (destination != null)
{
vec_set (temp.x, destination.x);
vec_sub (temp.x, my.x);
vec_to_angle (my.pan, temp); // turn towards the destination
my.tilt = 0; // don't bow
if (vec_dist (my.x, destination.x) > 60)
{
move_mode = ignore_passable;
c_move(me, vector(1, 0 ,-1 ), vector(0, 0 ,0 ), GLIDE); // i put in this line so the actor actualy moves towards the location.
wait(1);
ent_cycle("walk", my.skill46);
my.skill46 += 10 * time; // "walk" animation speed
my.skill46 %= 100; // loop animation
}
else
{
destination.invisible = on;
ent_cycle("idle", my.skill46); // play "stand" frames animation
my.skill46 += 1 * time; // "stand" animation speed
my.skill46 %= 100; // loop animation
}
}
wait (1);
}
}
function set_target()
{
var pos1;
var pos2;
pos1.x = mouse_pos.x;
pos1.y = mouse_pos.y;
pos1.z = 0;
vec_for_screen (pos1, camera);
pos2.x = mouse_pos.x;
pos2.y = mouse_pos.y;
pos2.z = 20000; // use a big value here
vec_for_screen (pos2, camera);
trace (pos1, pos2); // now "target" holds the coordinates of the hit point
destination = ent_create (destination_mdl, target, show_target);
}
function show_target()
{
// my.z += 10; // remove the comment and play with 10 if you are using other target models
my.passable = on;
while (mouse_left == 1) {wait (1);} // wait until the player releases the mouse button
while (mouse_left == 0) {wait (1);} // wait until the player presses the left mouse button again
ent_remove (me); // remove the old target
}
on_mouse_left = set_target;
function main()
{
level_load (rpg1_wmb);
wait (3);
while (player == null) {wait (1);}
mouse_map = pointer_pcx;
mouse_mode = 2;
camera.arc = 80; // play with this value
camera.x = player.x;
camera.y = player.y;
camera.z = 200;
camera.pan = 90; // initial pan angle
camera.tilt = -60;
while (1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
if ((mouse_pos.x < 2) && (camera.x > -2500)) {camera.x -= 10 * time;}
if ((mouse_pos.x > screen_size.x - 2) && (camera.x < 2500)) {camera.x += 10 * time;}
if ((mouse_pos.y > screen_size.y - 2) && (camera.y < 2500)) {camera.y -= 10 * time;}
if ((mouse_pos.y < 2) && (camera.y > -2500)) {camera.y += 10 * time;}
wait (1);
}
}