View Single Post
Old 03-21-2015   #1
Zwip-Zwap Zapony
Zwip-Zwap Zapony's Avatar
Default Retrieving Level Header Lua?

I would like to use some Lua for something in some levels I plan on making, but not others. Obviously, I'd insert "Lua.SecretStuff = 1" in the Level Header of those, and then check if mapheaderinfo[gamemap].secretstuff is equal to 1. But that's where the problem is...

If I make a Lua hook doing nothing but "print(mapheaderinfo[gamemap].secretstuff", the console is spammed with 1 when in the level, and I assume the hook would be removed if I tried to play a level without Lua.SecretStuff set. But if I check "if mapheaderinfo[gamemap].secretstuff==1"... nothing ever happens, even if the following is just "print("It works!")". The console doesn't say it removed the hook, so I don't think it thinks I did anything wrong...

Can someone please give me a working example (both the Lua and Level Header) of an if check for Level Header Lua stuff? I have tried searching the message boards before posting this, but I didn't really find anything.
Zwip-Zwap Zapony is online now   Reply With Quote