This site is in archival mode. A replacement is being developed. In the meantime, please use the PBW2 Forums for community discussions. The replacement software for this site will use a unified account system with PBW2, and any newly created threads will carry over.
Welcome to Spaceempires.net
Login or Register

Search
Modules
· Content
· Downloads
· Forums
· Game Info
· Image Gallery
· Links
· Shipyards
· Topics
· Staff

User Info
· Welcome, Anonymous
Membership:
· New: Astorre
· New Today: 0
· New Yesterday: 0
· Overall: 3155

People Online:
· Visitors: 270
· Members: 0
· Total: 270

  

Spaceempires.net :: Custom Racial Traits mini-mod :: View topic
Forum FAQ :: Search :: Memberlist :: Usergroups :: Profile :: Log in to check your private messages :: Log in


Custom Racial Traits mini-mod

 
Post new topic   Reply to topic    Spaceempires.net Forum Index -> Balance Mod
View previous topic :: View next topic  
Author Message
BlueTemplar
Space Emperor


Joined: Mar 27, 2007

PostPosted: Fri May 07, 2010 7:41 am    Post subject: Custom Racial Traits mini-mod Reply with quote

I'd like to try again the idea of a SE4-style Racial Traits customization, but since I will have to write a lot of lines, I was thinking to make a program instead to do it for me. I heard Python was a programming language easy to learn, do you think it will do for what I have in mind, i.e. :
From an input of Name, Description, Cost, Starting Amount, various Increase Cost parameters, etc... generate a working RacialTraits.txt with several values for each bonus?


Back to top
LordZsar1
Space Emperor


Joined: Feb 07, 2008
Location: Leipzig, Deutschland

PostPosted: Fri May 07, 2010 2:44 pm    Post subject: Reply with quote

Certainly it will.

Back to top
CaptainKwok
Balance Guru


Joined: Aug 04, 2003
Location: Toronto, Canada

PostPosted: Fri May 07, 2010 4:01 pm    Post subject: Reply with quote

It's probably more effort though then just cut and pasting and changing two values per entry. Razz

Space Empires Depot | SE:V Balance Mod


Back to top
TheThirdEye
Space Emperor


Joined: Mar 22, 2009
Location: Toronto

PostPosted: Sat May 08, 2010 6:32 pm    Post subject: Reply with quote

Almost definitely. On the other hand it's a simple little program, that's easy to write and test if you're looking to learn programming.

Back to top
LordZsar1
Space Emperor


Joined: Feb 07, 2008
Location: Leipzig, Deutschland

PostPosted: Sun May 09, 2010 10:17 am    Post subject: Reply with quote

For learning to program in general, something with typed variables might be better...

Back to top
BlueTemplar
Space Emperor


Joined: Mar 27, 2007

PostPosted: Sun Sep 05, 2010 6:43 pm    Post subject: Reply with quote

Well, it wasn't that hard after all! Smile

Here's the program:

Code:

inp = open('Database.csv','r')
start = open('start.txt','r')
out = open('RacialTraits.txt','w')

for line in start:
#    print (line)
    out.write(line)

for line in inp:
  inplist = line.split(',')
#  print (inplist)
  start = int(inplist[-3])
  end = int(inplist[-2])
  value = int(inplist[1])
  alternate = int(inplist[-1])
#  print (start, end, value, alternate)
  n = start
  while (abs(n) < end + 1):
      name = "Name                                            := " + inplist[0] + " " + str(n) + '\n'
      pic_num = "Picture Number                                  := 0\n"
      rac_cost = "Racial Cost                                     := " + str(value * n // start) + '\n'
      ab_num = "Number Of Abilities                             := 1\n"
      ab1_type = "Ability 1 Type                                  := " + inplist[2] + '\n'
      ab1_desc = "Ability 1 Description                           := " + inplist[3] + '\n'
      ab1_scope = "Ability 1 Scope                                 := " + inplist[4] + '\n'
      ab1_range = "Ability 1 Range Formula                         := 0\n"
      ab1_am1 = "Ability 1 Amount 1 Formula                      := " + str(n) + '\n'
      ab1_am2 = "Ability 1 Amount 2 Formula                      := 0\n"
      num_req = "Number Of Requirements                          := 0\n"
      fullstring = name + pic_num + rac_cost + ab_num + ab1_type + ab1_desc + ab1_scope + ab1_range + ab1_am1 + ab1_am2 + num_req + '\n'
#      print (fullstring)
      n = (- alternate * 2 + 1) * 2 * n
      out.write(fullstring)
out.write('=====\n*END*\n=====')


It reads from a Database.csv whose lines look like this:
Quote:

Mining,250,Resource Gen Modifier - Minerals,Mineral resource collection changed by [%Amount1%]% from Racial trait.,Galaxy - This Player,5,100,1

The 1 in the last column defines if the numbers take alternatively positive and negative values.

I'm off to inputing the values in the database...

http://files.spaceempires.net/user/1418/CustomRacialTraits.zip


Back to top
BlueTemplar
Space Emperor


Joined: Mar 27, 2007

PostPosted: Sun Sep 05, 2010 8:22 pm    Post subject: Reply with quote

Done! Very Happy

Now there's a lot of balancing to do, especially for when values reach -100%. Suggestions are welcome! Wink

I'm sure there's a lot more of potential hidden here : for instance what these fields are for?
Ability 1 Range
Ability 1 Amount 2

And I'm sure there are other Ability Types I didn't knew of...
And what happens when you change the Scope from Galaxy - This Player to something else?

http://files.spaceempires.net/user/1418/CustomRacialTraits2.zip


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Spaceempires.net Forum Index -> Balance Mod All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
All logos and trademarks used on this site, all comments and stories posted for reading, all files hosted for download,
and all art work hosted for viewing are property of their respective owners; all the rest copyright 2003-2010 Nolan Kelly.
Syndicate news: SpaceEmpires.net News RSS Feed - Syndicate forums: SpaceEmpires.net Forums RSS Feed
Page Generation: 0.24 Seconds