Home   Help Search Login Register  

Author Topic: displaying variable contents in hint  (Read 955 times)

0 Members and 3 Guests are viewing this topic.

gadolinite

  • Guest
displaying variable contents in hint
« on: 20 Jun 2003, 05:16:58 »
how do you display the contents of a variable on the screen in hint text?

_Ross_

  • Guest
Re:displaying variable contents in hint
« Reply #1 on: 20 Jun 2003, 05:24:43 »
Hi Ben ;D

If the variable has a small number of possible values, you could have it display a different hint  for each one
example:

?(a == 3):hint "blah blah is 3"
?(a == 2):hint "blah blah is 2"
?(a == 1):hint "blah blah is 1"

hope that helps
« Last Edit: 20 Jun 2003, 05:26:33 by _Ross_ »

_hammy_

  • Guest
Re:displaying variable contents in hint
« Reply #2 on: 20 Jun 2003, 05:33:22 »
i cant remember exactly what it is, it something like this tho:

Code: [Select]
titletext [FORMAT["Variable 1 is %1",_var1],"plaindown"]

or something like that,  i know u can put it in a hint box, but im not sure how.

I have never debuged anything in my life, its kinda strange, really
 ::)

deaddog

  • Guest
Re:displaying variable contents in hint
« Reply #3 on: 20 Jun 2003, 06:22:41 »
Use the FORMAT function like HAMMY says.  It is very powerful.

_a=4
_b=12

hint format ["I have %1 fingers and %2 toes!!",_a,_b]

will produce "I have 4 fingers and 12 toes!!"

Use %1 for the first variable, %2 for the second and so on..

borrowed soap

  • Guest
Re:displaying variable contents in hint
« Reply #4 on: 20 Jun 2003, 12:38:54 »
what if im trying this:
_randomnumber = _this select 0
_randomnumber = random 6
hint format ["random number is 1%",_randomnumber]

it keeps showing me "random number is 1", but it never generates (or at least reports) any random numbers
« Last Edit: 20 Jun 2003, 12:49:47 by borrowed soap »

deaddog

  • Guest
Re:displaying variable contents in hint
« Reply #5 on: 20 Jun 2003, 14:19:59 »
Quote
1%

Reverse these to make %1.


 :)

borrowed soap

  • Guest
Re:displaying variable contents in hint
« Reply #6 on: 20 Jun 2003, 17:35:57 »
sorry, i wrote that wrong in the post. i have been using  %1.  its seems to be the _randnum = random 6 not working, because i use the %1 in the hint format all the time for generating  x,y,z coordinates (via a trigger and whatnot), and the syntax:
hint format ["%1",_whatever] has been working for me in the past. im not sure what is happening here
« Last Edit: 20 Jun 2003, 17:37:22 by borrowed soap »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:displaying variable contents in hint
« Reply #7 on: 20 Jun 2003, 18:16:51 »
Quote
what if im trying this:
_randomnumber = _this select 0
_randomnumber = random 6
hint format ["random number is 1%",_randomnumber]

One question: why do you: _randomnumber = _this select 0

What is _this select 0?

If you say: _randomnumber = random 6, then you assign
any value between 0.000000 to 4.999999 to _randomnumber.

So why do you predefine it with _this select 0
Try leaving this line out.

As i don't know, what you have passed during your
exec statement to the script i can only asume that the error
goes there.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:displaying variable contents in hint
« Reply #8 on: 20 Jun 2003, 18:28:46 »
Quote
any value between 0.000000 to 4.999999 to _randomnumber.

nah ;D

any value between 0.000000 to 5.999999 to _randomnumber.

LCD OUT
« Last Edit: 20 Jun 2003, 18:28:59 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

borrowed soap

  • Guest
Re:displaying variable contents in hint
« Reply #9 on: 20 Jun 2003, 18:49:49 »
ya, the line is unnecessary ive noticed, but it was a typing error i found that was getting me   (doh!)
my fault, it is fixed, thx for help (i cant close post tho, it wasnt mine originally)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:displaying variable contents in hint
« Reply #10 on: 20 Jun 2003, 18:51:33 »
Quote
any value between 0.000000 to 4.999999 to _randomnumber.

nah

any value between 0.000000 to 5.999999 to _randomnumber.

LCD OUT

 :-[ DOH - we're talking about 6 not 5  :o

cheers 4 da correction - bin alrdy in da next thread wif ma head
 ;D

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:displaying variable contents in hint
« Reply #11 on: 20 Jun 2003, 18:55:40 »
rofl ;D

its kool u helpin ppl ;D

no need 2 tank me (but im only sain dat cuz u did tank me ::) ;))

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

gadolinite

  • Guest
Re:displaying variable contents in hint
« Reply #12 on: 20 Jun 2003, 20:31:16 »
just like C++ formating, makes perfect sense

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:displaying variable contents in hint
« Reply #13 on: 20 Jun 2003, 21:55:06 »
solve da topic :D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta