Lauriel Posted May 8, 2020 Share Posted May 8, 2020 10 hours ago, jastey said: -added DESIGNATED and LABEL taggs. What's a LABEL tag and why/when would I need to use one? Quote Link to comment
jastey Posted May 8, 2020 Share Posted May 8, 2020 To be honest, I only know what the weidu readme says: Quote Defines the LABEL, or unique textual identifier, of this module. Any component can have zero or more LABELs. Will print a warning if two components in the same tp2 share a LABEL. Do not alter a component’s LABEL once you publish that mod. So, it's kind of a check name other mods (or the same mod?) can use to detect installed components of other mods. How to actually use it I'd be interested as well. Quote Link to comment
Gwendolyne Posted May 8, 2020 Share Posted May 8, 2020 Example of detecting component install with LABEL: ACTION_IF (MOD_IS_INSTALLED "grammarsalad_mod.tp2" (ID_OF_LABEL "grammarsalad_mod/grammarsalad_mod" "test1")) BEGIN PRINT "grammarsalad_mod installed: component test1" END ELSE BEGIN PRINT "grammarsalad_mod not installed: component test1" END Quote Link to comment
Lauriel Posted May 8, 2020 Author Share Posted May 8, 2020 (edited) 5 minutes ago, Gwendolyne said: Example of detecting component install with LABEL: ACTION_IF (MOD_IS_INSTALLED "grammarsalad_mod.tp2" (ID_OF_LABEL "grammarsalad_mod/grammarsalad_mod" "test1")) BEGIN PRINT "grammarsalad_mod installed: component test1" END ELSE BEGIN PRINT "grammarsalad_mod not installed: component test1" END What's the benefit of that vs just MOD_IS_INSTALLED <designated number> Or is it one way vs the other way and neither is especially better than the other? EDIT: Never mind, I can see the benefit of a label over a number since component order can change. EDIT 2: Ok fine. Adding labels to my tp2 file now. Thank you @Gwendolyne! Edited May 8, 2020 by Lauriel Quote Link to comment
jastey Posted May 8, 2020 Share Posted May 8, 2020 How would one assign more than one LABEL to the same component? For examle, so that several components from a SUBCOMPONENT structure could be detected in one go as well as everyone separately? Quote Link to comment
Lauriel Posted May 8, 2020 Author Share Posted May 8, 2020 (edited) It might work since it sounds like it would generate a warning...but not an error. I have several subcomponents. I can give it a test run. EDIT: Who am I kidding. I don't have time for this....but I will eventually test it...someday. Edited May 8, 2020 by Lauriel Quote Link to comment
subtledoctor Posted May 8, 2020 Share Posted May 8, 2020 I’m pretty sure a component can have a functionally unlimited number of LABELs. Might be misremembering though. Quote Link to comment
Lauriel Posted May 8, 2020 Author Share Posted May 8, 2020 20 minutes ago, subtledoctor said: I’m pretty sure a component can have a functionally unlimited number of LABELs. Might be misremembering though. Yeah, but the docs say you can't have multiple components share the same label. That's what we're wondering about. Quote Link to comment
subtledoctor Posted May 9, 2020 Share Posted May 9, 2020 Oh. I guess not. If you did, the code above (ID_OF_LABEL) would fail. Quote Link to comment
Lauriel Posted May 9, 2020 Author Share Posted May 9, 2020 42 minutes ago, subtledoctor said: Oh. I guess not. If you did, the code above (ID_OF_LABEL) would fail. Have you tested that? Quote Link to comment
subtledoctor Posted May 9, 2020 Share Posted May 9, 2020 No, but... how would it work if more than one component had the same label? Which value would it return? It might hang together and run without errors, but it would not function correctly. Quote Link to comment
Lauriel Posted May 9, 2020 Author Share Posted May 9, 2020 I don't know. I'm going to test it though. Quote Link to comment
Lauriel Posted May 9, 2020 Author Share Posted May 9, 2020 Ok, I tested this. Labeling multiple options of the same subcomponent with the same label will make it so that any checks using that label will return false, unfortunately. That would have been handy in case of subcomponents. Oh well. Quote Link to comment
jastey Posted May 9, 2020 Share Posted May 9, 2020 Argh, of course giving several subcomponents the same LABEL would't work and give an error because it's, well, the same label for several components. That kind of explains the error it produces... Ok, nothing to see here, folks. Please, move on... Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.