Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,789 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how to remove char text wen u walk away from them? #68586
03/30/06 08:59
03/30/06 08:59
Joined: Mar 2006
Posts: 43
J
jamesk85 Offline OP
Newbie
jamesk85  Offline OP
Newbie
J

Joined: Mar 2006
Posts: 43
Hey,
if anyone could help id really appreciate it. Iv got the code below so that wen the avatar get near the char model Max2_MDL_001 the text "this text appears when u get near the char" appears on the screen. However when you move away from the character the text stays on the screen. I need the text to disappear once you move > 175 away from the char.
this is the code:
The code is like this:
text info1
{
pos_x = 4;
pos_y = 10;
layer = 15;
string = "";
flags = visible;
}

entity* Max2_MDL_001;

action displayinfo1
{
Max2_MDL_001 = me;
var i=1;

while(i)
{
if(vec_dist(me.x, plBiped01_entity.x) > 150)
{
wait(1);
}
else
{
info1.string = "this text appears when u get near the char";
i=0;
}
}
}

Re: how to remove char text wen u walk away from t [Re: jamesk85] #68587
03/30/06 09:22
03/30/06 09:22
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
text info1
{
pos_x = 4;
pos_y = 10;
layer = 15;
string = "";
flags = visible;
}

entity* Max2_MDL_001;

action displayinfo1
{
Max2_MDL_001 = me;
var i=1;

while(i)
{
if(vec_dist(me.x, plBiped01_entity.x) > 150)
{
info1.string = " ";
wait(1);
}
else
{
info1.string = "this text appears when u get near the char";
i=0;
}
}
}

try this.


EDIT:
though it wont work
you said trhe while function only works as long as i is 1. but when you write the text, the while will be closed, so you can't copy back the text ot nothing.

just do
while(1)
{
your code
}

instead of
while(i)
{
your code
}

and dont use i then .
like this:
Code:

action displayinfo1
{
Max2_MDL_001 = me;

while(1)
{
if(vec_dist(me.x, plBiped01_entity.x) > 150)
{
info1.string = " ";
}
else
{
info1.string = "this text appears when u get near the char";
}
}
}



Last edited by DS_Kihaku; 03/30/06 09:25.

My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: how to remove char text wen u walk away from t [Re: Captain_Kiyaku] #68588
03/30/06 10:04
03/30/06 10:04
Joined: Mar 2006
Posts: 43
J
jamesk85 Offline OP
Newbie
jamesk85  Offline OP
Newbie
J

Joined: Mar 2006
Posts: 43
Hey. Thanks for the reply.
I tried the code above and it comes up with the error "possible endless loop in displayinfo1"!!

Re: how to remove char text wen u walk away from t [Re: jamesk85] #68589
03/30/06 10:45
03/30/06 10:45
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
oh of course, sorry

Code:

action displayinfo1
{
Max2_MDL_001 = me;

while(1)
{
if(vec_dist(me.x, plBiped01_entity.x) > 150)
{
info1.string = " ";
}
else
{
info1.string = "this text appears when u get near the char";
}
wait(1); // i forgot that
}
}




My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig

Moderated by  HeelX, rvL_eXile 

Gamestudio download | 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