Aller au contenu

Photo

how do you give an item only once?


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

#1
-Rykno

-Rykno
  • Members
  • 14 messages
Hi

How do I make the script give the item(s) only once, like the DLC blood dragon armor?
I have created a templar armor for my arcane warrior/blood mage. I used the script provided with this tutorial. This however, gives me the items again when I load a savegame, if I have removed them from my inventory in some way.

Any help would be greatly appreciated.

-Rykno

oh, if anyone knows how to make set armor, would love some help with that aswell :P

#2
Laeird

Laeird
  • Members
  • 13 messages
The script from that tutorial is set to look for the item on your main character or overall inventory every time you load up the game. So if you sell, destroy, or put it on a companion the script gives you another copy of the item. This is from the event that is used:

case EVENT_TYPE_MODULE_LOAD:

{

}



I haven't looked yet but I imagine you could set it up with an event that only triggers when you start a new game. Or any number of events really.




#3
dan_upright

dan_upright
  • Members
  • 39 messages
Use plot flags, they get saved along with your game, so your script will only give you the items once, even if you get rid of them.

#4
Joshua Raven

Joshua Raven
  • Members
  • 182 messages
Check this post for more information. Be sure to read the followup comments as this method isn't for every situation but will get you by most of the time:

http://www.damods.co...msg1614#msg1614

Modifié par Joshua Raven, 17 novembre 2009 - 09:33 .


#5
Talian Kross

Talian Kross
  • Members
  • 239 messages

Joshua Raven wrote...

http://www.damods.co...msg1614#msg1614

Linking to 3rd party websites that require registration to even be allowed to view it is generally discouraged.  Internet Etiquette 101.

:whistle:

#6
Joshua Raven

Joshua Raven
  • Members
  • 182 messages
Sorry, I didn't even know registration was required. Anyway here is the script:



void main()

{

event ev = GetCurrentEvent();

int nEvent = GetEventType(ev);

Log_Events("", ev);

object oItem;

object oBow = GetObjectByTag("att_bow_master");





switch (nEvent)

{

case EVENT_TYPE_MODULE_LOAD:

{

object oPlayer = GetHero();



if (!IsObjectValid(oBow))

{

oItem = UT_AddItemToInventory(ATT_BOW,1 , oPlayer, "att_bow_master");

break;

}



break;

}

default:

{

break;

}

}

}

#7
st4rdog

st4rdog
  • Members
  • 104 messages
If you open the demo quest there's a bit in the demo100ar_wilderness script.



case EVENT_TYPE_AREALOAD_SPECIAL:
        {
            //This event fires every time the area is loaded, but we only
            //want to play the introductory cutscene once. Therefore we use this
            //if statement and plot flag to check whether it's been played before.

            if (!WR_GetPlotFlag(PLT_DEMO000PL_MAIN, DEMO_INTRO_COMPLETE))
            {
                CS_LoadCutscene(R"demo100ct_intro.cut");
                WR_SetPlotFlag(PLT_DEMO000PL_MAIN, DEMO_INTRO_COMPLETE,TRUE); //sets the plot flag to ensure we don't repeat the intro cutscene.
            }
            break;
        }


#8
Xibalba

Xibalba
  • Members
  • 2 messages
weriKK has a good description of the process on their blog, here's the relevant topic:

http://social.biowar.../8/index/114122

#9
-Rykno

-Rykno
  • Members
  • 14 messages
Thx Xibalba, that worked, and adding the correct script to the module worked aswell :P