AFADoomer wrote:I think you want to reference 'level' (declared
here) instead of declaring 'LevelLocals p'.
What you are doing, instead of using the actual level info, is declaring a new object 'p' that is of struct type LevelLocals. When you check 'if (p)', it's declared and is present, despite every value being uninitialized, so that logic succeeds, but since p.total_monsters has no value, you are most likely logging an empty line.
Just referencing 'level.total_monsters' as a variable should work... Something like this should print the value:
Code: Select all
Virtual void MyMapStatsManager ()
{
console.printf("%d", level.total_monsters);
}
It worked, thanks!
P.S. Thus, I simply had to access "levels" direcly without resorting to "let", aliases, auto or anything else shown either on Wiki or Gzdoom internal files (I even tried with "levels p", but it gave me obiously an error). Seriously, it's like finding the secret door in Milon's Secret Castle...how was I supposed to know that?!?!
Mini rant aside, thank you for the info: whenever I use that code for a mod, I'll comment it so that other users won't get stuck as much as I did.
@ Jekyll Grim Payne: As I'm currently in process to convert my mod to ZScript, I'm pretty much on the same boat. It's really, really hard to understand, but not impossible and gives several dividends. Start by studying other ZScript based mods, such as D4D, and/or
converting your DECORATE files as/is for an headstart. Then, read some C+ programming tutorials as it's very similar to ZScript. After that, if you still get halted, ask here for some answers.