2.3 TD files - HARD Question - NPC Collections

Join Discord

Dave2

Dedicated Member
Dedicated Member
Jan 24, 2008
42
0
52
Hey everybody, this is a HARD ONE (well for me it is) I can't seem to find any info on making a special NPC.

the NPC will Collect a certain item, from any player, and after the NPC gets a count of 500 of the items it will Unlock a doorway permanantly.

Kinda like Euro when they did the pumpkin event with OKS.
The NPC had to collect a total of 500 Pumpkins after that it set the Doorway to oks to open to people. The Items were NOT stackables and anybody could contribute to the opening of the doorway.

Any clues how this is set up guys? I'm lost here when searching the forums.
 

T0MMY

LOMCN Veteran
Veteran
Aug 5, 2007
2,153
24
145
United Kingdom
Hey everybody, this is a HARD ONE (well for me it is) I can't seem to find any info on making a special NPC.

the NPC will Collect a certain item, from any player, and after the NPC gets a count of 500 of the items it will Unlock a doorway permanantly.

Kinda like Euro when they did the pumpkin event with OKS.
The NPC had to collect a total of 500 Pumpkins after that it set the Doorway to oks to open to people. The Items were NOT stackables and anybody could contribute to the opening of the doorway.

Any clues how this is set up guys? I'm lost here when searching the forums.

I'll be suprised if you can do this. If someone helps you with this ill be taking for my own account.
 
Upvote 0

samhag

Dedicated Member
Dedicated Member
Jul 31, 2008
213
0
62
should be able to do it using variables to count the number of items taken.
 
Upvote 0

ρяєα¢нєя

Unstookie Titled
VIP
Aug 19, 2008
444
23
105
Can be done using Global Variables.

Envir->Market_def->CaveNPC:
Code:
[@main]
#IF
CheckVar Global ItemCount > 499
#SAY
Congratulations you have unlocked the cave! \ \
<Move to cave/@move>
BREAK
#ELSESAY
Give me the items! \ \
<Give item/@check> || <Exit/@exit>

[@check]
#IF
Checkitem <item> 1
#ACT
GOTO @give
BREAK
#ELSESAY
You do not have the item. \ \
<Exit/@exit>

[@give]
#IF
CheckVar Global ItemCount > 498
#ACT
CalcVar Global ItemCount + 1
SaveVar Global ItemCount ../QuestDiary/Variables/Integral.txt
TAKE <Item> 1
#SAY
Congratulations you have unlocked the cave! \ \
<Move to cave/@move>
#ELSEACT
TAKE <Item> 1
CalcVar Global ItemCount + 1
SaveVar Global ItemCount ../QuestDiary/Variables/Integral.txt
#ELSESAY
Thanks! \
The server has curently collected <$Global(ItemCount)>/500 items. \ \
<Exit/@exit>

[@move]
#ACT
mapmove <mapname> <x> <y>
give townteleport 1
BREAK

Envir->MapQuest_def->QManage.txt:
Code:
[@login]
#IF
#ACT
Var Integer Global ItemCount 0
LoadVar Global ItemCount ../QuestDiary/Variables/Integral.txt

Knocked that up in 2mins so sorry if theres any bugs, but should give you a rough idea.

p
 
Last edited:
Upvote 0

NewHope

Golden Oldie
Golden Oldie
Nov 18, 2005
1,311
28
154
I'm sure this might be possible, I remember Massacre server doing something similar for one of their events - although they were using the 1.9 files. :)
 
Upvote 0

Dave2

Dedicated Member
Dedicated Member
Jan 24, 2008
42
0
52
ρяєα¢нєя;670741 said:
Can be done using Global Variables.

Envir->Market_def->CaveNPC:
Code:
[@main]
#IF
CheckVar Global ItemCount > 499
#SAY
Congratulations you have unlocked the cave! \ \
<Move to cave/@move>
BREAK
#ELSESAY
Give me the items! \ \
<Give item/@check> || <Exit/@exit>

[@check]
#IF
Checkitem <item> 1
#ACT
GOTO @give
BREAK
#ELSESAY
You do not have the item. \ \
<Exit/@exit>

