counter print question
Moderator: Moderators
-
7th Es Cyborg
- First Lieutenant
- Posts: 189
- Joined: Fri Dec 13, 2002 5:00 pm
- Location: PA
- Contact:
counter print question
ok I'm using a local.counter and need to print out the value ingame
how would that script be done with iprintlnbold "You died ( counter here ) times."
this is not the actual useage, but you can see what i need.
how would that script be done with iprintlnbold "You died ( counter here ) times."
this is not the actual useage, but you can see what i need.
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
quotes in " and then what ever you like, repeat as necessary
e.g.
iprintlnbold_noloc "This counter is on " level.counter " so hurry your ass up " level.something_else
or
if ( level.die_counter == 1 )
{iprintlnbold_noloc "You died for the 1st time"}
if ( level.die_counter == 2 )
{iprintlnbold_noloc "You died for the 2nd time keep trying though"}
if ( level.die_counter == 3 )
{iprintlnbold_noloc "3rd time now, do you think your a target ???"}
if ( level.die_counter >> 3 )
{iprintlnbold_noloc "For the " level.die_counter "th time, will you STOP DYING!!!"}
for counters use level. rather than local.
e.g.
iprintlnbold_noloc "This counter is on " level.counter " so hurry your ass up " level.something_else
or
if ( level.die_counter == 1 )
{iprintlnbold_noloc "You died for the 1st time"}
if ( level.die_counter == 2 )
{iprintlnbold_noloc "You died for the 2nd time keep trying though"}
if ( level.die_counter == 3 )
{iprintlnbold_noloc "3rd time now, do you think your a target ???"}
if ( level.die_counter >> 3 )
{iprintlnbold_noloc "For the " level.die_counter "th time, will you STOP DYING!!!"}
for counters use level. rather than local.
hope this helps, prob not cos it's all foreign 2 me :-/
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Or just:
Code: Select all
iprintlnbold "You died " + local.counter + " times."-
7th Es Cyborg
- First Lieutenant
- Posts: 189
- Joined: Fri Dec 13, 2002 5:00 pm
- Location: PA
- Contact:
script
Some people over script a simple line too.
If you don't want all that clicking with "iprintlnbold_noloc", you can use just "iprintln". That makes it show up on the leftside of the screen in yellow and with no clicking sound.
If you don't want all that clicking with "iprintlnbold_noloc", you can use just "iprintln". That makes it show up on the leftside of the screen in yellow and with no clicking sound.
Sorry but that won't workBjarne BZR wrote:Or just:
iprintlnbold "You died " + local.counter + " times."
Try this:
iprintlnbold ("You died " + local.counter + " times.")
The other one is not allowed since the syntaxis of the iprintln command is the following:
iprintlnbold [string1] [string2] [string3].....
Thus you can type
iprintlnbold "hello " "world"
but not
iprintlnbold "hello " + "world"
If you put it between parens however, it's automatically casted to a string and supplied as the first argument only, instead of multiple.
iprintlnbold ("hello " + "world")
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Actually I like nuggets version better, except this is a classical time to use the switch statement:
Jv? 
Code: Select all
switch (level.die_counter)
{
case 1: {
iprintlnbold_noloc "You died for the 1st time"
break
}
case 2: {
iprintlnbold_noloc "You died for the 2nd time keep trying though"
break
}
case 3: {
iprintlnbold_noloc "3rd time now, do you think your a target ???"
break
}
default: {
iprintlnbold_noloc "For the " level.die_counter "th time, will you STOP DYING!!!"
}
}-
7th Es Cyborg
- First Lieutenant
- Posts: 189
- Joined: Fri Dec 13, 2002 5:00 pm
- Location: PA
- Contact:
thanks JV that fixed it up, what I'm doing in converting the mohaa maps into CTF maps using a script that tstrait72 and scorpio made with some modifications. Since the original is first capture wins the round, I changed it to you need 3 captures to win and when one team gets a cap. it shows the current score to the left.


