Pneuma Posted April 9, 2012 Posted April 9, 2012 - script RandomPokemon -1,{ OnInit: setArray $Pkmn[0], 2694,2702,2704,2705,2707,2709,2716,2698,2717,2723,2725,2729,2731,2736,2744,2739,2748,2749,2750,2751,2752,2753,2754,2755,2758,2759,2760,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2775,2776,2777,2778,2779,2780,2774,2781,2782,2788,2789,2791,2792,2793,2773,2790; set $random, $Pkmn[rand(getarraysize($Pkmn))]; OnClock0115: OnClock0330: OnClock0445: OnClock0600: OnClock0715: OnClock0830: OnClock0945: OnClock1100: OnClock1215: OnClock1330: OnClock1445: OnClock1600: OnClock1715: OnClock1830: OnClock1945: OnClock2100: OnClock2215: OnClock2330: OnClock0030: monster "elysium", 0, 0, ""+getmonsterinfo($random,MOB_NAME)+"",$random, 1, strnpcinfo(0)+"::OnKilled2"; OnKilled2: close; } I'm not sure if I made the monster command right along with the array Quote
JayPee Posted April 10, 2012 Posted April 10, 2012 Try this: - script RandomPokemon -1,{ OnInit: setarray .Pkmn[0], 2694,2702,2704,2705,2707,2709,2716,2698,2717,2723,2725,2729,2731,2736,2744,2739,2748,2749,2750,2751,2752,2753,2754,2755,2758,2759,2760,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2775,2776,2777,2778,2779,2780,2774,2781,2782,2788,2789,2791,2792,2793,2773,2790; OnClock0115: OnClock0330: OnClock0445: OnClock0600: OnClock0715: OnClock0830: OnClock0945: OnClock1100: OnClock1215: OnClock1330: OnClock1445: OnClock1600: OnClock1715: OnClock1830: OnClock1945: OnClock2100: OnClock2215: OnClock2330: OnClock0030: set .@random, .Pkmn[rand(0,getarraysize(.Pkmn)-1)]; monster "elysium", 0, 0, ""+getmonsterinfo(.@random,MOB_NAME)+"",.@random, 1, strnpcinfo(0)+"::OnKilled2"; end; OnKilled2: close; } My guess is your scheduling a monster to be summoned. I change the $Pkmn to .Pkmn so it will be an npc variable not a global permanent variable and also put this set .@random, .Pkmn[rand(0,getarraysize(.Pkmn)-1)]; below OnClock0030: so it monster to be summon will be randomize. and also made Instead of: rand(getarraysize(.Pkmn)) I made it: rand(0,getarraysize(.Pkmn)-1); so the generation of randomize numbers which will be used to access the .Pkmn array variable wont exceed to the number of elements in that variable. Take note also that script array can only handle 128 elements/values. Quote
Pneuma Posted April 10, 2012 Author Posted April 10, 2012 So I got everything right except for those 2-3 minor bugs?(the monster spawn with shows the pokemon's name the same from the randomized) Quote
Question
Pneuma
I'm not sure if I made the monster command right along with the array
2 answers to this question
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.