Jump to content

  •  

ToiletMaster

Member Since 23 May 2013
Offline Last Active Feb 07 2017 05:39 PM
-----

Posts I've Made

In Topic: Dynamic Switch Statement with choices

20 September 2015 - 09:20 AM

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! :wow: :thx: :thx:


In Topic: Dynamic Switch Statement with choices

19 September 2015 - 06:24 PM

Hi emistry,

 

thank you once again for your reply. I've just tested this the moment i got back but unfortunately i can't seem to get it working.

 

i did not change the core part of the scripts aside from minor additions aside from that.

 

i can't seem to select any of the choices i want for quest ID i've specified. I notice it could be this line

 

 

if ( .@avail_quest_count >= .@quest_size )

 

i've checked the variable to see what were the cases and it's either 0,0; 3,3; 3;3 which states that my quest is completed thus disallowing me to continue, i've tried hard to crack this down and even created a script to delete all my quest entries related to the script to ensure that those quests aren't accepted at all.

 

Would highly appreciate if you take a look to advise where i went wrong. Thank you once again.

 

 

 

 

  new_1-2,90,111,5    script    Sample#quest    4_F_KAFRA2,{    mes ""+.@npcname$+"";    mes "Please select category below";    .@category = select    (        "Option 1",        "Option 2",        "Option 3"    ) - 1;        .@quest_size = getd( ".quest_id_"+.@category+"_size" );    copyarray .@quest,getd( ".quest_id_"+.@category ),.@quest_size;        for ( .@i = 0; .@i < .@quest_size; .@i++ )        {        if ( questprogress( .@quest_id[.@i] ) != 2 )            {            .@menu$ = .@menu$ + "Level - "+.@quest_id[.@i];            .@avail_quest_count++;            }        .@menu$ = .@menu$ + ":";        }        if ( .@avail_quest_count >= .@quest_size )    {        mes ""+.@npcname$+"";        mes "All quest finished.";        mes "avail: "+.@avail_quest_count+"quest size: "+.@quest_size+"";        close;    }        .@i = select( .@menu$ ) - 1;    mes ""+.@npcname$+"";    mes "Selected Quest Category "+( .@category+1 )+" - Level "+( .@i+1 )+" - "+.@quest_id[.@i];        if ( .@i > 0 )    {        if ( questprogress( .@quest_id[.@i-1] ) != 2 )        {            mes ""+.@npcname$+"";            mes "You cant take this quest because you haven't finish the previous quests.";            close;        }    }        if ( questprogress( .@quest_id[.@i] ) == 1 )    {        mes ""+.@npcname$+"";        mes "You've already taken this quest but not yet complete.";        close;    }    else  //Quest Requirements started        {    if (.@quest_id[@i] == 20000)    {        mes ""+.@npcname$+"";        mes "You have select quest 20000 as your current quest. ";        setquest .@quest_id[.@i];        close;    }        }        mes "Quest Accepted";        setquest .@quest_id[.@i];        close;OnInit:        .@npcname$ = "[^FF0000 Sample ^000000]";    setarray .quest_id_1,        20001,        20002,        20003;    .quest_id_1_size = getarraysize( .quest_id_1 );        setarray .quest_id_2,        20004,        20005,        20006;    .quest_id_2_size = getarraysize( .quest_id_2 );        setarray .quest_id_3,        20007,        20008,        20009;    .quest_id_3_size = getarraysize( .quest_id_3 );    end;}

In Topic: Dynamic Switch Statement with choices

18 September 2015 - 06:16 AM

Hi Emistry,

 

First and foremost, thank you for your reply. The sample that you've provided definitely worked in this case. However, my apologies as  i guess i missed out one part of the explanation. Currently i've drawn a graph on how the dynamic switch was supposed to be like divided by Level 1, 2, 3. Followed by groups of A B C.

 

For example, within level 1, you can see A B C groupings there, however if the person finished the A group level 1, he can see A group level 2 quests.

 

However, not B group's Level 2 quest unless he has finished the Level 1 for B Group.

 

I hope this explanation is not confusing, once again thank you for your time and i appreciate your help!

 

edit image below for further reference.

 

Attached File  Untitled.png   5.89K   17 downloads


In Topic: Sample Instancing

15 September 2015 - 03:47 PM

I just recently got the hang of Instancing and I'm doing quite well with it, if you want help, add me on skype. itzmichaelmorici :P

@ToiletMaster

 

 

Thanks! i've just added you onto skype! :D

 

will be waiting for your confirmation.


In Topic: Disguise,Ignore,Attack

28 December 2014 - 12:11 PM

hmm, what i do is just have them relog lol. Though its weird that option 0 won't work.

 

 

awww thanks anyway for the option though! i'll keep it in mind thanks!