Page 1 of 1
Iprintln a value
Posted: Sun May 25, 2003 9:49 pm
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
Posted: Mon May 26, 2003 9:04 am
by jv_map
Uhm, this should work. What exactly is the problem?
iprintln
Posted: Tue May 27, 2003 12:07 am
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 ++
Posted: Thu May 29, 2003 1:24 am
by Desert Eagle
Thanks thats working
Posted: Sun Oct 05, 2003 6:30 pm
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?
Posted: Sun Oct 05, 2003 7:00 pm
by jv_map
Well obviously the value of level.nAllied is NIL (which is the default value for any variable that's not set).
Posted: Sun Oct 05, 2003 10:27 pm
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!
Thanks

Posted: Sun Oct 05, 2003 11:47 pm
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}