Aller au contenu

Photo

GEN_HIRE_FOLLOWER -- it annoys me that this works


9 réponses à ce sujet

#1
Talisander

Talisander
  • Members
  • 173 messages
Just started using the toolset yesterday, and I'm loving it.  At first I was stumped by how to add a party member, but after some searching I found two ways to do it.  One way is to call the function UT_HIREFOLLOWER (I think that's what it's called) within a script.

The other way is to simply go into a conversation file and link a plot file as an action to one of the lines of dialog.  You look in the /Global directory and then find the plot file with "party" in the filename.  Then, you select the GEN_HIRE_FOLLOWER flag within that plot file as the thing to be flagged.  It works like a charm, adding the npc that owns the conversation to your party, but it annoys me that it does work, because it suggests that I really don't understand what is going on with plot files.

I was under the impression that plot files are mostly made up of boolean variables (or plot flags).  I thought their only effect on the game would be when you create something that references them, like a line of dialog that only gets spoken when a certain flag is set.  I don't understand why simply setting a plot flag within a Bioware-made plot file like this somehow adds a party member.  Are there other plot flags that have useful effects like this?  Is there some way to look up what they are and what they do?

   Another added point of confusion is that the plot flag can be set multiple times for different npcs, and it can continue to add new party members in this way.  I would think once GEN_HIRE_FOLLOWER is set it is set, but there must be something I'm not getting about what GEN_HIRE_FOLLOWER is.  

Any help would be really appreciated.

Modifié par Talisander, 06 décembre 2009 - 06:07 .


#2
Augerman

Augerman
  • Members
  • 38 messages
There's a set of generic plot files in Global>Generic that have a corresponding set of scripts with same name in Global>Plot Scripts.  The plot file only has constants that fire off to the scripts of the same name.

EG From the plots script file

   case GEN_HIRE_FOLLOWER:
            {
                UT_HireFollower(oConversationOwner);
                break;
            }

Modifié par Augerman, 06 décembre 2009 - 06:34 .


#3
Talisander

Talisander
  • Members
  • 173 messages
Ok, so as I understand it GEN_HIRE_FOLLOWER is a main plot flag, which basically runs the script its plot object is linked to whenever it is set. It also does this every time it's set, whether or not it's already been set. So it's basically just a way of running a script, regardless of what the value of the plot flag is.



So in this way, if you want a script to run off of a conversation, one way of doing it is to set a plot flag, which then calls a script, which does something based on that particular plot flag being set. You could also just link the script to that line of conversation, couldn't you? Is there any significant difference between those two methods, when using plot flags this way?

#4
Talisander

Talisander
  • Members
  • 173 messages
One question I forgot to ask explicitly:



The plot flag stays set even after the script is run, correct? So if you checked its value, it would be 1 and not 0, afterwards, even though calling it again will still run the script and run the particular case linked to GEN_HIRE_FOLLOWER. Am I on the right track?



Thanks a lot for your help, by the way!

#5
FalloutBoy

FalloutBoy
  • Members
  • 580 messages
As you say, there are other ways to fire off a script from a conversation line so I would probably only use the setting of plot flags for actual global data and not just to fire off some random script. The only difference that I am aware of is that a plot script will call the global plot handler script unless you take that out. Probably wouldn't hurt anything though so it's just a style choice.



It is important to remember that if you set or clear a plot flag, the plot script runs BEFORE the set or the clear takes place. So if you query the flag's value in the script, the value will be the previous value and not the new. If you want to get the new value, I'm pretty sure it is in one of the event parameters read out at the top of the plot handler template script.


#6
Craig Graff

Craig Graff
  • Members
  • 608 messages
Once you get access to the main campaign files you should see hundreds of examples of how plot flag scripting is useful.

#7
Sunjammer

Sunjammer
  • Members
  • 925 messages
In the meantime you might also find this article useful: social.bioware.com/wiki/datoolset/index.php/User:Sunjammer/Plot_flags_%28draft%29

#8
Sunjammer

Sunjammer
  • Members
  • 925 messages

Talisander wrote...

One question I forgot to ask explicitly:

The plot flag stays set even after the script is run, correct? So if you checked its value, it would be 1 and not 0, afterwards, even though calling it again will still run the script and run the particular case linked to GEN_HIRE_FOLLOWER. Am I on the right track?

Thanks a lot for your help, by the way!

A main flag can be set (i.e. it has a persistent value) but a defined flag cannot: a defined flag's set/unset status is calculated whenever you call the plot script (i.e. it has a dynamic value).

#9
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
Attaching actions to flags using a custom plot script is the primary way plot scripting is done in Dragon Age.



The advantage is you only need a small number of scripts to handle a wide variety of actions, and related actions are located in the same script.



The plot flag is set (or cleared) after the script is run, which can be a bit confusing but gives you slightly more scripting power as you know both what the flag used to be and what it is about to be.



Every time you set or clear the plot flag the script runs, unless you call it from scripting with the run script parameter set to false. In this way generic actions, such as GEN_HIRE_FOLLOWER, are fully possible.

#10
Talisander

Talisander
  • Members
  • 173 messages
Thanks for the replies, guys! Feeling more confident about all the options available to me, and as Craig said I'll probably spend a lot of time perusing the main campaign files once those are available. Sunjammer, that page on the wiki is easy to read and very helpful. Hope you do more tutorials (I saw you have one on item upgrades as well).


David, after some thought I think I see what you're saying with the advantage of using plot flags with a custom plot script. You can have one script, like the generic party script gen00pt_party.nss, and just have it handle a bunch of things by having plot flags use one particular case in the script. The alternative would be having a bunch of separate scripts which are called by each conversation object, which would be messy, hard to keep track of, and involve a lot of copy and pasting. I think I get it. Thanks :)

Modifié par Talisander, 09 décembre 2009 - 05:09 .