Conversation editor questions
#1
Posté 31 octobre 2009 - 12:47
1. It appears that plot editor only supports flags. In fact it looks exactly like the old journal editor. How would you implement a counter if you wanted to the player to kill 10 monsters before setting the plot flag that the quest is complete? I read somewhere about registering global variables in a table somewhere, but I don't remember.
2. Furthermore, it looks like a conversation line condition can test a flag, but not multiple flags. So if I had some dialog with multiple prerequisites, I take it I would need to use a script instead, or is there an easier way?
3. In NWN there was no way to pass parameters into a script from the conv editor. This resulted in you having to make a metric assload of little scripts that tested various flags and counters against magic numbers. It was an organizational nightmare. NWN 2 fixed this, thank god, by allowing you to pass parameters into scripts. Please tell me there is a way to do this in Dragon Age. I see a parameter field on the conv editor, but it isn't clear how flexible this is or how it works.
#2
Posté 31 octobre 2009 - 02:41
If you want a quest to say kill 10 werewolves and there are 15 in the area to choose from, you'd either need to make x number of plot flags, or store the variable somewhere. You could add the variable to the 2da for the module or for the player, but if it was all in one area I'd use a generic variable on an invisible placeable and save yourself the trouble.
2. You use a defined flag. When you check a defined flag, it calls the plot script with the flag as a parameter. You use a switch structure to isolate which plot flag it is, and put all your scripting in there. There are template plot scripts and lots of examples in the OC to copy. As an example:
switch (nPlotFlag)
{
case QUEST_READY_FOR_TURN_IN:
{
int bPrincessRescued = WR_GetPlotFlag(PLT_RESCUE_PRINCESS, PRINCESS_RESCUED);
int bQuestComplete = WR_GetPlotFlag(PLT_RESCUE_PRINCESS, QUEST_COMPLETE);
if (bPrincessRescued && bQuestComplete)
{
bResult = TRUE;
}
break;
}
}
You could do the same thing with a conditional script, but using defined flags helps keep the number of scripts down, and keep all the scripting for a given plot localized.
3. Essentially, the plot flag is the parameter. What we do is give each plot it's own script. As with the defined flags, the flag is passed to the script, and using a switch structure you can put whatever scripted actions you want associated with the flag. The only difference compared to the above is there's no return value to worry about. The script field, which we don't really use, let's you specify a script and a single integer parameter. It's not quite as powerful as NWN2 in that respect but you could make a script like give_gold and use the integer as the amount of gold given.
Modifié par DavidSims, 31 octobre 2009 - 02:42 .
#3
Posté 31 octobre 2009 - 05:34
I took a look at my old NWN 2 to find some examples of where I was passing parameters to scripts. The most common example was a script just checked the value of a local variable. It had 3 parameters: the name of the var, the value you were checking, and the owner of the variable. I used it for things like checking if the PC has met this person before, or checking if certain characters were alive, or checking how many fish the player has caught in the fishing minigame. All of this with one conditional script. It seems like in DA I would have to write a special have_you_caught_5_fish script and a special is_bob_alive script. Is that the case or can I do these things somehow with plot flags?
This would be a lot easier if I could just look at the toolset now... Just saying.
#4
Posté 31 octobre 2009 - 10:24
You could write that script in DA, but you probably wouldn't need to.FalloutBoy wrote...
I took a look at my old NWN 2 to find some examples of where I was passing parameters to scripts. The most common example was a script just checked the value of a local variable. It had 3 parameters: the name of the var, the value you were checking, and the owner of the variable. All of this with one conditional script. It seems like in DA I would have to write a special have_you_caught_5_fish script and a special is_bob_alive script. Is that the case or can I do these things somehow with plot flags?
Plots are very powerful. There's a new way of thinking here, which is much easier to use, once you understand it.
Unlike some older games, plots don't have to have journal entries - they can include internal story logic, too. A plot is not simply data - it's an object, which runs an event script whenever you refer to it. Typically, you'll group closely-related conditions into one plot, so you don't end up with too many scripts.
On the other hand, variables are marginally harder to work with, as they have to be pre-defined in a 2da, and you have to figure out where to put the scripts that set them.
The conversation editor does this automatically - you can flag lines as "once per game".I used it for things like checking if the PC has met this person before...
Strictly speaking, the test is "have I had this conversation before?", so if multiple NPCs share a conversation file, you only get the "first meeting" dialog with the first NPC encountered.
In DA, this is quite a complex question, as a character might be a corpse, completely destroyed, or alive but not in the current area list. Since you need to put that logic somewhere, the natural place would be a defined flag in a plot script....or checking if certain characters were alive...
Here, you'd probably use a local variable to count the catch (though it's not essential). So, arguably, using a defined flag in this situation is more work. Personally I prefer this, because it keeps all the logic for this conversation in one script.or checking how many fish the player has caught in the fishing minigame.





Retour en haut






