[CD3.55] Keymaker problem

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
i have Keymaker in game.
mapquest_def=

D20023 [0] 0 [MonDie] Keymaker * [MapQuest_Def\Keymaker] [@DCKM] group ;;;where km is spawned
D2004 [0] 0 [Enter] * [MapQuest_Def\EnterDCKR] [@Main] group ;;;and key needed to get in boss room

In DCKR.txt=

[@Main]
#IF
#ACT
Sysmsg "You received 1 DesertCity Key for killing Keymaker"
goto @GiveDCKMKey
[@GiveDCKMKey]
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_Keymaker" %A9 "FLD_nume,FLD_DCKM" [@LoadDCKMKeys]
[@LoadDCKMKeys()]
#ACT
mov A1 %ARG(1)
mov D1 %ARG(2)
#IF
Equal A1 ""
#ACT
FormatStr "'%s',%s" %USERNAME 0
Mov A8 %A9
FormatStr "FLD_nume='%s'" %USERNAME
Mov A2 %A9
WriteValueSql "TBL_Keymaker" %A2 "FLD_nume,FLD_DCKM" %A8
goto @AddDCKMKey
#ELSEACT
goto @AddDCKMKey

[@AddDCKMKey]
#IF
#ACT
Inc D1 1
FormatStr "FLD_nume='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_DCKM='%s'" %D1
UpdateValueSql "TBL_Keymaker" %A8 %A9


And in EnterDCKR.txt =

[@Main]
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_Keymaker" %A9 "FLD_nume,FLD_DCKM" [@ReadDCKRKeys]
[@ReadDCKRKeys()]
#ACT
Mov A1 %ARG(1)
Mov D1 %ARG(2)
goto @CheckDCKRKeys
[@CheckDCKRKeys]
#IF
Elarge D1 1
#ACT
enter_ok
DEC D1 1
FormatStr "FLD_nume='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_DCKM='%s'" %D1
UPDATEVALUESQL "TBL_Keymaker" %A8 %A9
#ELSEACT
enter_fail
#ELSESAY
You cannot get in here! Get a Key!\


Now the key is added to sql and on D menu for every player when tested solo and in group.
now the problem lies ion 2 parts.
1, it either deducts the key and wont let players into boss room, or
2, allows players into the bossroom but dont take key.........


In sql TBL_Keymaker=
i have FLD_nume which is set at data type nvarchar and the FLD_DCKM is set at data type tinyint.

could this be the reason why i have problems?
 

dagras

LOMCN Veteran
Veteran
Feb 6, 2011
282
3
44
the scripts i am using work as far as adding key and deducting key, its from enter_ ok when it doesnt work.

here is info again:-

mapquest_def.txt

D20023 [0] 0 [MonDie] Keymaker * [MapQuest_Def\Keymaker] [@DCKM]
D2004 [0] 0 [Enter] * * [MapQuest_Def\EnterDCKM] [@Main]

questdiary/mapquest_def/DCKM.txt

;;不要删掉此行
[@DCKM]
#IF
#ACT
Sysmsg "You received 1 DesertCity Key for killing Keymaker"
goto @GiveDCKMKey
[@GiveDCKMKey]
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_Keymaker" %A9 "FLD_nume,FLD_DCKM" [@LoadDCKMKeys]
[@LoadDCKMKeys()]
#ACT
mov A1 %ARG(1)
mov D1 %ARG(2)
#IF
Equal A1 ""
#ACT
FormatStr "'%s',%s" %USERNAME 0
Mov A8 %A9
FormatStr "FLD_nume='%s'" %USERNAME
Mov A2 %A9
WriteValueSql "TBL_Keymaker" %A2 "FLD_nume,FLD_DCKM" %A8
goto @AddDCKMKey
#ELSEACT
goto @AddDCKMKey

[@AddDCKMKey]
#IF
#ACT
Inc D1 1
FormatStr "FLD_nume='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_DCKM='%s'" %D1
UpdateValueSql "TBL_Keymaker" %A8 %A9

;;不要删掉此行

questdiary/mapquest_def/EnterDCKM.TXT

[@Main]
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_Keymaker" %A9 "FLD_nume,FLD_DCKM" [@ReadDCKRKeys]
[@ReadDCKRKeys()]
#ACT
Mov A1 %ARG(1)
Mov D1 %ARG(2)
goto @CheckDCKRKeys

[@CheckDCKRKeys]
#IF
Elarge D1 1
#ACT
Enter_Ok
DEC D1 1
FormatStr "FLD_nume='%s'" %USERNAME
Mov A8 %A9
FormatStr "FLD_DCKM='%s'" %D1
UPDATEVALUESQL "TBL_Keymaker" %A8 %A9
#ELSEACT
enter_fail
#ELSESAY
You cannot get in here! Get a Key!\
 
Last edited:
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
OK, i've done some tests (Which really should have done a while ago). Need you guys to start to debug your own scripts, it isn't difficult to do with a little time spent.

This will work..

Code:
[@Main]
#IF
#ACT
Enter_Ok

This will work..

Code:
[@Main]
#IF
#ACT
Goto @ReadDCKRKeys

[@ReadDCKRKeys]
Enter_Ok

This will not work..

Code:
[@Main]
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_Keymaker" %A9 "FLD_nume,FLD_DCKM" [@ReadDCKRKeys]

[@ReadDCKRKeys()]
#ACT
Enter_Ok

It is completely disregarding your enter_ok command as soon as you use the SQL function. From this I would suggest it simply can't work.. although did you post that someone has posted a working version?

If this is indeed not possible, then you could try to use a text based system instead.

---------- Post Merged at 06:05 PM ---------- Previous Post was at 05:33 PM ----------

I have just posted a text based KeyMaker system that I wrote.. :) Fully tested and working :)
 
  • Like
Reactions: dagras
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
OK, i've done some tests (Which really should have done a while ago). Need you guys to start to debug your own scripts, it isn't difficult to do with a little time spent.
they need to make their own scripts before debuging , the script they use were never ment to work on ENTER_OK , its a NPC script that sets a flag witch allows enter_ok .
 
Upvote 0