Mirage Source http://web.miragesource.net/forums/ |
|
NPC - Item . http://web.miragesource.net/forums/viewtopic.php?f=201&t=879 |
Page 1 of 5 |
Author: | Tony [ Tue Dec 19, 2006 4:28 am ] |
Post subject: | NPC - Item . |
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 |
Author: | halla [ Tue Dec 19, 2006 4:37 am ] |
Post subject: | |
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... |
Author: | Tony [ Tue Dec 19, 2006 4:47 am ] |
Post subject: | |
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 |
Author: | halla [ Tue Dec 19, 2006 4:50 am ] |
Post subject: | |
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. |
Author: | Tony [ Tue Dec 19, 2006 4:51 am ] |
Post subject: | |
Hmm I'm pretty sure someone has a better way. Hopefully that is. Anyone? .___. :: Pando |
Author: | halla [ Tue Dec 19, 2006 4:56 am ] |
Post subject: | |
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. |
Author: | Lea [ Tue Dec 19, 2006 5:08 am ] |
Post subject: | |
instead of saving 0 or 1 for true or false, and use a whole 2 bytes of space, create a bit field, and save 8 quest status's in 1 byte. That's at least if all you're keeping track of is passed or not passed. |
Page 1 of 5 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |