vargatom Posted December 30, 2024 Share Posted December 30, 2024 (edited) Happy Holidays! I would like to query the state of a breakable entity during game but when it is already destroyed it only gives an error message. How should this be queried correctly? smile_trigger = { Name = "smile_trigger", TriggerOnClass = CLASS.ANYPLAYER, OnEnter = function(ent) { if(GetEntTeam(ent) == TEAM.AXIS) { Map.SmileTriggerCount += 1; Util.MapDebugPrint("SmileTriggerCount = ^5" + Map.SmileTriggerCount); ent1 = GetGameEntityFromId(90); if(EntityIsValid(ent1)) { print("Entity 90 is valid"); } else { print("Entity 90 is'n valid"); } } }, OnExit = function(ent) { if(GetEntTeam(ent) == TEAM.AXIS) { Map.SmileTriggerCount -= 1; if(!Map.StairsWay && Map.SmileTriggerCount < 1) { SetAvailableMapGoals(TEAM.AXIS, false, "FLAG_keymad"); } Util.MapDebugPrint("SmileTriggerCount = ^5" + Map.SmileTriggerCount); } }, }, Edited December 30, 2024 by vargatom Quote Link to comment Share on other sites More sharing options...
Moderators palota Posted December 31, 2024 Moderators Share Posted December 31, 2024 Where can we download pk3 file of this map ? You should never use entity numbers because they depend on mods. You should use GetEntityByName instead of GetGameEntityFromId. If the entity does not have any name, then you can use TraceLine. Functions GetEntityByName and GetGameEntityFromId return null if the entity is invalid. Correct condition is: if(ent1) { print("Entity is valid"); } You must not use GetEntTeam in OnExit because it returns null if a player disconnected. Players can also change team when they are inside the region. See wiki how to count players in a region. vargatom 1 Quote Link to comment Share on other sites More sharing options...
vargatom Posted December 31, 2024 Author Share Posted December 31, 2024 In this case important state is whem entity is alredy destroyed. Quote Link to comment Share on other sites More sharing options...
vargatom Posted December 31, 2024 Author Share Posted December 31, 2024 (edited) this name can be used? Edited December 31, 2024 by vargatom Quote Link to comment Share on other sites More sharing options...
Moderators palota Posted December 31, 2024 Moderators Share Posted December 31, 2024 0x1005a is number 90 converted to hexadecimal. You can use command /entitylist which prints all entities and their script names and target names. GetEntityByName searches target names. Where can we download pk3 file of this map ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.