Setting Plot Flag on Item Aquire
Débuté par
madsabroo
, janv. 22 2011 05:22
#1
Posté 22 janvier 2011 - 05:22
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
Posté 22 janvier 2011 - 10:28
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.
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
Posté 22 janvier 2011 - 03:33
Awesome. Thank you so much!





Retour en haut






