quacko Posted March 23, 2012 Share Posted March 23, 2012 Well ive been working on this mod for some time now,and one of the things its going to do is make you get jumped by yakuza gangersat certain points, and the script is working just about perfectly as is, BUTone thing i really need is to be able to assign a random number to a variable and then spawna certain actor type depending on the outcome of the variable...The only prolem is that ive been looking around what seems like everywhereand ive come up with nothing to do that.So my question to all you scripting geniuses out there; can it realy be true that the geck scripting languagedoesnt include a randomizer of any sort anyhere!? i have an idea as to how i could work around it, but it would be crude and clumsy in comparison,it would be something like syncing two timers one larger than the other, making sure to loop the lower oneand using the result of that one when the larger timer reaches zero, but as you all can see,thats not really optimal considering that a function like in PHP's rand(x,x) would be some much easier,and less consuming of the system... So if anyone out there can help me out here i would be greatly appreciative. Link to comment Share on other sites More sharing options...
viennacalling Posted March 23, 2012 Share Posted March 23, 2012 The only prolem is that ive been looking around what seems like everywhereand ive come up with nothing to do that.So my question to all you scripting geniuses out there; can it realy be true that the geck scripting languagedoesnt include a randomizer of any sort anyhere!? What was wrong with GetRandomPercent? and one of the things its going to do is make you get jumped by yakuza gangersat certain points, and the script is working just about perfectly as is, BUTone thing i really need is to be able to assign a random number to a variable and then spawna certain actor type depending on the outcome of the variable... Why not use a LeveledCharacter? The randomness is included. Link to comment Share on other sites More sharing options...
quacko Posted March 23, 2012 Author Share Posted March 23, 2012 well i wouldnt say that there is anything wrong with the GetRandomPercent as i havent tried it, due to the fact that i couldnt find it,wich is the reason why i asked about it. :)but it does seem to do exactly what i want so thanks a lot for pointing it out f me :) and about the leveled character list, as i see it it wont be possible with the script im working on since im using thePlaceAtMe function to spawn the enemies and as i understood it, it needs a reference to a specific object or actor,but please correct me if im wrong, cause i still feel like a complete newb grasping blindly at straws as i go along :) and again thanks a lot, and i'll get on trying ou the GetRandPercent right away Link to comment Share on other sites More sharing options...
Astymma Posted March 23, 2012 Share Posted March 23, 2012 well i wouldnt say that there is anything wrong with the GetRandomPercent as i havent tried it, due to the fact that i couldnt find it,wich is the reason why i asked about it. :)but it does seem to do exactly what i want so thanks a lot for pointing it out f me :) and about the leveled character list, as i see it it wont be possible with the script im working on since im using thePlaceAtMe function to spawn the enemies and as i understood it, it needs a reference to a specific object or actor,but please correct me if im wrong, cause i still feel like a complete newb grasping blindly at straws as i go along :) and again thanks a lot, and i'll get on trying ou the GetRandPercent right away You can actually created a LeveledCharacter list, then create an NPC that inherits from the list as a template. Place this NPC into a dummy cell in an initially disabled state. When needed, move the marker to the player and enable it. When done, move it back to the dummy cell and disable it. Link to comment Share on other sites More sharing options...
quacko Posted March 24, 2012 Author Share Posted March 24, 2012 Well first off, WOHOO!!!The GetRandomPercent was exactly what i was looking for my random encounter script works perfectly now,and i just realized that the leveled character and creature lists also work with the PlaceAtMe function so now i canmake my encounters even more random and specific at the same time (i love working with paradoxes) :) and to Astymma i actually did see another mod when i started with this that used the dummy cell conept,but i personally found the PlaceAtMe function worked better with what i was doing,or atleast it seemed more doable for a newb like myself,primarily because i also wanted to be abke to spawn creatures aswell as NPC's andbesides that the GetRandomPercent was inexpendable since i didnt necesarily want it to spawn anything each time my timer reaches zero. But still, thanks a lot for the input :) Link to comment Share on other sites More sharing options...
Recommended Posts