Aller au contenu

Photo

Setting Plot Flags For Debugging


3 réponses à ce sujet

#1
WhatDuck

WhatDuck
  • Members
  • 5 messages
I'm trying to find a way to set plot flags from the console for debugging. My project has a lot of flags in a bunch of different plots, and I want to write a couple of scripts to let me get, set and clear them for debugging and testing purposes.

Essentially, what I want to do is type into the console:

runscript SetAFlag flag_name parent_plot_name new_value

and have my SetAFlag script set or clear the flag as appropriate.

The problem is that WR_SetPlotFlag takes constants for the plot and flag names, and I can't find an easy way to get those constants from console parameters. 

There has to be a better way than writing a separate script for each flag, but I'm just not seeing it. Can anyone help?

#2
Sunjammer

Sunjammer
  • Members
  • 925 messages
The constants represent literal values so you should be able to use those.  The value is the flag's Flag property (also known as the PLOT_FLAG_ID).

If it isn't your own module then you should be able to extract the appropriate NSS file from the ERF ... unless of course it is encrypted DLC.

For example the plt_rrhr_no_good_deed.nss (which is auto-generated for the plt_rrhr_no_good_deed.plo) looks like:

// Plot defines

// No Good Deed ...
const string PLT_RRHR_NO_GOOD_DEED = "77A02F2F7C6C4B7F82C15BA3018CF213";
    const int RRHR___FLAG_0_ACCEPTED = 0;
    const int RRHR___FLAG_1_ITEMS_COLLECTED = 1;
    const int RRHR___FLAG_2_WOLF_KILLED = 2;
    const int RRHR___FLAG_3_COMPLETE = 3;
    const int RRHR__PLAYER_HAS_FOOD = 256;
    const int RRHR__PLAYER_HAS_WINE = 257;
    const int RRHR__PLAYER_HAS_FLOWERS = 258;

So If I want to set RRHR___FLAG_2_WOLF_KILLED I can simply pass WR_SetPlotFlag the value 2 for the nFlag parameter.

Modifié par Sunjammer, 22 mars 2010 - 08:39 .


#3
WhatDuck

WhatDuck
  • Members
  • 5 messages
Okay, that makes sense. So to set flag values through the console I need to pass in the literal constant rather than the flag name?



What about the plot names? Does each plot need its own script, or can I have one script for setting flags that takes plot name as a parameter?

#4
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
You don't need a new script for each plot. You would type in something like this:



runscript SetAFlag rrhr_no_good_deed 2



WR_SetPlotFlag can take either the GUID or the plot name. Using the GUID, which is what the constant evaluates to, is faster, but for a debugging script that's not really important.



Of course, your script would have to be set up to parse the input text and isolate the two arguments, but I'm guessing you know how to do that alredy.