Aller au contenu

Photo

Adding an item after the origins.


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

#1
Steve1981

Steve1981
  • Members
  • 11 messages
Hello,
          I'm trying to make a script to give to the player some items, but only if he/she already reached Ostagar, so after the origins.
I know how to give an item on load, but how i can check if the user is in ostagar or *after* Ostagar?
Also, how I can check during an EVENT_TYPE_AREALOAD_PRELOADEXIT if the destination area is Ostagar?
 
Thanks,
                 Stefano

#2
Mengtzu

Mengtzu
  • Members
  • 258 messages
Probably the easiest way is to make a plot that tracks whether you gave the item or not. Then you could put an event handler on the area script for...oh, Flemeth's hut? I don't think you go inside before you wake up there post-Ostagar, so it should be safe.



You could do something like



case EVENT_TYPE_ENTER: {



if (!WR_GetPlot(PLT_GIVE_MY_ITEM, ITEM_GIVEN) {



WR_SetPlot(PLT_GIVE_MY_ITEM, ITEM_GIVEN, TRUE);



UT_AddItemToInventory(R"my_item.uti",1);





}



}



Just remember to #include "wrappers_h" and "utility_h"

#3
Steve1981

Steve1981
  • Members
  • 11 messages
Hi Mengtzu,
I already know how to check if I already gave the item; I need to understand how to check if I already finished origins during a load event (if a player load a savegame *after* flemeth's hut, i still wanna give to him the item) and during an areaload event (at least I suppose that the areaload_preload* is triggered after the origins, during the "travel" to Ostagar).

Thanks anyways.

Modifié par Steve1981, 09 janvier 2010 - 02:00 .


#4
Mengtzu

Mengtzu
  • Members
  • 258 messages
Oh yes, I see, sorry :) I would suggest that there is a plot for each origin, you could check each and give the item if the appropriate flag is true. Otherwise you could grant it very early in Ostagar if there's an appropriate plot set between arrival and the player gaining control (say if there's a flag set for the initial conversation with Maric), which would then be compatible with additional Origins from other mods etc.



Which doesn't actually answer your question, but there's workarounds if you can't get the destination :)

#5
elys

elys
  • Members
  • 458 messages
I use the following check for my Mysterious Gifts addin, which verifies the player has already reached Ostagar.
This is what I use:

#include "plt_mnp00pt_ssf_prelude"

object oPC = GetHero();
object oParty = GetParty(oPC);

if (GetPartyPlotFlag(oParty, PLT_MNP00PT_SSF_PRELUDE, SSF_PRELUDE_START))
{ }

Basically most Dragon Age phases have associated plots, so depending where you want to trigger something accordingly, just check for the official plots.

Modifié par elys, 09 janvier 2010 - 02:08 .


#6
Steve1981

Steve1981
  • Members
  • 11 messages
Perfect, exactly what I need.

Thanks elys, thanks Mengtzu.

Modifié par Steve1981, 11 janvier 2010 - 01:52 .