Igor Q. 519 Posted October 1, 2019 Hi It would be really great and make life easier if 1) We can assign and lock the active items onto a player (Or give them a 1-slot item bar) 2) If using the "get active item of player" and the player does not have an active item to return None (Entity) instead of giving us an error. 3) Disable players from using "i" to see their inventory when their hud is disabled. Thanks! Share this post Link to post Share on other sites
Houp 237 Posted October 1, 2019 Hi, 1) we also think about that feature 2) it should work as you are mentioning. It returns None(null). What error you are getting and what snippet of code are you using? 3) When you disable inventory for a player you are unable to use i. (same as in our game Playlands) 1 Share this post Link to post Share on other sites
jchob 354 Posted April 13, 2020 (edited) On 10/1/2019 at 10:46 AM, Houp said: Hi, 1) we also think about that feature 2) it should work as you are mentioning. It returns None(null). What error you are getting and what snippet of code are you using? 3) When you disable inventory for a player you are unable to use i. (same as in our game Playlands) @Houp @Adam Snellgrove i'm getting the error still , and we are at 13/04/2020 and this post is from 2019. So, if the player doesn't have any active item, we get an error None… I'm trying to help a new person. So, should I say this is a ylands bug? I tried to use a IF (get active item player (trigger entity) = NONE) console write ("no item in hands") Still getting the same bug, but if I hold another kind of item, the bug doesn't show up (or --> console write "you don't have the required item") Edited April 13, 2020 by jchob Share this post Link to post Share on other sites
Indomitus 388 Posted April 13, 2020 Have you tried checking (IsEntity (Get Active Item)) first, then check if it's the right one? Share this post Link to post Share on other sites
jchob 354 Posted April 13, 2020 (edited) 6 minutes ago, Indomitus said: Have you tried checking (IsEntity (Get Active Item)) first, then check if it's the right one? the code I have works that is --> holding in hands (active item that is the paper). But if the player isn't holding anything (no active item), you get the error. But if i hold other item, the error doesnt show anymore. Try it for yourself Edited April 13, 2020 by jchob Share this post Link to post Share on other sites
jchob 354 Posted April 13, 2020 @Indomitus Can you test it? i've been stupid and tired the last days. But maybe it's my fault again... Share this post Link to post Share on other sites
Indomitus 388 Posted April 13, 2020 Try something like this: I used a "Magic Easter Egg" as the item it checks for, but it could be anything. Share this post Link to post Share on other sites
jchob 354 Posted April 13, 2020 (edited) @Indomitus yeah right, that works. But it doesn't make any sense in my opinion. You shouldn't be forced to check IS ENTITY if you are not just holding anything, the error shouldn't show up. Just a IF to check if you are holding the right item would enough, in my opinion. Because, a trigger zone is triggered by a player character, and the character is NOT a entity (it returns false if you use the IS ENTITY on the player). But you can still use GET NAME entity, GET POSITION Entity, etc etc for the player. That doesn't make any sense. Maybe i've been "out" for long time and maybe i'm too tired to think. I guess i should unninstall this game then. Thanks anyway Edited April 13, 2020 by jchob Share this post Link to post Share on other sites
jchob 354 Posted April 13, 2020 (edited) Another exemple: ON TRIGGER enter If Get name entity = JCHOBS console write ("ok, jchobs spotted), But if another player enters the trigger, i don't get that error. That error only shows up for Entities? (Like I said before, player is not na entity but you can still uset the ENTITY tiles for the player? No sense at all) Do you understand what I mean? P.S. I learnt today that player is not an Entity? oof, really oof Edited April 13, 2020 by jchob Share this post Link to post Share on other sites
Indomitus 388 Posted April 13, 2020 1. This kind of checking is what IS ENTITY exists for. Error handling is a common concern across all programming languages. In Ylands, that means checking your data types and values up front. 2. Of course a player is an entity. If they weren't then tiles like GET NAME, GET POSITION, or GET ROTATION wouldn't work, and Entity Labels or Entity Storage wouldn't work on them. Share this post Link to post Share on other sites
jchob 354 Posted April 13, 2020 (edited) 4 hours ago, Indomitus said: 1. This kind of checking is what IS ENTITY exists for. Error handling is a common concern across all programming languages. In Ylands, that means checking your data types and values up front. 2. Of course a player is an entity. If they weren't then tiles like GET NAME, GET POSITION, or GET ROTATION wouldn't work, and Entity Labels or Entity Storage wouldn't work on them. Oof I got confused. I'm not thinking right these last days. Why did I say it returns false as an Entity? omg, i'm feeling so ashamed right know (maybe I should stop using forum while I drink). So sorry man.. geez Anyway, I never thought that I should use the IS ENTITY for this case, but it really makes sense for error handling. Thanks Edited April 13, 2020 by jchob Share this post Link to post Share on other sites