Emblem/level managment?

Status
Not open for further replies.

Tamkis

Lua Grasshopper
A few quick advanced LUA questions for editing:


  • Emblem stuff
    • How could one retrieve the current amount of emblems earned for a co-op game? Looking at the wiki, I can't seem to find the variable name (if it even exists for Lua access)
    • How could one detect if a particular, collectible emblem Map Thing has already been collected for co-op? (I.e, when the emblem Map Thing is greyed out?)
    • How could one award an emblem on a custom condition in co-op? (For example, collecting 5 custom objects in a level and finishing the level to earn an emblem?)
  • Level management
    • How could one change the next level for play based on a condition (like how the ancient Mystic Temple mod did so?)
Thanks in advance!
 
How could one retrieve the current amount of emblems earned for a co-op game? Looking at the wiki, I can't seem to find the variable name (if it even exists for Lua access)
I don't think that is possible, especially not in Co-op (player 1 may have a different emblem count than player 2 in a net-game).

How could one detect if a particular, collectible emblem Map Thing has already been collected for co-op? (I.e, when the emblem Map Thing is greyed out?)
Well, you could try making something like "if we're in this map and my X, Y and Z co-ordinates are equal to this, this and this, and I am collected, set a global variable to something, otherwise don't, and then make another hook do stuff about that global variable" for the object type for emblems (using a MobjThinker hook, of course), but emblems don't show up in Co-op in the first place, so... Would only work for singleplayer, and wouldn't work properly.

How could one award an emblem on a custom condition in co-op? (For example, collecting 5 custom objects in a level and finishing the level to earn an emblem?)
I am unable to answer your question, but if we took "how" out of it, I'd say "no, you can not award an emblem on a custom condition in Co-op, because it's not singleplayer, and even then I don't think you'd be able to award it through Lua". I'm not an emblem expert, though, so don't take my word for it.

How could one change the next level for play based on a condition (like how the ancient Mystic Temple mod did so?)
I think you mean the Mystic Realm mod, not the ancient Mystic Temple mod. Either way, by having something trigger Linedef Type 2.

Edit: Oh, look in the "something" link. Types 317-320 might be related to checking and setting unlockables (but have no effect in netgames), and 441 seems to allow something with emblems as well. Not sure if it's of use to you, though.
 
Last edited:
(Should have checked my post before posting; replace all occurrences of "co-op" with single player :p)

The closest I have found for determining the amount of emblems is to create a condition set for an unlockable and use

  • "TotalEmblems [number of emblems]: Requires the specified number of emblems collected. This counts both map-specific and global emblems."
    and
  • Trigger [trigger number]: This is used to trigger a condition dynamically in a map with a linedef executor. The trigger number can range from 0 to 31. When a linedef executor with linedef type 441 and the same trigger number is executed, this condition will be met and the unlockable status will be checked immediately to see if anything was unlocked. These triggers carry over from map to map, and linedef type 317 and linedef type 318 can be used to check for them dynamically. Note that this does not work in netgames, or if gamedata is no longer being saved due to the use of a protected console command (such as GOD or DEVMODE).
to do something based on the amount of emblems earned.

(Basically what I would be trying to do is to create a HUB level similar,to say, Diddy Kong Racing, where you can enter other levels from a door, but have to have x amount of emblems for each door in order to unlock the door and enter the level.)
 
Let me see....

Retrieve emblem number
-You can do it with ConditionSets (as you've quote in your previous post) but I don't think it will work in co-op as all players have different ammounts of emblems blah blah.
EDIT: If you want it to work with co-op, you should create another type of objects that have their number not resteted upon changing map, the rest about the linedef related to it could be done in Lua, but I suck balls at this so I can't help you at all about this =V

Check if x emblem was obtained
-To detect if a particular emblem was obtained, use this:

Code:
Emblem [emblem number]
EDIT: You can also use ExtraEmbelm [number] in case it's not an emblem you can find in maps.
The number should be the one that you've set up in the MAINCFG, but I think you know that.

Get an emblem for collecting specific items
-I don't know, sorry. However, you could try to make each of those objects to trigger linedefs (A_LinedefExecute in their deathstates) executors that will do something to spawn the emblem etc.

Change next level
-Zappy said everything.
 
Last edited:
Status
Not open for further replies.

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

Back
Top