help please Killcount

lordatrox

Dedicated Member
Dedicated Member
Aug 28, 2008
164
0
42
we have been working on a killcount npc using the qfunction but cannot get it to work at all as after a login it will not load the killcount file , anyways here is teh script that we are using at the mo, any help would be appreciated :)
Qfunction:

[@onkillmob(deer)]
#ACT
CalcVar Human KillCount + 1
SaveVar Human KillCount Integral.txt
BREAK

Qmanage:

[@login]
#IF
#ACT
Var Integer Human KillCount 0
LoadVar Human KillCount Integral.txt

NPC:

You have killed <$Human(KillCount)>

the npc works untill logoff then the count is reset, we got teh idea from Preachers post earlier about a killcount quest NPC and have tried to put it into a continious killcount for each mob, but like I said we are having no luck at all, any help would be appreciated.
Thankyou
/Lordatrox
 

lordatrox

Dedicated Member
Dedicated Member
Aug 28, 2008
164
0
42
been trawling through teh other posts and think that this might work on the qfunction, aint had a chance to test it yet so if anyone knows without me having to log into the server please let me know if it will or wont work, thanks in advance. the new qfunction script would be

[@onkillmob(deer)]
#IF
CHECKNAMELIST hunter.txt
#ACT
GOTO @continue
BREAK
#ELSEACT
#ACT
Var Integer Human KillCount 0
SaveVar Human KillCount Integral.txt
ADDNAMELIST hunter.txt
GOTO @continue
BREAK

[@continue]
#ACT
CalcVar Human KillCount + 1
SaveVar Human KillCount Integral.txt
BREAK



like i said not sure if this would work but tbh its the only thing I can think of, thanks again in advance for any advice anyone can offer:)
 
Upvote 0

TravisW

LOMCN Veteran
Veteran
Sep 4, 2007
737
17
105
Did you add the Variables folder with Integral.txt inside to the Quest Diary folder?
M2Server/Envir/QuestDiary/Variables/Integral.txt
 
Upvote 0

lordatrox

Dedicated Member
Dedicated Member
Aug 28, 2008
164
0
42
yeah thats there, but like i said it isnt writing anything to the integral.txt to pull up on relog so on relog it is just resetting the whole thing one thing I did notice in the logs was this tho:
21/10/2008 21:41:59] [QuestAction] Command:LOADVAR NPC:QManage Map:0(0:0) Param1:Human Param2:KillCount Param3:Integral.txt Param4: Param5: Param6: [21/10/2008 21:42:05] [QuestAction] Command:SAVEVAR NPC:QFunction Map:0(0:0) Param1:Human Param2:KillCount Param3:Integral.txt Param4: Param5: Param6

not sure if that could be the problem tbh it seems to be saving in a different place to where its loading from.
 
Upvote 0

azzi

Golden Oldie
Golden Oldie
Aug 16, 2005
1,662
19
175
#ACT
Var Integer Human KillCount 0

this is resetting it to 0 isnt it? if im right
 
Upvote 0

lordatrox

Dedicated Member
Dedicated Member
Aug 28, 2008
164
0
42
ye it is.... but i dnt want it to do tht lol. want it to keep the var as it is wen u log.... but if u remove it, it says the variable isnt bein found :s
 
Upvote 0

azzi

Golden Oldie
Golden Oldie
Aug 16, 2005
1,662
19
175
Hmm.... Not too sure then will look into it and give you feedback later.
 
Upvote 0

lordatrox

Dedicated Member
Dedicated Member
Aug 28, 2008
164
0
42
#ACT
Var Integer Human KillCount 0

I am presuming that if you set that to 1 or +1 it would just start from that number you put it at say KillCount 1 it would reset it to 1, but the line afterwards should in theory reload the file its supposed to have the killcount saved to therefore giving the char whatever killcount he/she already had before logging.
 
Upvote 0

TravisW

LOMCN Veteran
Veteran
Sep 4, 2007
737
17
105
also, you must find a spot in Qmanage for
[@login]
#IF
#ACT
Var Integer Human KillCount 0
LoadVar Human KillCount Integral.txt

If it doesn't work, move it around till it does.
Its a bit fishy.
Like if your Qmanage is totally empty but that bit, it works.
Qmanage with other stuff and variable bit at top or end, it won't work lol
 
Upvote 0