Some scripting help for Random Encounters mod please? -1 reply

Please wait...

Guest

I didn't make it!

0 XP

 
#1 13 years ago

Hi folks. I am using the Random Encounters mod but I would like to be able to specify my starting race as well as the number of ai/enemy ships that are spawned. Here is the script: _______________________________________________________________ import App import MissionLib import Foundation from Fleets import FleetList def createRandomPlayerShip(): races = FleetList.keys() n = App.g_kSystemWrapper.GetRandomNumber(len(races)) player_race = FleetList[races[n]] m = App.g_kSystemWrapper.GetRandomNumber(len(player_race)) return (races[n], player_race[m]) def createPlayerFleet(race): race_ships = FleetList[race] n = App.g_kSystemWrapper.GetRandomNumber(2) ships = [] for i in range(0, n+1): m = App.g_kSystemWrapper.GetRandomNumber(len(race_ships)) ships.append(race_ships[m]) return ships def createEnemyFleet(race, num): races = FleetList.copy() del races[race] race_ships = races.values()[App.g_kSystemWrapper.GetRandomNumber(len(races))] n = App.g_kSystemWrapper.GetRandomNumber(num) + 2 ships = [] for i in range(0, n+1): m = App.g_kSystemWrapper.GetRandomNumber(len(race_ships)) ships.append(race_ships[m]) return ships ______________________________________________________________ So what exactly do I change here in order to achieve the desired results? Thanks in advance for any assistance.




JimmyB76 Filer

ST: Bridge Commander Central Forums Admin

30,798 XP

19th March 2003

0 Uploads

2,860 Posts

84 Threads

#2 13 years ago

hmmm... interesting inquiry... this is one of my fav mods to play, personally, and i was curious of this as well (tho i'm stuck as you are...) might i suggest posting this as well over at BCU's scripting forum? You might have more help / luck there as well...