Thanks for the help! this time it works perfectly! thank you very much! i do have one more question though, as i was understanding your script, i tried to create an npc that deletes the quest using your method of accessing arrays, previously i did the manually method of deleting each quest by specifying each quest. But i can't seem to make it work, i tried various options such as copying the arrays over, and such and comparing with your script.
the main difference i can see is that all your arrays during the for method is using .@ instead . would that make an impact here? i tried copying the arrays and setting it as .@ as well but it did not work. basically the main method would be checking if you've accepted any quest and upon any of the mentioned arrays were conditioned as 1, it would then erase that ID.
Once again thank you for your help!
[/s][s] for ( .@i = 0; .@i < .number_quest; .@i++ ){ if (questprogress (.quest_id[.@i] == 1)) erasequest .quest_id[.@i]; } mes "Quest Deleted"; close; OnInit: setarray .quest_id, 20001, 20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009; .number_quest = getarraysize(.quest_id); }[/s][s]
edit:
i understand i can set .@i = 20000 and <= 20009 and thus doing the change from there. however, my only concern would be what happens if we have jumping numbers from 20000,30000,40000 and such in this manner.
edit:
i managed to fixed it !
After referring once again to the script you posted, i managed to find out the problem! here's the one that's working
for ( .@i = 0; .@i <= .number_quest ; .@i++ ){ if (questprogress (.quest_id[.@i]) == 1) erasequest .quest_id[.@i]; } mes "Quest Deleted"; close; OnInit: setarray .quest_id, 20001, 20002, 20003, 20004, 20005, 20006, 20007, 20008, 20009; .number_quest = getarraysize(.quest_id); }
Thank you so much for the following script @Emistry! It works brilliantly now!