Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36

Thread: Introduction / my efforts

  1. #21

    Post

    Nice
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  2. #22

    Post

    OK - I want to play too..

    Here it is in php:
    Code:
    #!/usr/bin/php -q
    <?php
      $elite = TRUE;
    
      if ($elite)
        $seed = array(0x5A4A, 0x0248, 0xB753);
      else
        $seed = array(rand(0, 0xffff), rand(0, 0xffff), rand(0, 0xffff));
    
      function tweakseed() {
        global $seed;
        $seed[] = ($seed[0] + $seed[1] + $seed[2]) % 0x10000;
        array_shift($seed);
      }
    
      function name()  {
        global $seed;
        $digraphs = "..lexegezacebisousesarmaindirea.eratenberalavetiedorquanteisrion";
        $longnameflag = $seed[0] & 0x40;
        $name = "";
    
        for ($n=0; $n<4; $n++) {
          $d = (($seed[2] >> 8) & 0x1f) << 1;
          tweakseed();
    
          if( $n < 3 || $longnameflag )
            $name = $name . substr($digraphs, $d, 2);
        }
    
        $name = ucwords(str_replace(".", "", $name))."\n";
    
        return $name;
      }
    
      if (isset($argv[1]))
        for ($n=0; $n<$argv[1]; $n++)
          echo name();
      else
          echo name();
    ?>
    and the results with elite set as true:

    Tibedied
    Qube
    Leleer
    Biarge
    Xequerin
    Tiraor
    Rabedira
    Lave


    -Rob A>

  3. #23
    Guild Novice The Good Doctor's Avatar
    Join Date
    Nov 2008
    Location
    Eugene, Oregon, USA
    Posts
    24

    Default

    I take it you are looking for a name generator that will interface with your program? Or just a name generator?

  4. #24
    Community Leader NeonKnight's Avatar
    Join Date
    Aug 2007
    Location
    Surrey, Canada, EH!
    Posts
    5,051

    Default

    WOW!

    Welcome to the Guild!
    Daniel the Neon Knight: Campaign Cartographer User

    Never use a big word when a diminutive one will suffice!

    Any questions on CC3? Post them with CC3 in the Subject Line!
    MY 'FAMOUS' CC3 MAPS: Thunderspire; Pyramid of Shadows; King of the Trollhaunt Warrens; Demon Queen's Enclave

  5. #25
    Community Leader RPMiller's Avatar
    Join Date
    Apr 2006
    Location
    Watching you from in here
    Posts
    3,226

    Default

    Great stuff!
    Bill Stickers is innocent! It isn't Bill's fault that he was hanging out in the wrong place.

    Please make an effort to tag all threads. This will greatly enhance the usability of the forums.



  6. #26
    Guild Journeyer Sagenlicht's Avatar
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    249

    Post With a GUI

    I took isomage's code and did wrap a GUI around.

    Enjoy.

    I will make a binary for windows, so you easily can use it without having python and PyGTK installed.

    Code:
    #!/usr/bin/env python
    
    # SNG (Star Name Generator) is based on the ELITE game
    # Name Generator code written by isomage
    # http://http://axiscity.hexamon.net/users/isomage/
    # or http://cartographersguild.com
    
    # GUI by Sagenlicht for easier use
    # http://cartographersguild.com
    
    # Version 0.5
    
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    
    # You should have received a copy of the GNU General Public License
    # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    import pygtk
    pygtk.require('2.0')
    import gtk
    import random
    
    
    class SNG:
    	def __init__(self, useRandom):
    		if useRandom:
    			self.seed = [random.randint(0, 0xffff), random.randint(0, 0xffff), random.randint(0, 0xffff)]
    		else:
    			self.seed = [0x5A4A, 0x0248, 0xB753]
    
    	def tweakseed(self):
    		temp = (self.seed[0] + self.seed[1] + self.seed[2]) % 0x10000
    		self.seed[0] = self.seed[1]
    		self.seed[1] = self.seed[2]
    		self.seed[2] = temp
    
    	def generate_name(self):
    		self.digraphs = "..lexegezacebisousesarmaindirea.eratenberalavetiedorquanteisrion"
    		longnameflag = self.seed[0] & 0x40
    	
    		name = ""
    
    		for n in range(4):
    			d = ((self.seed[2] >> 8) & 0x1f) << 1
    	
    			self.tweakseed()
    	
    			if n < 3 or longnameflag:
    				name += self.digraphs[d:d+2]
    
    		return name.replace(".", "").title()
    		
    	def generate_list(self, namesToGenerate):
    		nameList = []
    		for i in xrange(namesToGenerate):
    			nameList.append(self.generate_name())
    		return nameList
    		
    class GUI:
    	def __init__(self):			
    		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
    		self.window.connect( "destroy", self.destroy )
    		self.window.set_title( "ELITE based Name Generator" )
    		self.window.set_border_width(5)
    		self.window.set_size_request(250, 400)
    		self.window.show()
    			
    		self.mainBox = gtk.VBox()
    		self.mainBox.set_border_width(5)
    		self.mainBox.set_size_request(250, 400)
    		self.window.add(self.mainBox)
    		self.mainBox.show()
    		
    		self.generateFrame = gtk.Frame(label="Names to generate")
    		self.mainBox.pack_start(self.generateFrame, False, False, 1)
    		self.generateFrame.set_label_align(0.5, 0.5)
    		self.generateFrame.show()
    		
    		self.comboList = gtk.combo_box_new_text()
    		self.comboList.append_text ("5")
    		self.comboList.append_text ("10")
    		self.comboList.append_text ("25")
    		self.comboList.append_text ("50")
    		self.comboList.set_active (1)
    		self.generateFrame.add(self.comboList)
    		self.comboList.show()
    		
    		self.modeFrame = gtk.Frame(label="Choose Mode")
    		self.mainBox.pack_start(self.modeFrame, False, False, 1)
    		self.modeFrame.set_label_align(0.5, 0.5)
    		self.modeFrame.show()
    		
    		self.modeBox = gtk.VBox()
    		self.modeBox.set_border_width(5)
    		self.modeBox.set_size_request(200, 60)
    		self.modeFrame.add(self.modeBox)
    		self.modeBox.show()
    		
    		self.randomButton = gtk.RadioButton(None, "Random Star Names")
    		self.modeBox.pack_start(self.randomButton, False, False, 1)
    		self.randomButton.show()
    		self.randomButton.set_active(True)
    		self.eliteButton = gtk.RadioButton(self.randomButton, "ELITE Game Names")
    		self.modeBox.pack_start(self.eliteButton, False, False, 1)
    		self.eliteButton.show()
    		
    		self.nameFrame = gtk.Frame(label="Generated Names")
    		self.mainBox.pack_start(self.nameFrame, True, True, 1)
    		self.nameFrame.set_label_align(0.5, 0.5)
    		self.nameFrame.show()
    		
    		self.tmpBox = gtk.VBox()
    		self.tmpBox.set_border_width(0)
    		self.tmpBox.set_size_request(180, 200)
    		self.nameFrame.add(self.tmpBox)
    		self.tmpBox.show()
    		
    		scroll_box = gtk.ScrolledWindow()
    		scroll_box.set_border_width(5)
    		scroll_box.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC )
    		self.tmpBox.pack_start( scroll_box, True, True, 0 )
    		scroll_box.show()		
    		
    		self.namesBox = gtk.TextView(buffer=None)
    		self.namesBoxBuffer = self.namesBox.get_buffer()
    		self.namesBox.set_editable(False)
    		self.namesBox.set_cursor_visible(False)
    		self.namesBox.set_wrap_mode(gtk.WRAP_WORD)
    		self.namesBox.set_justification(gtk.JUSTIFY_LEFT)
    		self.namesBox.show()
    		scroll_box.add_with_viewport(self.namesBox)		
    		
    		self.buttonBox = gtk.HButtonBox()
    		self.buttonBox.set_layout(gtk.BUTTONBOX_END)
    		self.buttonBox.set_spacing(5)
    		self.buttonBox.set_border_width(1)
    		self.buttonBox.set_size_request(250, 50)
    		self.mainBox.pack_start(self.buttonBox, True, True, 1)
    		self.buttonBox.show()	
    		
    		cancelButton = gtk.Button( stock=gtk.STOCK_CLOSE )
    		cancelButton.connect_object( "clicked", gtk.Widget.destroy, self.window)
    		self.buttonBox.add(cancelButton)
    		cancelButton.show()
    		
    		okButton = gtk.Button(stock=gtk.STOCK_OK)
    		okButton.connect("clicked", self.ok_clicked)
    		self.buttonBox.add(okButton)
    		okButton.show()
    		
    	def ok_clicked( self, widget, data = None):
    		if self.randomButton.get_active():
    			useRandom = True
    		if self.eliteButton.get_active():
    			useRandom = False
    		generateNames = SNG(useRandom).generate_list(int(self.comboList.get_active_text()))
    		tmpString = ""
    		heightRequest = 0
    		for name in generateNames:
    			tmpString = (tmpString + "%s" % name + "\n")
    			self.namesBoxBuffer.set_text(tmpString)
    			heightRequest = heightRequest + 14
    		self.namesBox.set_size_request(180, heightRequest)
    		
    	def destroy( self, widget, data=None ):
    		gtk.main_quit()
    	
    	def gtkCall(self):
    		gtk.main()
    		
    if __name__ == "__main__":
    	callSNG = GUI()
    	callSNG.gtkCall()
    EDIT: Added a screenshot of the GUI. Dont get irritated by the german button, thats language depend so no worries
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	ELITE based Name Generator.png 
Views:	34 
Size:	19.2 KB 
ID:	8205  
    Last edited by Sagenlicht; 12-05-2008 at 06:32 PM.
    My Map Challenge Entries

    I use GIMP for all my maps.

    GIMP scripts and plug-ins overview


    Everything I post on this site uses the Creative Common Attribution-Noncommercial-Share Alike license. Only exception to this are any pyhton scripts which use the GPL.

    If you are using any of my posted stuff just use your rep stick on me

    Should you be interested in using anything I posted on commercial purpose drop me a pm.

  7. #27

    Post

    Cool. I've given the name generator its own page on my site too.
    Last edited by isomage; 12-05-2008 at 07:10 PM.
    My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

  8. #28
    Guild Journeyer Sagenlicht's Avatar
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    249

    Post Hmm

    Hmm just did the windows binary but I cant upload it here, as it is 13 MB compressed as a zip or 7.5 MB as a 7z file.

    Anyone knows a place where I can upload it?
    My Map Challenge Entries

    I use GIMP for all my maps.

    GIMP scripts and plug-ins overview


    Everything I post on this site uses the Creative Common Attribution-Noncommercial-Share Alike license. Only exception to this are any pyhton scripts which use the GPL.

    If you are using any of my posted stuff just use your rep stick on me

    Should you be interested in using anything I posted on commercial purpose drop me a pm.

  9. #29
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,197
    Blog Entries
    8

    Post

    Quote Originally Posted by Sagenlicht View Post
    13 MB
    choke ! Firefox and all its dll's are 13Mb - what have you got in there ?

  10. #30
    Guild Journeyer Sagenlicht's Avatar
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    249

    Post Heh

    Hmm the python and GTK runtime enviroment

    I just use the py2exe tool for this. Dunno if it can be optimized I just follow its tutorial for PyGTK scripts.

    Anyways I would recommend to just install python, GTK and PyGTK and use the script. Having Python installed never hurts

    I decided to create a new threat here, so its easier to find the script because I hope some people are interested in it

    It includes the link to my How-To for the Phyton setup.
    Last edited by Sagenlicht; 12-05-2008 at 07:42 PM.
    My Map Challenge Entries

    I use GIMP for all my maps.

    GIMP scripts and plug-ins overview


    Everything I post on this site uses the Creative Common Attribution-Noncommercial-Share Alike license. Only exception to this are any pyhton scripts which use the GPL.

    If you are using any of my posted stuff just use your rep stick on me

    Should you be interested in using anything I posted on commercial purpose drop me a pm.

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •