View unanswered posts | View active topics It is currently Thu Dec 26, 2024 3:49 am



Reply to topic  [ 5 posts ] 
 Recognizing modules 
Author Message
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post 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.


Thu Mar 06, 2014 6:03 pm
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: Recognizing modules
Code:
if soldier.presetname == ("Ronin.rte/Soldier") then


Should be what you're looking for.


Thu Mar 06, 2014 6:26 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post 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
EDIT2: didn't work


Thu Mar 06, 2014 6:38 pm
Profile

Joined: Fri Nov 23, 2012 5:42 am
Posts: 143
Reply with quote
Post 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.


Thu Mar 06, 2014 6:58 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Recognizing modules
Yeah, it works. Thanks.


Thu Mar 06, 2014 7:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.035s | 13 Queries | GZIP : Off ]