Data Realms Fan Forums http://45.55.195.193/ |
|
Recognizing modules http://45.55.195.193/viewtopic.php?f=73&t=45583 |
Page 1 of 1 |
Author: | 4zK [ Thu Mar 06, 2014 6:03 pm ] |
Post subject: | Recognizing modules |
Is there a way to tell which .rte something came from? In this particular case I'm trying to check if an actor came from Ronin.rte, for example. |
Author: | Coops [ Thu Mar 06, 2014 6:26 pm ] |
Post subject: | Re: Recognizing modules |
Code: if soldier.presetname == ("Ronin.rte/Soldier") then Should be what you're looking for. |
Author: | 4zK [ Thu Mar 06, 2014 6:38 pm ] |
Post subject: | Re: Recognizing modules |
I think that one goes for specific actors though, I'd want to include everything in the module. EDIT: I'll see if this works: Code: if soldier.PresetName == ("Ronin.rte/" .. soldier.PresetName) then |
Author: | clunatic [ Thu Mar 06, 2014 6:58 pm ] |
Post subject: | Re: Recognizing modules |
I don't think that syntax is correct Coops and in any case like 4zK said it would only work for specific actors. Here's my get module function (which was made with the help of Foa, CaveCricket and Bad Boy): Code: ----------------------------------------------------------------------------------------- --Get Module Function ----------------------------------------------------------------------------------------- function GetModule(Preset) --print("getting module") for i = 0, (PresetMan:GetTotalModuleCount()-1) do Preset.TempModule = PresetMan:GetEntityDataLocation(Preset.ClassName, Preset.PresetName, i) local number1, number2 = string.find(Preset.TempModule, ".rte") if number2 ~= nil then local TempModule = string.sub(Preset.TempModule, 1, number2) Preset.Module = TempModule end end --print(Preset.Module) return Preset.Module end This is what I use to get modules in my custom activities. It should in theory work with both actors and weapons, but I've only tried it with actors. |
Author: | 4zK [ Thu Mar 06, 2014 7:16 pm ] |
Post subject: | Re: Recognizing modules |
Yeah, it works. Thanks. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |