Rika Posted July 21, 2012 Share Posted July 21, 2012 (edited) I'm bored, so I randomly decided to type this. Keep in mind you'll need to know qedit a little to understand this. This is to create a thread that updates the amount of kills you get in real time and save them. Firstly, you need to decide of a Global flag to use. Now, pretty much all of them are in use, but you can always take the quests that use them away temporarily or remove the global flag from them. Refer to this topic to see which flags do what. http://www.edenserv.net/forum/viewtopic.php?f=21&t=1801 Let's use global flag 8 for example. Now let's make a thread. The threaded function for this example will be 1325. So, on every floor we will do thread_stg 1324 when you arrive. Now for the actual function. (Keep in mind anything with a // is a comment). 1324: jmpi_= r8, 00000001, 1 //if r8 is set the function will jmp to function 1 and basically "turn off". 1325: sync // 1 frame addi, r1, 00000001 // this is for a "update" throttle. jmpi_< r1, 00000258, 1325 //until r1 is not 0x258 or less, it's gonna keep going back to the start of the thread. 0x258 is 600 in decimal. This is to calculate 600 frames have passed. 600 frames if I remember is 20 seconds. clear r1 Reset's r1, so it starts at 0 for the next pass. chk_ene_num r2 //This calculates how many monster's have been killed and stores it in r2. let r3, r2 //this stores the value of r2 into r3. I used r3 to scrolls text to display kills for the quest in a different function using <r3>. This function isn't necessary though. jmp_!= r4, r2, 1326 //compares r4 and r2. If they aren't equal, go to 1326. Since r4 starts at 0, just getting a kill will make them unequal. If they are still equal it will skip this. jmp 1324 //goes back to the beginning. Only happens if a kill hasn't happened in the current pass. 1326: read_global_flag 00000008, r5 //read's the value of global flag 8 and stores it in r5. (flag 8 is to be our kill count) let r6, r2 //put's the amount of monster's we killed since the last pass into r6. sub r2, r4 //subtracts r4 from r2 let r4, r6 //put's r6 into r4 let r7, r2 //put's r2 into r7 add r5, r7 //put's r7 into r5 write_global_flag 00000008, r5 //stores the new amount of kills into flag 8 jmp 1324 //goes back to function 1324. Let's say you had 2 kill's in the last pass and got 3 more this pass (thus you have 5 this pass). Basically, here's what the code does. It counts 600 frames. After it checks how many enemies were killed (which would be 5). It then copies that number to another register for use to display on a scroll screen (which I didn't show the code for). Now it compares the last pass with this pass. 2 different then 5? Yes? Okay let's go to 1326. Now let's read global 8 and put it in r5. Now we put the amount of kills we have on this pass (5) into r6. Now we subtract r4 from r2 (5-2) which is 3 (r2 = 3). Now we put r6 into r4 (both r6 and r4 are now 5). We put r2 (3) and put it in r7 (now 3). Now we add r7 to r5 (3+2 = 5). We now write 5 to global 8. Then we start over. Sorry if I made any typos with the registers. But with this code, every 20 seconds, the quest will compare the amount of kills you last had, with the ones you have now, and add them to your global flag. Setting r8 will shut the thread off. I'd do that after the quest is pretty much over. Here's how I did this with Max Attack S. I'm not commenting it and it's slightly different. It multiplies based on difficulty (r83 is the difficulty). Function 95 is the start of the thread. Each map would thread_stg 95. Also, global flag 8 was the currency (which could be spent). Flag 3 was total kills by you (which couldn't be spent). Flag 3 was what was displayed on the event site (Tofu did all that). 91: muli R11, 00000001 ret 92: muli R11, 00000002 ret 93: muli R11, 00000006 ret 94: muli R11, 00000014 ret 95: sync addi R14, 00000001 jmpi_< R14, 00000258, 95 clear R14 chk_ene_num R19 let R234, R19 jmp_!= R15, R19, 96 jmp 95 96: read_global_flag 00000008, R12 read_global_flag 00000003, R13 let R16, R19 sub R19, R15 let R15, R16 let R11, R19 switch_call R83, 4:91:92:93:94 add R13, R19 add R12, R11 write_global_flag 00000008, R12 write_global_flag 00000003, R13 jmp 95 Questions, comments? Post is from Eden. This is basically how you can create a currency of some sort for a event quest. Edited July 22, 2012 by Rika 2 Quote Link to comment Share on other sites More sharing options...
Element Posted July 21, 2012 Share Posted July 21, 2012 Good idea. Quote Link to comment Share on other sites More sharing options...
Larva Posted August 20, 2012 Share Posted August 20, 2012 lol first time i see this topic .. sorry rika didn't notice it until now xD thanks and GREAT! Quote Link to comment Share on other sites More sharing options...
Zero Posted August 21, 2012 Share Posted August 21, 2012 I'm bored, so I randomly decided to type this. Keep in mind you'll need to know qedit a little to understand this. This is to create a thread that updates the amount of kills you get in real time and save them. Firstly, you need to decide of a Global flag to use. Now, pretty much all of them are in use, but you can always take the quests that use them away temporarily or remove the global flag from them. Refer to this topic to see which flags do what. http://www.edenserv....php?f=21&t=1801 Let's use global flag 8 for example. Now let's make a thread. The threaded function for this example will be 1325. So, on every floor we will do thread_stg 1324 when you arrive. Now for the actual function. (Keep in mind anything with a // is a comment). 1324: jmpi_= r8, 00000001, 1 //if r8 is set the function will jmp to function 1 and basically "turn off". 1325: sync // 1 frame addi, r1, 00000001 // this is for a "update" throttle. jmpi_< r1, 00000258, 1325 //until r1 is not 0x258 or less, it's gonna keep going back to the start of the thread. 0x258 is 600 in decimal. This is to calculate 600 frames have passed. 600 frames if I remember is 20 seconds. clear r1 Reset's r1, so it starts at 0 for the next pass. chk_ene_num r2 //This calculates how many monster's have been killed and stores it in r2. let r3, r2 //this stores the value of r2 into r3. I used r3 to scrolls text to display kills for the quest in a different function using <r3>. This function isn't necessary though. jmp_!= r4, r2, 1326 //compares r4 and r2. If they aren't equal, go to 1326. Since r4 starts at 0, just getting a kill will make them unequal. If they are still equal it will skip this. jmp 1324 //goes back to the beginning. Only happens if a kill hasn't happened in the current pass. 1326: read_global_flag 00000008, r5 //read's the value of global flag 8 and stores it in r5. (flag 8 is to be our kill count) let r6, r2 //put's the amount of monster's we killed since the last pass into r6. sub r2, r4 //subtracts r4 from r2 let r4, r6 //put's r6 into r4 let r7, r2 //put's r2 into r7 add r5, r7 //put's r7 into r5 write_global_flag 00000008, r5 //stores the new amount of kills into flag 8 jmp 1324 //goes back to function 1324. Let's say you had 2 kill's in the last pass and got 3 more this pass (thus you have 5 this pass). Basically, here's what the code does. It counts 600 frames. After it checks how many enemies were killed (which would be 5). It then copies that number to another register for use to display on a scroll screen (which I didn't show the code for). Now it compares the last pass with this pass. 2 different then 5? Yes? Okay let's go to 1326. Now let's read global 8 and put it in r5. Now we put the amount of kills we have on this pass (5) into r6. Now we subtract r4 from r2 (5-2) which is 3 (r2 = 3). Now we put r6 into r4 (both r6 and r4 are now 5). We put r2 (3) and put it in r7 (now 3). Now we add r7 to r5 (3+2 = 5). We now write 5 to global 8. Then we start over. Sorry if I made any typos with the registers. But with this code, every 20 seconds, the quest will compare the amount of kills you last had, with the ones you have now, and add them to your global flag. Setting r8 will shut the thread off. I'd do that after the quest is pretty much over. Here's how I did this with Max Attack S. I'm not commenting it and it's slightly different. It multiplies based on difficulty (r83 is the difficulty). Function 95 is the start of the thread. Each map would thread_stg 95. Also, global flag 8 was the currency (which could be spent). Flag 3 was total kills by you (which couldn't be spent). Flag 3 was what was displayed on the event site (Tofu did all that). 91: muli R11, 00000001 ret 92: muli R11, 00000002 ret 93: muli R11, 00000006 ret 94: muli R11, 00000014 ret 95: sync addi R14, 00000001 jmpi_< R14, 00000258, 95 clear R14 chk_ene_num R19 let R234, R19 jmp_!= R15, R19, 96 jmp 95 96: read_global_flag 00000008, R12 read_global_flag 00000003, R13 let R16, R19 sub R19, R15 let R15, R16 let R11, R19 switch_call R83, 4:91:92:93:94 add R13, R19 add R12, R11 write_global_flag 00000008, R12 write_global_flag 00000003, R13 jmp 95 Questions, comments? Post is from Eden. This is basically how you can create a currency of some sort for a event quest. That's what you did with Max Attack S episode 4 , so users could get prices with the scores they get through the quest right? Quote Link to comment Share on other sites More sharing options...
Rika Posted August 22, 2012 Author Share Posted August 22, 2012 (edited) That's what you did with Max Attack S episode 4 , so users could get prices with the scores they get through the quest right? With max attack S episodes 1,2, and 4 yup. The script in the code box is from the actual quests. Global flag 8 was used to store a currency that you could buy things with. Global flag 3 was used to track how many kills you got total. The code not in the box is a example, but should work if you threw it into a quest. The example only uses 1 global flag and doesn't multiply it based on difficulty though. Edited August 22, 2012 by Rika Quote Link to comment Share on other sites More sharing options...
Larva Posted August 23, 2012 Share Posted August 23, 2012 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.