Mirage Source
NPC - Item . - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: NPC - Item . (/showthread.php?tid=497)



NPC - Item . - Tony - 19-12-2006

Okay I'm currently working on my npc chat system and I was wondering how would I make an npc give you an item ONLY once.

:: Pando


- halla - 19-12-2006

you can set a variable when you get the item and then next time have it check if that variable is set to whatever or not

you could also have it send it to the server and save it but I guess you would have to have it saved on your character file then... cause if on npc file then no one else would be able to get it...


- Tony - 19-12-2006

Quote:you can set a variable when you get the item and then next time have it check if that variable is set to whatever or not

How would I set a variable and check if its set or not? Then I would have to save it would I not?

:: Pando


- halla - 19-12-2006

hmm yeah I guess you would have to save it to the character file... cause as soon as they logged off the variable would be reset.

If its for a quest like system I guess just fields like

[QUESTS]
Quest1:1
Quest2:0

1 for completed or something. Then have it load all that with the character info and when the npc menu or whatever is brought up have it check that variable.


- Tony - 19-12-2006

Hmm I'm pretty sure someone has a better way. Hopefully that is.

Anyone? .___.

:: Pando


- halla - 19-12-2006

Theres a quest system posted on here I was gonna say look how thats done... I looked and he pretty much does what I said except he has his own file for the "flags". Your going to have to save it to something only related to the player so that it only affects them.