Data Realms Fan Forums
http://45.55.195.193/

Is self.Difficulty inherited?
http://45.55.195.193/viewtopic.php?f=73&t=21010
Page 1 of 1

Author:  Roast Veg [ Tue Jan 04, 2011 3:22 pm ]
Post subject:  Is self.Difficulty inherited?

Simple as that, really. If I use self.Difficulty in one mission, then change the mission in the script, is the difficulty setting inherited?

The alternative would be something like:
Code:
Mission2.Difficulty = self.Difficulty
ActivityMan:StartActivity("GAScripted" , Mission2);


But I was wondering if such a thing was necessary.

Author:  Abdul Alhazred [ Tue Jan 04, 2011 4:27 pm ]
Post subject:  Re: Is self.Difficulty inherited?

The difficulty is not inherited and if you type print(ActivityMan:GetActivity().Difficulty) in to the console, nil is returned. This makes me suspect that you cannot set the difficulty of an activity from outside of that activity.

How about storing the difficulty in a global variable like this?
Code:
function ActivityOne:StartActivity()
   gDiff = self.Difficulty
end

function ActivityTwo:StartActivity()
   if gDiff then
      self.Difficulty = gDiff
   end
end

Author:  Roast Veg [ Tue Jan 04, 2011 4:35 pm ]
Post subject:  Re: Is self.Difficulty inherited?

That seems like the best way to do it.

Thanks Abdul.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/