View Single Post
  #186  
Old February 10th, 2009, 02:41 PM
Ballbarian's Avatar

Ballbarian Ballbarian is offline
Colonel
 
Join Date: May 2005
Location: Kansas, USA
Posts: 1,538
Thanks: 289
Thanked 194 Times in 94 Posts
Ballbarian will become famous soon enough
Default Re: RanDom v2.03 - Map gen & Semirandomizer... Updated

Quote:
Originally Posted by das123 View Post
Thanks for the feedback.

With Fiddle Prov%, is it a logrithmic scale, linear scale, or some other formula. I'm wondering if 100 in the builder is really 50% or some other figure?
Nothing fancy, just a brute force applied via a blunt hammer.
Here is the relevant code:
Code:
REM Set fiddleCount (how many provinces to modify)...
fiddleCount=int(((provCount*fiddlePercent)/100))

REM Select random provinces to mark for modification...
fin=false
i=0
attempts=0 REM Saftey to prevent risk of infinite loop...
while (fin=false)
  attempts=attempts+1
  x=int(ran(provCount))+1
  if terFlag(x)=0 then
	if offLimits(x)=1 then
	  terFlag(x)=-1
	else
	  i=i+1
	  terFlag(x)=1
	endif
  endif
  if attempts>=(provCount*(10*fiddlePercent)) then
	PRINT #9 "*** WARNING: ATTEMPTS >= (10xfiddlePercent)xProvCount ***"
	PRINT #9 "Could not select desired number of provinces for modification."
  endif
  if (i>=fiddleCount) or (attempts>=(provCount*(10*fiddlePercent))) then
	fin=true
  endif
__________________
RanDom v2 - Map gen & Semirandomizer.
Province Editor - Custom province creation made easier.
God Editor - Custom pretender creation made easier.
Map Forge - Map editor
Reply With Quote