[@give]
#IF
CheckVar Global ItemCount > 498
#ACT
CalcVar Global ItemCount + 1
SaveVar Global ItemCount ../QuestDiary/Variables/Integral.txt
TAKE <Item> 1
#SAY
Congratulations you have unlocked the cave! \ \
<Move to cave/@move>
#ELSEACT
TAKE <Item> 1
CalcVar Global ItemCount + 1
SaveVar Global ItemCount ../QuestDiary/Variables/Integral.txt
#ELSESAY
Thanks! \
The server has curently collected <$Global(ItemCount)>/500 items. \ \
<Exit/@exit>

[@move]
#ACT
mapmove <mapname> <x> <y>
give townteleport 1
BREAK

Envir->MapQuest_def->QManage.txt:
Code:
[@login]
#IF
#ACT
Var Integer Global ItemCount 0
LoadVar Global ItemCount ../QuestDiary/Variables/Integral.txt

Knocked that up in 2mins so sorry if theres any bugs, but should give you a rough idea.

p

I set it up as you shown here but, the m2server kept giving me errors every time I handed in a pumpkin.
 
Upvote 0

Dave2

Dedicated Member
Dedicated Member
Jan 24, 2008
42
0
52
Here's the error I get on each pumpkin handed in.


[3/23/2009 2:15:22 AM] [Npc Condition Error] Cmd:CHECKVAR NPC:CaveNPC Map:0 (328:261) Param1:Global Param2:ItemCount Param3:> Param4:49 Param5:
[3/23/2009 2:15:24 AM] [Npc Condition Error] Cmd:CHECKVAR NPC:CaveNPC Map:0 (328:261) Param1:Global Param2:ItemCount Param3:> Param4:498 Param5:
[3/23/2009 2:15:24 AM] [QuestAction] Variable not found:ItemCount Command:CALCVAR NPC:CaveNPC Map:0(328:261) Param1:Global Param2:ItemCount Param3:+ Param4:1 Param5: Param6:
[3/23/2009 2:15:24 AM] [QuestAction] Variable not found:ItemCount Command:SAVEVAR NPC:CaveNPC Map:0(328:261) Param1:Global Param2:ItemCount Param3:../QuestDiary/Variable/Integral.txt Param4: Param5: Param6:




And the NPC text in game says:
variable not found
 
Upvote 0

Dave2

Dedicated Member
Dedicated Member
Jan 24, 2008
42
0
52
Also I put the Script to collect only 50 items from me as a test instead of 500.
 
Upvote 0

ρяєα¢нєя

Unstookie Titled
VIP
Aug 19, 2008
444
23
105
Have you got your Variable folder setup? Go to Envir/QuestDiary/ and see if theres a folder there called "Variables". If there isn't create one and then create a txt file inside called "Integral.txt".

EDIT: Just tested it on my server and it works fine.

p
 
Last edited:
Upvote 0

Dave2

Dedicated Member
Dedicated Member
Jan 24, 2008
42
0
52
ρяєα¢нєя;670790 said:
Have you got your Variable folder setup? Go to Envir/QuestDiary/ and see if theres a folder there called "Variables". If there isn't create one and then create a txt file inside called "Integral.txt".

EDIT: Just tested it on my server and it works fine.

p

I had those errors after I've created the Variables Folder and inside that folder I created the Integral.txt file

Is there anything Else you can think of?
Do I have to put anything inside the integral file?
maybe Pumpkin 0 or something??
 
Upvote 0

ρяєα¢нєя

Unstookie Titled
VIP
Aug 19, 2008
444
23
105
Very nice lol, didnt know NPC's could do stuff like this.

Yea there are quite a few NPC commands that make them very versitile. Take a look at my NPC thread for some more ideas: Link

I had those errors after I've created the Variables Folder and inside that folder I created the Integral.txt file

Is there anything Else you can think of?
Do I have to put anything inside the integral file?
maybe Pumpkin 0 or something??

Only other thing i can think of is that you haven't setup you QManage file correctly. Make sure you don't have two [@Login]'s or somthing.

Other than that i can't help i'm afraid, as i said it pasted straight in and worked first time on mine. :(

p
 
Upvote 0

Bon

Legend
Legendary
Jul 29, 2004
6,726
330
300
Kent, UK
ρяєα¢нєя;670872 said:
Yea there are quite a few NPC commands that make them very versitile. Take a look at my NPC thread for some more ideas: Link



Only other thing i can think of is that you haven't setup you QManage file correctly. Make sure you don't have two [@Login]'s or somthing.

Other than that i can't help i'm afraid, as i said it pasted straight in and worked first time on mine. :(

p
stop postin on forums and do some work :punch:
 
Upvote 0