Home   Help Search Login Register  

Author Topic: Displaying variables in strings  (Read 1240 times)

0 Members and 1 Guest are viewing this topic.

MONOLITH

  • Guest
Displaying variables in strings
« on: 08 Oct 2003, 19:17:42 »
Just a quick question.

Does anyone know how to display a variable in a string e.g hint box. For example i want to display the score of a side in a hint box.

I know in visual basic you do it like this msgbox "blah" & variable name

Anyone know how to do it in flashpoint?

Thanks.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Displaying variables in strings
« Reply #1 on: 08 Oct 2003, 19:23:21 »
hint format ["%1", variable]

Something like that.

:beat: *Gets Shot* :beat:

Offline KTottE

  • Former Staff
  • ****
Re:Displaying variables in strings
« Reply #2 on: 08 Oct 2003, 19:41:49 »
Yes.

hint format["Health: %1",getDammage player]

For instance.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Displaying variables in strings
« Reply #3 on: 08 Oct 2003, 21:22:39 »
@ KTotte nd armsy - next taam leave dis Qs 2 me- itll help me boost ma post count :P i lead only in 2 above macca  :-X  :o ::)

@ Mono

or in titletext u can use

titeltext [format["Health: %1",getDammage player],"plain down"] ;D

LCD OUT
« Last Edit: 08 Oct 2003, 21:24:49 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Displaying variables in strings
« Reply #4 on: 08 Oct 2003, 21:59:11 »
k - gonna have to top that then  ;D

hint format ["%1\n2", var1,var2]

would even let you display 2 variables

%1 is the placeholder for the first variable after the output-string, %2 for the second one.

You can also go on, using such placeholders - e.g: %1 %2 %3
and so on.

hint format ["%1 %2 %1", var1, var2]

would also be possible and result in:

var1 var2 var1

~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 variables in strings
« Reply #5 on: 08 Oct 2003, 22:04:49 »
k - gonna have to top that then  ;D

hint format ["%1\n2", var1,var2]

lol ;D

just 1 thing

u forgot 2 put da % dere :P ::)

it shud b

hint format ["%1\n%2", var1,var2]

LCD OUT

P.S deres no way ny of u wil pass ma post count its 2400 n somin now :P
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Displaying variables in strings
« Reply #6 on: 08 Oct 2003, 22:52:43 »
 :o indeeeeeeeeed  :-[

just thought i should keep you an open backdoor
to be able, top'in dat  ;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 dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Displaying variables in strings
« Reply #7 on: 09 Oct 2003, 07:57:24 »
I'm going to top that, but I need to lay low for a while... KTottE almost gave me a warning. :'(

:beat: *Gets Warned* :beat: