• How can I tell if an Antlionguard is the glowing kind?
    2 replies, posted
So I've copied the SaveTables from when I spawn a regular npc_antlionguard and an npc_antlionguardian I'm not quite sure what value decides what type of guard it is. I used Notepad++ to compare the two files via plugin, and there are a number of values that changed. I'll post the values that are different, because the SaveTable has a lot of values. I'll omit time-related ones because I sincerely doubt they have anything to do with the type of guard we have. I'll also omit the m_GMOD_ entries. Regular Glowing m_flEncodedController = table: 0x3698e2e0 table: 0x33ca9868 m_flPoseParameter = table: 0x33613810 table: 0x336293b0 m_flexWeight = table: 0x3284ef48 table: 0x34a127d0 m_hCaveGlow = table: 0x349d9aa8 table: 0x3315f548 m_hMyWeapons = table: 0x327ec3a0 table: 0x32df1a60 m_iAmmo = table: 0x32d78270 table: 0x37334ff0 m_iszOverrideSubMaterials = table: 0x364c6768 table: 0x369ca668 m_rgflCoordinateFrame = table: 0x32e5f730 table: 0x336fcf28 m_strOverrideMaterial = table: 0x33824368 table: 0x33600840 m_strRealClassName = table: 0x34a173c8 table: 0x34a18d60 Since it appears they are all tables, I don't feel like it's safe to just force the exact same table value. So how can I tell?
The source code for npc_antlionguard is here, and after a quick search, it 'looks like the guardian visuals (green skin, glow effect) are controlled by the keyvalue cavernbreed (corrsponding to the internal variable m_bCavernBreed), while guardian-specific behavior and the poison effect are controlled by the keyvalue incavern (corresponding to the internal variable m_bInCavern). You should be able to check for both of these with Entity:GetKeyValues().
Well. After I posted this I kept experimenting and found that :GetSkin ... well, returns 0 when the antlionguard spawns, but 1 frame later (timer.Simple(0, function() etc ... the glowing one returns 1 while the other still returns 0. This works well enough for me, I don't expect any issues regarding this. Entity/GetSkin is shared, after all, and if the guard starts burrowed as I plan to have it do, then I don't think there's any way it can be harmed before the 1st frame. Maybe a perfectly timed explosion? I guess I could make the antlionguard invincible for the 1st frame... I really should explore the suggestion you made, however. I want to better my knowledge and skill in general, and I have a lot of unexplored territory in that regard. Thanks for the suggestion!
Sorry, you need to Log In to post a reply to this thread.