Iprintln a value

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Iprintln a value

Post by Desert Eagle »

iprintln local.nAllied

iprintln local.nAxis

I would like to know how to get a number value to print out
on screen so I can do some debugging of my script of come in fighting. Having some problems and would like to fix

As always any help would be appericated
Desert-Eagle
....The Eagle Has Landed...
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Uhm, this should work. What exactly is the problem?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

iprintln

Post by tltrude »

iprintln "The current allied number is: " (level.nAllied)

iprintln "The current axis number is: " (level.nAxis)

Better to use "level", I think.

level.nAllied ++
level.nAxis ++
Tom Trude,

Image
Desert Eagle
Captain
Posts: 237
Joined: Mon Jan 13, 2003 1:05 am
Location: Mapping Bunker
Contact:

Post by Desert Eagle »

Thanks thats working
Desert-Eagle
....The Eagle Has Landed...
perv
Private
Posts: 5
Joined: Thu Sep 25, 2003 7:08 am
Location: Kent, UK
Contact:

Post by perv »

I tried this:

Code: Select all

//-----------------In Game Message----------------------------

teamnumber:

wait 60	20
iprintln "The current allied number is: " (level.nAllied) 
iprintln "The current axis number is: " (level.nAxis)
wait 100	20
iprintln "The current allied number is: " (level.nAllied) 
iprintln "The current axis number is: " (level.nAxis)
wait 100	20
iprintln "The current allied number is: " (level.nAllied) 
iprintln "The current axis number is: " (level.nAxis)
wait 100	20
iprintln "The current allied number is: " (level.nAllied) 
iprintln "The current axis number is: " (level.nAxis)
wait 100	20
iprintln "The current allied number is: " (level.nAllied) 
iprintln "The current axis number is: " (level.nAxis)
wait 100	20
iprintln "The current allied number is: " (level.nAllied) 
iprintln "The current axis number is: " (level.nAxis)
wait 100	20
iprintln "The current allied number is: " (level.nAllied) 
iprintln "The current axis number is: " (level.nAxis)
wait 100.0
goto teamnumber
end
The massage appeared, but all I got was NIL after the message???

Any ideas?
You can discover what your enemy fears most by observing the means he uses to frighten you.

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well obviously the value of level.nAllied is NIL (which is the default value for any variable that's not set).
Image
perv
Private
Posts: 5
Joined: Thu Sep 25, 2003 7:08 am
Location: Kent, UK
Contact:

Post by perv »

ok, thanks, but how do I set it? I thought the text after the colon was setting the value to be output via the in game message...

A little more specific advise would help me lots! :o

Thanks
:wink:
You can discover what your enemy fears most by observing the means he uses to frighten you.

Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

not sure if there is any easy syntax you can use, but...

main:
thread team_count
end

team_count:
while ($player.size > 0)
{level.nallied = 0
level.naxis = 0
for (local.i=1;local.i<=$player.size;local.i++)
{if ($player[local.i].dmteam == "allies")
{level.nallied++}
if ($player[local.i].dmteam == "axis")
{level.naxis++}}
iprintln "The current allies number is " level.allies
iprintln "The current axis number is " level.saxis
wait 10
end}
hope this helps, prob not cos it's all foreign 2 me :-/
Post Reply