Aller au contenu

Photo

item on aquire script


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

#1
andysks

andysks
  • Members
  • 1 654 messages
Can anybody tell me why this script, that was made by Lilacs doesn't work?
The script is named as is supposed to be named i_itemtag_aq... and as far a I know, this is all that's needed.Right?

void OnAcquire(object oEventItem, object oAcquiredBy, object oTakenFrom, int nStackSize)
{
    object oPC = oAcquiredBy;

    // Only fire for PCs.
    if ( !GetIsPC(oPC) )
        return;

    // Only fire once per game.
    if ( GetLocalInt(GetModule(), "DOONCE_OnAcquire_" + GetTag(oEventItem)) )
        return;
    SetLocalInt(GetModule(), "DOONCE_OnAcquire_" + GetTag(oEventItem), TRUE);

    // Update the party's journals.
    AddJournalQuestEntry("questtag", 21, oPC);
}

#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
The script needs a void main() function. Do you have that bit to post?

#3
andysks

andysks
  • Members
  • 1 654 messages
Um no, all there is to it is what you see here
void OnAcquire(object oEventItem, object oAcquiredBy, object oTakenFrom, int nStackSize)
Thats how it starts.

#4
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
The tag-based item scripts need a main function. Basically, you need to rename your single function to void main() (no arguments) and then define all the variables not listed out as parameters. Actually, just go into the toolset, create a new script using the item on-acquired template, and paste in your //only fire once per game section with the variable names fixed.

I don't know why Lilac's gave you the script it did, maybe someone with more experience with it can chime in.

#5
andysks

andysks
  • Members
  • 1 654 messages
It worked now with the template :). Thanks a lot. Lilacs is great but I guess sometimes I have to try doing stuff on my own ;)