Aller au contenu

Photo

Setting flags and varying codex entries


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

#1
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages
 Hello,

I'm trying to create custom content that adds codex entries as letters from various companions. I have so far succeeded in adding a codex entry upon adding an item from a container. My question is how do I add script to check for flags so that the codex entry will vary according to the flag? For example, if Zevran and the Warden werefriendly, I want the Warden receiving a "friendly" letter, not a romantic one, or the Warden shouldn't be getting a Leliana letter at all if she was never recruited. 

My current setup is:

PRCSCR gda file that adds the placeable
Plot file for letter (one so far)
Script to add the letter to inventory
The letter itself (uti)
The placeable file (container)

The script:

#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "plot_h"
#include "plt_dogletter"

void main()

{   
 
event   ev = GetCurrentEvent();    
int     nEventType = GetEventType(ev);
    object  oPC = GetHero();
    int     nDoOnce = GetLocalInt(OBJECT_SELF, "dogletter_GIVEN");
    if ( nDoOnce != 1 )    
{        switch(nEventType)        
{            case EVENT_TYPE_MODULE_LOAD:            
{
 int nHas = CountItemsByTag(oPC, "dogletter");                
if ( nHas == 0 )
                    UT_AddItemToInventory(R"dogletter1.uti", 1);                    
WR_SetPlotFlag("plt_dogletter", LETTER, TRUE);
                break;
            }        }
        SetLocalInt(OBJECT_SELF,"dogletter_GIVEN", 1);    }
}

Do I just add to the code? Or add plots? Add flags to plots? I'm confused. Any help would be appreciated! Currently it's spawning the codex in Origins as well... that's another problem. (sigh)



P.S. Yes, my first letter is actually from the dog. (shrug)

Modifié par Elrith Galadon, 03 décembre 2013 - 10:56 .


#2
MerAnne

MerAnne
  • Members
  • 1 157 messages
http://social.biowar.../index.php/Plot
This link has the information that should help you. You will likely need multiple plots one for 'received letter and friendly' another for 'received letter and romance' etc etc etc since the codex entry is specific to the plot.
  • luna1124 aime ceci

#3
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages
I've actually gone through that page a few times. Currently, the script is firing and giving me a dog letter even though the Orlesian Warden has no dog. Yikes. I've included a genpt_dog_main to the include, and I've added
WR_GetPlotFlag("plt_genpt_dog_main", DOG_MAIN_APPROVAL_MAXED_ON_RECRUITING)
to
if (nHas == 0)
, but to no avail. The codex script doesn't fire in Origins if dog isn't recruited.

I'm fairly new to scripting, so this is all very confusing.

#4
MerAnne

MerAnne
  • Members
  • 1 157 messages
My first suggestion would be to start with mods to DAO instead of Awakening until you have some experience with modding

You will need multiple plot flags each with a different codex and you will have to set the plot flag for the codex entry that you want based on the conditions.

If (Sten Friendly and Dog recruited) set flag for Codex letter from Sten and Dog
if (Sten 'not' Friendly and Dog recruited) set flag for Codex letter from Sten making threats, PS Dog Says "Hi"

There is also a tutorial somewhere on the toolset wiki on mods to Awakening. I don't have time to look for it right now.
  • luna1124 aime ceci

#5
Elrith Galadon

Elrith Galadon
  • Members
  • 44 messages
I've done that. I just don't know how to write a script so the restrictive conditions apply. My Warden is receiving letters from a dead dog, and it's in the container, while I think the script calls for the item to spawn in PC inventory. Oddly enough, when the PC opens the container and adds the letter, it spawns the codex, but then I'd need to figure out how to restrictively spawn the item so it'll appear only if certain conditions apply.

I'm modding Awakening, but I'm using PRCSCR so I haven't really noticed much difference between scripting for Origins and scripting for Awakening.

The language slightly differs from C++, so I'm not sure if it's just the problem of "no more than two conditionals within if brackets!" or "your conditional are wacko and I've no idea what you're talking about" kind of a misfire.

I suppose the best place to look for answers is the Revenant codex for the phylacteries.

#6
Sunjammer

Sunjammer
  • Members
  • 925 messages
It appears you've become quite muddled trying to implement this so I think the best thing to do is put the actual scripting out of your mind for the time being and describe what you are trying to achieve in terms of game play, i.e. how you want it to work. Then we would be better placed to guide you on how to implement it.

For example do you want the Player to find chests scattered through out some ancient ruins and each chest contains a single letter from one of the Player's companions. If the Player never recruited the companion the chest will not exist (or will be filled with random loot; or will spawn a monter; etc.)

Alternatively do you the Player to periodically return to Ye Olde Mailbox (located in camp) to see if one of his companions has sent him a letter. If the Player never recruited a particular companion the mailbox still exists but it will be empty (or the next letter in the series will spawn).

Or do you want ... well you get the picture.
  • luna1124 aime ceci