Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Looking Touch Text action #189708
03/20/08 21:27
03/20/08 21:27
Joined: Jun 2006
Posts: 35
Texas
D
DancesWithLight Offline OP
Newbie
DancesWithLight  Offline OP
Newbie
D

Joined: Jun 2006
Posts: 35
Texas
I need a simple touch text action that will work with my A6 using the old templates. So I can attach it to doors in a hall, and when you click on them a message pops up to tell you something, like "This is the Boss's office"
THe touch text routine is short, I rememebr, so I can write a differnt action for each door, to describe different rooms.

Thanks


Waiting for fully immersible Virtual reality.
Re: Looking Touch Text action [Re: DancesWithLight] #189709
03/20/08 21:43
03/20/08 21:43
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
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


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1