Aller au contenu

Photo

trying to set single player plot flags in a custom module script


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Rolenka

Rolenka
  • Members
  • 2 257 messages
First of all, this is the first time ever I've tried anything with plot flags. So bear with me.

I'm trying to make a mod that will grant all of the shapeshifting abilities learned in the Fade to the player immediately, to minimize backtracking during the quest.

I thought I'd try making a script to simply duplicate the plot flags set in the conversations when the abilities are granted to see if that would work. (it looks like it goes down the line to a script that actually grants the ability using AddAbility())

Example: 
cir300_mage_apprentice.dlg: 
Plot: cir300pt_mage_apprentic
Flag: CIR_MAGE_APPRENTICE_GRANTS_FORM
goes to cir300pt_mage_apprentic.nss:
WR_SetPlotFlag( PLT_CIR300PT_SHAPESHIFTING, FADE_SHAPESHIFTING_GIVE_MOUSE, TRUE, TRUE );
goes to cir300pt_shapeshifting.nss:
AddAbility( oPC, CIR_FADE_FORM_MOUSE);

I thought I'd set the CIR_MAGE_APPRENTICE_GRANTS_FORM flag with WR_SetPlotFlag to see if that was enough to get the ball rolling, but for that function you need to #include "wrappers_h". When I did that and compiled, it returned an error saying wrappers_h needed a StartingConditional() or Main().

It also returned an error saying it couldn't find my "plt_cir300pt_mage_apprentic" include (necessary for the WR_SetPlotFlag variables). I assumed adding "plt_" to the beginning was directing it to "cir300pt_mage_apprentic.plo," which does exist.

I have the module set to be a single player extension, so I was disappointed I can't use those resources. Even wrappers_h!

So am I hosed trying to set these plot flags? If I could, would doing so even grant the abilities? (it was kind of a shot in the dark)

If I do end up having to just use AddAbility(), the game should be able to remove the abilities as normal. The player just wouldn't get any codex entries for each ability.

Should I try creating this script as a new resource in the actual Single Player module? It should compile then. But would it work if I packaged it in a module?

Thanks for your help. I tried to be as clear as possible.

Modifié par Rolenka, 20 février 2010 - 04:55 .


#2
Magic

Magic
  • Members
  • 187 messages
http://social.biowar.../Plot#Scripting

What you want to do is possible and a good approach. "wrappers_h" ist a header, so you'll need the #include "wrappers_h" in your own script. The header script itself will not compile, nor does it need to. Headers are always to be included into other base scripts, so having an own main() or StartingConditional() would lead to duplicate definitions.

Yes, you'll need a #include "plt_cir300pt_mage_apprentic" in your script additionally. The plot flag IDs are defined there to be used in scripts.

Modifié par Magic, 20 février 2010 - 07:32 .


#3
Rolenka

Rolenka
  • Members
  • 2 257 messages
I was not trying to compile wrappers_h. ^_^ It did that on it's own. And I did include both of those files. Here's my code: 

#include "wrappers_h"
#include "plt_cir300pt_mage_apprentic"

void main()
{
    PrintToLog("form granting script being read");
    WR_SetPlotFlag( PLT_CIR300PT_MAGE_APPRENTIC, CIR_MAGE_APPRENTICE_GRANTS_FORM, TRUE, TRUE );
    return;
}


And the errors it returns when compiled: 

I: 10:19:56 - Offers.xml file has been updated successfully.
I: 10:19:56 - AddIns.xml file has been updated successfully.
I: 10:19:56 - Generated the campaign file.
W: 10:19:56 - No starting area specified for campaign.
I: 10:19:56 - Compile failed
E: 10:19:56 - wrappers_h.nss - wrappers_h.nss(?): Script must contain either a main or StartingConditional
I: 10:19:56 - Compiling wrappers_h.nss...
E: 10:19:55 - sf_x1_grantforms.nss - Unable to get the resource information for "cir300pt_mage_apprentic" of type "plo"


I can't explain it.

#4
Magic

Magic
  • Members
  • 187 messages
Ah sorry. ^^ Well, I don't know then. Usually this works. :P I'm not familiar with the campaign scripts.

#5
Craig Graff

Craig Graff
  • Members
  • 608 messages
You have to make sure you have included Single Player under File > Manage Modules > Hierarchy.

#6
Rolenka

Rolenka
  • Members
  • 2 257 messages
I knew you'd have the answer, Craig. Thanks for posting on the weekend.(Magic too, for giving it a shot)

Modifié par Rolenka, 21 février 2010 - 06:55 .