View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:56 pm



Reply to topic  [ 3 posts ] 
 Is self.Difficulty inherited? 
Author Message
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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.


Tue Jan 04, 2011 3:22 pm
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post 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


Tue Jan 04, 2011 4:27 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Is self.Difficulty inherited?
That seems like the best way to do it.

Thanks Abdul.


Tue Jan 04, 2011 4:35 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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.253s | 13 Queries | GZIP : Off ]