[TD]Variable's - Saving.

smoochy boys on tour

[LeeCuz]

LOMCN Veteran
Veteran
Loyal Member
Jan 9, 2005
265
1
64
Hampshire, UK
Ok. Searched and searched nothing to avail.

Found good guides on using Variables within the DM2 Files.
But im using TD's.

Im able to use a variable while ingame. As soon as i log out this variable isnt stored. which is annoying for the purpose i have for it.


SAVEVAR And LOADVAR Do not seem to work. are there alternative NPC Commands? Or is it just the fact that TD has never encoded them?


-----------------------------SAVEVAR and LOADVAR Deffinately do not work. lol-----------------
[28/01/2008 14:09:34] [QuestAction] Command:LOADVAR NPC:QManage Map:0(0:0) Param1:Human Param2:SCKilled Param3:..\QuestDiary\Variables\Integral.txt Param4: Param5: Param6:
[28/01/2008 14:12:00] [QuestAction] Command:SAVEVAR NPC:Testl Map:0(325:269) Param1:Human Param2:SCKilled Param3:..\QuestDiary\Variables\Integral.txt Param4: Param5: Param6:
[28/01/2008 14:12:08] [QuestAction] Command:SAVEVAR NPC:Test Map:0(325:269) Param1:Human Param2:SCKilled Param3:..\QuestDiary\Variables\Integral.txt Param4: Param5: Param6:
[28/01/2008 14:12:10] [QuestAction] Command:SAVEVAR NPC:Test Map:0(325:269) Param1:Human Param2:SCKilled Param3:..\QuestDiary\Variables\Integral.txt Param4: Param5: Param6:
[28/01/2008 14:12:21] [QuestAction] Command:LOADVAR NPC:QManage Map:0(0:0) Param1:Human Param2:SCKilled Param3:..\QuestDiary\Variables\Integral.txt Param4: Param5: Param6:
[28/01/2008 14:12:59] [QuestAction] Command:SAVEVAR NPC:Test Map:0(325:269) Param1:Human Param2:SCKilled Param3:..\QuestDiary\Variables\Integral.txt Param4: Param5: Param6:


Looking forward to your reply.

Ta.
 

Liandrin2

Golden Oldie
Golden Oldie
Loyal Member
Jan 14, 2004
890
6
125
Been ages since I wrote that guide but I do remember it spammed the m2server even when it was working...

have you looked for the file \QuestDiary\Variables\Integral.txt to see what is going on with it?

I've not tried them with TD's files but it won't of been a case of him not adding them, they should be there unless he edited them out which I highly doubt. I'll try and look into them if I get time.
 
Upvote 0

[LeeCuz]

LOMCN Veteran
Veteran
Loyal Member
Jan 9, 2005
265
1
64
Hampshire, UK
EDIT:

Commands on kill of a mob i cant get to work either.

KillMobScarecrow doesnt seem to work.

Killmob doesnt work etc.

But no matter the value of the Variable. it wont save to Integral. Always stays blank.
 
Last edited:
Upvote 0

NewHope

Golden Oldie
Golden Oldie
Nov 18, 2005
1,311
28
154
I too have this problem.
I tried to change it to using mapquest instead, but still same problem. :eek:
 
Upvote 0

[LeeCuz]

LOMCN Veteran
Veteran
Loyal Member
Jan 9, 2005
265
1
64
Hampshire, UK
Mapquest and Flags wud work. But its highly tedious way to do it...

Wud involve 100's of Mapquests which reduce server speed....

So. Need a answer on this asap.
 
Upvote 0

NewHope

Golden Oldie
Golden Oldie
Nov 18, 2005
1,311
28
154
I've been playing around and now i get this error...

[Npc Condition Error] Cmd:CHECKVAR NPC:Quest Map:0 (330:277) Param1:Integer Param2:Human Param3:HenKilled Param4:> Param5:19

Also nothing saves into the Integeral.txt file and the npc from which the quest runs tells me the variable not found.
 
Upvote 0

koni

V.I.P
VIP
Mar 14, 2006
1,111
1
185
Southampton UK
no help i know but i also get the same issue, they dont save and i get spammed with all those errors in the m2 when i kill a scarecrow and return to the npc to check how many ive killed
 
Upvote 0

Liandrin2

Golden Oldie
Golden Oldie
Loyal Member
Jan 14, 2004
890
6
125
Ok guys, I've taken a look at it just now and....

it's all working fine for me ><

I'm not sure what to suggest, maybe the guides got an issue. Also you may need to create the actual Intergral.txt in the correct folder as it doesn't exist normally in the 2.3 files. Are you using Merchants or Npc files? Though I don't think that would matter.

I checked my output of the .txt at the end and it gave
[Liandrin]
SCKilled=2

So thats working fine.

My M2server had now errors at all so I'm not sure where you problems lie.

Finally heres the NPC script I used to simply test and play around with the Vars. Feel free to give it a whirl:
[@main]
<Var/@var> \
<CalculateVar/@calcvar> \
<Deletevar/@delvar> \
<LoadVar/@loadvar> \
<SaveVar/@Savevar> \
<Viewvar/@viewvar> \


[@var]
#IF
#ACT
Var Integer Human SCKilled

[@calcvar]
#IF
#ACT
CalcVar Human SCKilled + 1

[@viewvar]
#IF
#SAY
<$HUMAN(SCKilled)>

[@delvar]
#IF
#ACT
CalcVar Human SCKilled - 1

[@loadvar]
#IF
#ACT
LoadVar Human SCKilled ..\QuestDiary\Variables\Integral.txt

[@savevar]
#IF
#ACT
SaveVar Human SCKilled ..\QuestDiary\Variables\Integral.txt

So in conclusion, the actual variable system works fine for me. Possibly the example quest contains something TDs files doesn't like? Let me know anything you find out.

Remember to test it: Var first, CalcVar second, SaveVar third and then take a look if its in the Integral.txt. Should tell you if its working.
 
Last edited:
Upvote 0

NewHope

Golden Oldie
Golden Oldie
Nov 18, 2005
1,311
28
154
I got it to work, using the mapquest option rather than it saving the variables through Q-Function. I have a feel the [@KillMobScarecrow] part in Q-Function is where the problem lies.

Unless of course you used the Q-Function.txt, then i don't know why mine won't work. :P
 
Upvote 0

NewHope

Golden Oldie
Golden Oldie
Nov 18, 2005
1,311
28
154
Im getting problems now with the checkvar. It doesn't seem to check the var, even though it exists in the integral.txt file now.
 
Upvote 0