I can't seem to get anything to work right. I try to look at the manual, and improvise from there to fit my needs, but no cigar.
I just want to make it so that you can touch the entity with the mouse and light it up, but apparently it's
way more complicated than I thought.
Here's my
Code:
var video_mode= 8;
var video_screen= 1;
var video_depth= 32;
bmap cur= "bcursor.pcx";
function mouse_toggle()
{
mouse_mode+= 1;
mouse_mode%= 3;
mouse_map= cur;
while(1)
{
mouse_pos.x= pointer.x;
mouse_pos.y= pointer.y;
wait(1);
}
}
function main()
{
level_load ("vec_test.wmb");
on_m= mouse_toggle;
while(1)
{
vec_for_screen(vector(mouse_pos.x,mouse_pos.y,-1000),camera);
wait(1);
}
}
action dummy_cam
{
my.fat= on;
my.narrow= on;
c_setminmax(me);
while(1)
{
camera.x= my.x;
camera.y= my.y;
camera.z= my.z;
my.pan= camera.pan;
my.tilt= camera.tilt;
my.roll= camera.roll;
if (mouse_left== on) && (mouse_mode<= 1)
{
c_move (my,vector(20 * time_step,0,0),nullvector,glide);
}
if(mouse_right== on) && (mouse_mode<= 1)
{
c_move (my,vector(-20 * time_step,0,0),nullvector,glide);
}
if(mouse_left== on) && (key_shift== on) && (mouse_mode<= 1)
{
c_move (my,vector(30 * time_step,0,0),nullvector,glide);
}
if(key_z== on) && (mouse_mode<= 1)
{
c_move (my,vector(0,10 * time_step,0),nullvector,glide);
}
if(key_x== on) && (mouse_mode<= 1)
{
c_move (my,vector(0,-10 * time_step,0),nullvector,glide);
}
camera.pan-= mouse_force.x * 10 * time_step;
camera.tilt+= mouse_force.y * 10 * time_step;
wait(1);
}
}
function light_event()
{
if(event_type== event_touch)
{
my.ambient= 200;
}
}
action light_when_touched
{
my.enable_touch= on;
my.event= light_event;
my.polygon= on;
while(1)
{
vec_to_screen(vector(my.x,my.y,my.z),camera);
wait(1);
}
}
EDIT: Sorry for the "tone", I'm just a little frustrated.