View Single Post
  #20  
Old 01-28-2013, 03:34 PM
MattCaspermeyer MattCaspermeyer is offline
Approved Member
 
Join Date: Aug 2010
Posts: 553
Question Interesting...

Quote:
Originally Posted by Sir Whiskers View Post
I performed such testing in my first game and no variability/twins after using a couple hundred containers. However...
Right. You must either reacquire the container or restart.

Quote:
Originally Posted by Sir Whiskers View Post
I started a new game and some of the containers gave different results (fire spiders, lake dragonflies). I started a third game, and again some containers gave different results (skeleton archers). But within a specific game, the results never varied.
Hmmm... I've been experiencing different results here, but I was level 6 (unsure if that matters) after starting a new game with the new variants.

I used 22 Spider Eggs (1 at a time) and I was able to get each type of unit (although the percentages didn't appear to match the percentages that I have listed). I also got a pretty good split between Thorns and Thorn Warriors (biased towards Thorn Warriors) when I used 12 seeds individually. I only had 2 Skeleton Graves, but got one of each and 3 Vampire Coffins and 2 instances of Vampires and 1 of Ancient Vampires.

Quote:
Originally Posted by Sir Whiskers View Post
So, it appears the random function is working fine when the game starts. I suspect it will also kick in whenever I find a container (not buy). That would match what I saw in AP/CW, where modifications to the Item_Monster file would not take until I found a container of the type I had modded. If that's the case, then I would guess that the random value is being saved in the game and not changing until certain trigger events.
When I was testing initially in TL, buying the container reset the item's item parameter list and allowed the objuse_spawn_troop function to work on the new data therein. I'm not sure if they've changed this in AP/CW, but to me it shouldn't matter whether you pick one up or buy in TL.

Incidentally, if you don't restart a new game, and you use the item, the new item parameters will not show up when using the objuse_spawn_troop function. The item parameter data is only refreshed when reacquiring the item, hence why it doesn't work with a current save. Believe it or not, that function was already setup for random functions, but as you so astutely note it only changed with each new game (as they were using the Game.Mutate function which is a random function, but only for each game). There is another function, diap that is in LOGIC_HERO.LUA that is used for certain hero things and that's what objuse_spawn_troop is set up to use. The number I'm sending to diap is random (Game.Random( 1, total_prob)), but diap also uses Game.Mutate.

So therein may be the issue, I may try to use another of their built-in random selection functions as it seems that I need to work on this part of the code more.

Quote:
Originally Posted by Sir Whiskers View Post
I'll keep testing the containers at various points to see if they change within the same game and let you know.
Well that sounds great! I'll keep fiddling, too, and hopefully we'll get to the bottom of this!

/C\/C\
Reply With Quote