- May 13, 2003
- 94
- 0
- 102
Hey all just messing about with a couple of NPC ideas and i have it working fine i just want it layed out differently...
Basically what i have is a table in SQL which looks a bit like:
|Name|a|b|c|d|e|f|g|h|i|j|k|
Now, when the player clicks the NPC the name is added to the database and columns A-K are filled with a default value of 0.
At certain points after doing certain things it will update a certain column to 1
i have all this working fine but what i want is to open another NPC, checks which colums have a 1 and display a link, if they have a 0 they wont show. This is pretty much the script i wrote for it.....
Now this works fine but you can only use so many %ARG(X) for each link. I sorted it by putting a Page2 and loading the rest of the values that way (which erases the 1st values). I dont really like it this way though as on page 1 there could only be 1 link activated. Is there anyway i could have them all showing on 1 page. I can VNC the script from my comp if you dont understand.
I guess i could Re-Write it all using Flags instead of SQL but id prefer not to as this gives you less control.
Thanks!
Basically what i have is a table in SQL which looks a bit like:
|Name|a|b|c|d|e|f|g|h|i|j|k|
Now, when the player clicks the NPC the name is added to the database and columns A-K are filled with a default value of 0.
At certain points after doing certain things it will update a certain column to 1
i have all this working fine but what i want is to open another NPC, checks which colums have a 1 and display a link, if they have a 0 they wont show. This is pretty much the script i wrote for it.....
Code:
#ACT
FormatStr "FLD_NAME='%s'" %A0
ReadValueSql "TBL_Test" %A9 "a,b,c,d,er" [@TCheck1]
[@TCheck1()]
#IF
#ACT
mov D1 %ARG(1)
mov D2 %ARG(2)
mov D3 %ARG(3)
mov D4 %ARG(4)
mov D5 %ARG(5)
goto @TMenu1
[@TMenu1]
#IF
EQUAL D1 "1"
#SAY
Column A is Activated\
#IF
EQUAL D2 "1"
#SAY
Column B is Activated\
#IF
EQUAL D3 "1"
#SAY
Column C is Activated\
#IF
EQUAL D4 "1"
#SAY
Column D is Activated\
#IF
EQUAL D5 "1"
#SAY
Column E is Activated\
I guess i could Re-Write it all using Flags instead of SQL but id prefer not to as this gives you less control.
Thanks!
Last edited: