Announcement

Announcement
Keep an eye out for the upcoming 3rd Quarter Contest! 
[solved] Need a script for an altenative levelsystem.., ..working with variables 
Mar 27 2012, 03:27 PM
Post
#1


Type: Designer Alignment: Chaotic Neutral 
I already searched the script list and many topics but couldnt find something that would help me..
I need a script that checks two variables, id 001 and 002 (practical and theoretical experience points). Per each 100 points in variable 001 and for each 10 points in variable 002 the script should add 1 to the variable with id 100 (skillpoints). (If no skillpoints were spent) it should look like that: variable 001: 100 points & variable 002: 0 points > skillpoints: 1 variable 001: 200 points & variable 002: 10 points > skillpoints: 3 variable 001: 300 points & variable 002: 10 points > skillpoints: 4 variable 001: 300 points & variable 002: 20 points > skillpoints: 5 variable 001: 500 points & variable 002: 50 points > skillpoints: 10 I hope that isnt much work in scripting.. thank you in advance for helping me out! =) This post has been edited by yorusan: Mar 29 2012, 11:46 AM 


Mar 27 2012, 06:23 PM
Post
#2


is it morning already ._. Type: Undisclosed Alignment: Unaligned 
Why with a script? U can do that with normal variables too.
Just use a branch for both variables that need to be checked. If the first one reached 100, add 1 to your 3rd variable and set the first one to 0. Same for the 2nd one, if it reached 10, add 1 to the 3rd and set the 2nd to 0. 


Mar 28 2012, 04:38 PM
Post
#3


Type: Designer Alignment: Chaotic Neutral 
Why with a script? U can do that with normal variables too. Just use a branch for both variables that need to be checked. If the first one reached 100, add 1 to your 3rd variable and set the first one to 0. Same for the 2nd one, if it reached 10, add 1 to the 3rd and set the 2nd to 0. In basic thats a good idea but there are some problems: 1. problem  i need the value of the first 2 variables for the complete skillsystem and cant overwrite them.. 2. problem  for example the character has 99 experience points and gets 50, he gets 1 skillpoint and the variable is set to 0. 49 points are lost. if that happens everytime about 1/3 of all points are lost.. 


Mar 28 2012, 04:58 PM
Post
#4


is it morning already ._. Type: Undisclosed Alignment: Unaligned 
U can't overwrite them?
How so, maybe elaborate a bit more on that. For the 2nd problem, do it in a different way. For example, check if that variable is bigger than 10, if it is, gain a skill point and subtract 10 from the first variable. If that is all done with a paralell process event, whenever u actually got your 10 experience, u'll gain a skillpoint, If you then still have more than 10, u gain more. Just give out some more details about what u want to do exactly, you really do not need a script for that, unless u really refuse to do it by normal means lol 


Mar 28 2012, 06:50 PM
Post
#5


Type: Designer Alignment: Chaotic Neutral 
Ok, i'll try explaining more about that.
I got variable 1  practical experience (gained from fighting) and variable 2  theoretical experience (gained from reading books, talking with people etc..) These are unrelated from each other. When the character has 100 practical experience he should gain 1 skillpoint, if he has 200 he should gain another skillpoint (so he has 2 in total) Same thing with theoretical experience but the char gaines 1 skillpont every 10 experience points. To learn a specific skill the char may need eg. 300 practical exp and 10 theoretical exp. so the values of the 2 variables must not be changed in any way. As a result you constantly have to ask for both values and add 1 skillpoint if the variable is >=100, >=200, >=300 or >=10, >=20 and so on. I tried many times with conditional branches but the only result is the char gets way too much skillpoints.. So how do you make the event? Is there a possibility to make it with a loop? Maybe that would work, otherwise i have no idea what to do exept learning ruby.. (Sorry for my bad english and explaining....) 


Mar 28 2012, 08:14 PM
Post
#6


is it morning already ._. Type: Undisclosed Alignment: Unaligned 
So u ALWAYS get a skill point when u got 100/10 exp, as in those ammounts never change?
Well then u need 2 more variables to determine when the next skillpoint will be gained. Var 1 practical exp Var 2 theoretical exp Var 3 skillpoints Var 4 practical next Var 5 theoretical next You add experience to 1 or 2 whenever you want, it's up to you how you want to hand out exp after all. When u first set up your lvl system, u set Var 1,2 & 3 to 0 and Var 4 to the next treshold for gaining a skillpoint (with practical exp), in your case 100. Var 5 is the same, just with theoretical exp. So Var 1,2 & 3 = 0 Var 4 = 100 Var 5 = 10 Then you just need to check if Var 1 > Var 4 or Var 1 > Var 5, then you add +1 to Var 3. After that u need to add the ammount of exp needed for the next skillpoint to 4 and 5, in your case 100 and 10. Var 1 > Var 4, means practical exp is bigger than what you need, so u gain a skillpoint > Var 3 +1 Var 2 > Var 5 is the same thing, u gain a skillpoint > Var 3 +1 Now you add 100 to Var 4, means you now need to pass a total of 200 exp for practical for the next skillpoint. Then add 10 to Var 5, means you now need a total of 20 exp for theoretical to gaina skillpoint. That process just repeats each time you gaina skillpoint. This post has been edited by Necromus: Mar 28 2012, 08:15 PM 


Mar 29 2012, 11:45 AM
Post
#7


Type: Designer Alignment: Chaotic Neutral 
I didnt think about using more variables..
I tried it and it worked  actually it's very easy! And i tried it for hours with a tons of branches before *bumps head on table* Thanks a lot and sorry for wasting your time.. 


Mar 29 2012, 02:26 PM
Post
#8


is it morning already ._. Type: Undisclosed Alignment: Unaligned 
Heh you're welcome.
Yup, it's actually pretty easy once u done that stuff once, and no time wasted 


LoFi Version  Time is now: 22nd September 2014  09:25 PM 
