Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 938 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: invisble on/off [Re: Joey] #209551
06/03/08 22:38
06/03/08 22:38
Joined: Mar 2006
Posts: 32
P
Puri Offline OP
Newbie
Puri  Offline OP
Newbie
P

Joined: Mar 2006
Posts: 32
Credits to all who helped me in this thread. From reading all of your tips, I was able to find the exact thing I wanted.

Here is the actual code.

Function Hide_mesh()
{
while (key_q == on && q_press == 0){player_mesh.invisible = on; q_press = 1;proc_late();wait(1);}

while (key_q == on && q_press== 1){player_mesh.invisible = off; q_press = 0;proc_late();wait(1);}
}

Without proc_late() When pressing q it at lighting speeds goes back and forth between on and off. Which isnt what I want. Adding proc_late contained the problem and made a single press or holding the key = 1 press.

Thanks for the help everyone.

Re: invisble on/off [Re: Puri] #209553
06/03/08 23:02
06/03/08 23:02
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
Code:
function toggle_visibility()
{
  box_mesh.visible = (box_mesh.visible ==off);
  while(key_q){wait(1);}
}

on_q = toggle_visibility;



Andreas
GSTools - Home of
GSTScript 0.9.8: lua scripting for A6/7/8
GSTNet 0.7.9.20: network plugin for A6/7/8
GSTsqlite 1.3.7: sql database plugin for A6/7/8
3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
Re: invisble on/off [Re: nfs42] #209575
06/04/08 07:10
06/04/08 07:10
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
@puri:
The following snippet (the one I also posted above) is c-script, not Lite-C, so you should be able to use it.

Code:
function toggle_visibility()
{
  box_mesh.invisible = !box_mesh.invisible;
}

on_q = toggle_visibility;


You can also use nfs42's snippet which is quite the same, however you don't need that while loop.

Re: invisble on/off [Re: Xarthor] #209632
06/04/08 13:57
06/04/08 13:57
Joined: Sep 2002
Posts: 1,065
Germany, Jena, Thüringen
3D_Train_Driver Offline
Serious User
3D_Train_Driver  Offline
Serious User

Joined: Sep 2002
Posts: 1,065
Germany, Jena, Thüringen
Hi!
What really will work is the following code.
It is C-Script.

Code:
function toggle_invisibility(){
mesh.invisible = (mesh.invisible==0);
}

on_q = toggle_invisibility;



That`s it.

regards

Re: invisble on/off [Re: 3D_Train_Driver] #209653
06/04/08 18:21
06/04/08 18:21
Joined: Mar 2006
Posts: 32
P
Puri Offline OP
Newbie
Puri  Offline OP
Newbie
P

Joined: Mar 2006
Posts: 32
Thanks for the help everyone!

Page 2 of 2 1 2

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