Aller au contenu

Photo

Setting Plot Flag on Item Aquire


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

#1
madsabroo

madsabroo
  • Members
  • 259 messages
Is there an easy script to set a plot flag when a player acquires a quest item?  I was trying to use the EVENT_TYPE_PLACEABLE_ONCLICK in a placeable script but I think I'd rather just resort to a the flag being sent when they pick up a quest item.  Any help would be amazing. :)

#2
_L_o_B_o_

_L_o_B_o_
  • Members
  • 117 messages
If you don't have a module script, create it and attach it to your module (File > Manage Modules > Properties > Script). You also have to set to 1 the ITEM_SEND_ACQUIRED_EVENT local variable of your item.

Here is my code.

/*
    Type:   Module Script.
    Desc:   Manages module events.
*/

#include "utility_h"
#include "events_h"

void main()
{
    event   eEvent      = GetCurrentEvent();
    int     nEventType  = GetEventType(eEvent);

    if (nEventType == EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED)
    {
        object oItem     = GetEventObject(eEvent, 0);
        string sItemTag  = GetTag(oItem);

        if (sItemTag == "my_item_tag")
        {
            // Set plot flag here.
        }
    }
}

Modifié par _L_o_B_o_, 22 janvier 2011 - 10:29 .


#3
madsabroo

madsabroo
  • Members
  • 259 messages
Awesome. Thank you so much!