Retrieving map header variables?

Status
Not open for further replies.
Personally, I have not the slightest clue how to use the mapheader_t thing. Specifically, I'd like to check for if the level header's typeoflevel includes TOL_MARIO.
I know I'd check if typeoflevel&TOL_MARIO, but again, I dunno how to use mapheader_t, which is what contains typeoflevel (as far as I'm aware).
 
The maps all have their own tables globally. mapheaderinfo[mapnum] is how you access the info for the specific map number you've put in. In your case, mapheaderinfo[mapnum].typeoflevel & TOL_MARIO. It's also a good idea to make sure the map your checking has a header before you check the type of level.

For more info on use, see what Terminal does here.
 
Last edited:
The maps all have their own tables globally. mapheaderinfo[mapnum] is how you access the info for the specific map number you've put in. In your case, mapheaderinfo [mapnum].typeoflevel & TOL_MARIO. It's also a good idea to make sure the map your checking has a header before you check the type of level.
Well, I'd like to check it for the current map, not a specific map. And I'm not that smart at Lua when it comes to outside the MobjThinker hook for MT_PLAYER, plus the MapLoad thing also does check for a specific map. I am especially confused by "for", the only exception being "for player in players.iterate".

For more info on use, see what Terminal does here.
...Yeah, I'm not that smart at anything other than player-editing in Lua. I don't understand that stuff at all. I even thought it was C++ or something at first, as I didn't remember Terminal being that netplay enhancing Lua plug-in, and there are a lot of "then"s, which Blua renders optional. But thanks for telling me how to access map headers in the first place.


If you really want to see what I want to use it for...
Code:
addHook("MobjThinker", function()
for luigi in players.iterate
if luigi.mo
if luigi.mo.skin=="luigi"
    if luigi.powers[pw_super]==0
        luigi.mo.color=luigi.skincolor
    end
    if luigi.powers[pw_shield]&SH_FIREFLOWER
//  and mario mode
//      R_SetPlayerSkin(luigi, "fireluigi")
        luigi.mo.skin="fireluigi"
    end
end
if luigi.mo.skin=="fireluigi"
    if luigi.powers[pw_super]==0
        luigi.mo.color=luigi.skincolor
    end
    if!luigi.powers[pw_shield]&SH_FIREFLOWER
//  and mario mode
//      R_SetPlayerSkin(luigi, "luigi")
        luigi.mo.skin="luigi"
    end
end
end
end
end
, MT_PLAYER)
 
...Well, what you're doing doesn't need mapheaderinfo in the first place. Just check for maptol & TOL_MARIO.
 
...I just checked the Wiki, and... wow. It's not in "Functions" nor "Constants" or anything. It's listed in "Basics". And right below it, it shows "mariomode". I'm going to simply check for "mariomode", then. Thanks for the help. (When I'm in doubt, I check the other lists, but not the basics page.) I really thought the only way to check the level types were with mapheaderinfo... Silly me.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top