Junior Member
Join Date: Aug 2007
Posts: 26
|
I am inputting this feat and it has the following requirements, how can I write a script for this. I tried using AND/OR statements and I got errors.
I need a script that checks for the following the Race is halfling OR 4 ranks in Bluff, Diplomacy AND Sense Motive. thanks in advance! |
#1 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
Arthurrw wrote:
> > > I am inputting this feat and it has the following requirements, how can > I write a script for this. I tried using AND/OR statements and I got errors. > > I need a script that checks for the following > > the Race is halfling OR 4 ranks in Bluff, Diplomacy AND Sense Motive. > > thanks in advance! If statements don't support AND and OR notation. So what you have to do is restate the problem: The feat is valid if the user is a halfling. Otherwise, if we don't have Bluff 4, it's NOT valid. Otherwise, if we don't have Diplomacy 4, it's NOT valid. Otherwise, if we don't have Sense Motive 4, it's NOT valid. Otherwise, it's valid. For example: ------ ~ The feat is valid if the user is a halfling. if (hero.tagis[Race.Halfling] <> 0) then @valid = 1 done endif ~ Otherwise, if we don't have Bluff 4, it'NOT valid. if (#skillranks[kBluff] < 4) then @valid = 0 done endif ~ Otherwise, if we don't have Diplomacy 4, it's NOT valid. if (#skillranks[kDiplomacy] < 4) then @valid = 0 done endif ~ Otherwise, if we don't have Sense Motive 4, it's NOT valid. if (#skillranks[kSenseMot] < 4) then @valid = 0 done endif ~ Otherwise, it's valid @valid = 1 ---------- That should solve your problem. -- Colen McAlister, colen@wolflair.com Chief Engineer, Lone Wolf Development |
#2 |
Junior Member
Join Date: Aug 2007
Posts: 26
|
Ok thanks that makes a little more sense, but now I am still having the problem that I dont understand where to put the scripting and I dont seem to see it in the tutorials, so can you tell me where I would put this?
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: Dec 2008
Posts: 4,690
|
Arthurrw wrote:
> > > Ok thanks that makes a little more sense, but now I am still having the > problem that I dont understand where to put the scripting and I dont > seem to see it in the tutorials, so can you tell me where I would put this? You want to restrict the feat from being taken, so you need to add a pre-requisite. Select the feat in the editor, and click the pre-reqs button. Click to add a new pre-requisite. You'll then be given the opportunity to specify the script and an error message to be reported when the pre-req isn't valid. Hope this helps, -- Colen McAlister, colen@wolflair.com Chief Engineer, Lone Wolf Development |
#4 |
|
|