perhaps this will help you:
Code:
define _id, skill1;
define _info_range, 96; //mouse_range??? / range/distance object-info appears
define _info_offset_x, 8; //offset x/y from mouse_spot
define _info_offset_y, 8;
font info_font = <ackfont.pcx>,6,8; //max height 26
//here you can define the info strings:
string id_txt_1 = "small bottle";
string id_txt_2 = "medium bottle";
string id_txt_3 = "big bottle";
//...
string id_txt_0 = " "; //necessary else engine-failure
//----------------------------------------------------------------------------------------------------------------------------------
text info_txt
{
font = info_font;
layer = 2;
}
//----------------------------------------------------------------------------------------------------------------------------------
string info_txt_temp; //temporary string-store
string info_txt_num;
starter mouse_info
{
var id;
var _vec_from[3];
var _vec_to[3];
while(1)
{
if(mouse_mode) //mouse active???
{
info_txt.pos_x = info_pan.pos_x + 2;
info_txt.pos_y = info_pan.pos_y + 2;
_vec_from.x = mouse_pos.x;
_vec_from.y = mouse_pos.y;
}
_vec_from.z = 0;
vec_set(_vec_to.x,_vec_from.x);
_vec_to.z = _info_range;
vec_for_screen(_vec_from.x,camera);
vec_for_screen(_vec_to.x,camera);
me = player;
trace_mode = ignore_me + ignore_passable;
trace(_vec_from.x,_vec_to.x);
if(you){ if(you._id){id = your._id;}else{id = 0;} }else{id = 0;} //object touched??? -> get id
if(id && mouse_mode)
{
str_cpy(info_txt_temp,"info_txt.string = id_txt_");
str_for_num(info_txt_num,id);
str_cat(info_txt_temp,info_txt_num);
execute(info_txt_temp); //show id-text
info_txt.visible = on;
}else{
info_txt.visible = off;
}
wait(1);
}
}
Code:
just give a number to skill1 in WED and id_txt_"number" will be viewed